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):
- admin/cleanup.bsql: declared @access read, statement 1 is a DELETE
- same SQL apart from layout, comments and letter case: countries/copy-of-largest.sql, countries/largest.sql (their @access declarations differ)
LIB LINT reports, changes nothing

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 ${name} written inside a quoted string, where it is not replaced. It is not reported for ECHO, which prints variable values inside its quotes;
  • 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.

Used in these how-tos

Last modified in release 5.5.0.

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