Skip to content

gen-utplsql

This command generates a utPLSQL PL/SQL package for the SQL-based tests in a dbLinter configuration. It considers registered test results to be ignored. The parameters used in the SQL-based tests are replaced by the values defined in the chosen configuration.

This feature is only available with a Professional Subscription.

dblinter [<options>] gen-utplsql [<args>]

See Options. Mandatory options are tenantName, userName, accessToken and configName.

--<argument>=<value>

It is not possible to set arguments using environment variables. Beside that, in dbLinter, both arguments and options are treated in the same way. Therefore, they can be used in any order. For example, they can be used before or after the command name. We use options when the semantics are identical for each applicable command. Arguments are used when the semantics change for a command.

  • outputName
    This is the relative path from the working directory to the base name of the output file(s). Any missing target directories will be created. Any existing files will be overwritten. The default is packageName, where packageName is replace with the value of the packageName argument.

  • specExt
    This is the name of the file extension of the PL/SQL package specification. The default is .sql if the option bodyExt is not defined, otherwise .pks.

  • bodyExt
    This is the name of the file extension of the PL/SQL package body. The default is .sql if the option specExt is not defined, otherwise .pkb.

  • packageName
    This is the name of the PL/SQL package. The default is tenantName_configName, where tenantName is replaced with the value of the tenantName option and configName is replaced with the value of the configName option.

  • suitePath This is the name of the utPLSQL suite-path. The default is dblinter.

Terminal window
dbLinter gen-utplsql \
--tenantName=Demo \
--userName=philipp.salvisberg+42@gmail.com \
--accessToken=*** \
--configName=Minimal \
--indent=3 \
--outputName=dblinter_demo_test \
--specExt=.pks \
--bodyExt=.pkb \
--packageName=dblinter_demo_test \
--suitePath=dblinter

The console output looks like this:

Using connection to jdbc:oracle:thin:@localhost:1521/freepdb1 with user DBL_READ
utPLSQL package spec written to dblinter_demo_test.pks
utPLSQL package body written to dblinter_demo_test.pkb

Here is the content of the two generated files:

create or replace package dblinter_demo_test is
-- The utPLSQL test suite was generated by the 'Demo' tenant using the 'Minimal' configuration.
--%suite
--%suitepath(dblinter)
--%test(Core G-1210: Never create a table without a primary key.)
procedure core_g_1210;
--%test(Core G-1310: Never keep database objects in an invalid state.)
procedure core_g_1310;
end dblinter_demo_test;
/
show errors;