On this page

LIB LINT

Core command LI LN LILN

Checks the Scripts of the Scripts Library for consistency problems, without changing them.

Syntax

LIB LINT [<script> | ALL]

Arguments

ArgumentRequiredValuesDefault
<script>NoA path relative to the Scripts Library root; only its findings are reportedEvery Script
ALLNoEvery ScriptEvery Script

Examples

LIB LINT;
LIB LINT maintenance/cleanup.bsql;

Example session

LIB LINT;
LIB LINT found 2 issue(s):
|-------------------------------|-----------------------|-----------------------------------------------------------------------------------------|
| FILE                          | ERROR TYPE            | MESSAGE                                                                                 |
|-------------------------------|-----------------------|-----------------------------------------------------------------------------------------|
| admin/cleanup.bsql            | Erroneous Permissions | declared @access read, statement 1 is a DELETE                                          |
| countries/copy-of-largest.sql | Similar SQL           | same SQL apart from layout, comments and letter case (their access declarations differ) |
| countries/largest.sql         |                       |                                                                                         |
|-------------------------------|-----------------------|-----------------------------------------------------------------------------------------|
Illustrative output: the values come from the WORLD sample and the practice connections of the how-to on QA and production copies of WORLD, and the layout from this release; it was not captured from a BroadSQL run, and your timings will differ.

Details

LIB LINT reports problems; it never changes a Script. Without a name, or with ALL, it checks every Script; with a name, it reports only the findings about that Script.

Checks

  • an @instance or @environment tag that names no Database Group or Environment of the CDF;
  • an invalid, reserved or duplicate name in -- @params:;
  • a -- @param line that cannot be read, a parameter declared twice, a default that is not a value of its type, or a name required by @params and given a default by @param: every call of such a Script is refused. As hints: a declared parameter the Script never uses, and, in a Script declaring @param, a ${name} that no declaration and no LET of the Script defines;
  • a possible positional parameter %1 to %9, which were removed: use name=value arguments and ${name}. A LIKE '%1%' pattern is reported too: check it;
  • a TEXT, DATE or TIMESTAMP parameter of -- @param written without quotes in a SQL statement: its value is inserted as it is, so WHERE CONTINENT = ${continent} with Asia asks the database for a column ASIA. Write '${continent}'. It is a hint: ignore it when the parameter holds a column or table name on purpose. BroadSQL commands such as ECHO and DUMP are not checked;
  • an @access value other than read or write, or two different values;
  • in a Script declaring @access: read, a statement that changes a database (INSERT, UPDATE, CREATE..., LOAD, DUMP ... AS H2, connection management), and, as a hint, a statement BroadSQL cannot judge (a procedure call, a WITH query holding a data change, SELECT ... INTO, SELECT ... FOR UPDATE, a call of another Script). The declaration is information only: BroadSQL does not enforce it when the Script runs, and it cannot see what a function called in a query does;
  • an @dialect value that names no connection type of the CDF;
  • duplicate Scripts: identical SQL, or the same SQL apart from layout, comments and letter case. Only text is compared: two queries giving the same result in different ways are not reported. Nothing is changed: compare them with LIB SHOW, and remove one with LIB DEL if you wish (LIB UNDO brings it back).

With a name, the duplicate groups that Script belongs to are reported too.

Output

The findings are listed in a table of three columns: FILE (the Script; every Script of a duplicate group, one per line), ERROR TYPE (the kind of problem, such as Erroneous Permissions, Parameter declaration, Unquoted text parameter or Identical SQL) and MESSAGE (what is wrong). A line does not start with the prompt. When the table is wider than the terminal, the widest column continues on the following lines of the same row, so the separators stay aligned.

Used in these how-tos

Last modified in release development.

Found something wrong or unclear on this page? , with the page address.