On this page
LIB LINT
Checks the Scripts of the Scripts Library for consistency problems, without changing them.
Syntax
LIB LINT [<script> | ALL]
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
<script> | No | A path relative to the Scripts Library root; only its findings are reported | Every Script |
ALL | No | Every Script | Every 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 | | |
|-------------------------------|-----------------------|-----------------------------------------------------------------------------------------|
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
@instanceor@environmenttag that names no Database Group or Environment of the CDF; - an invalid, reserved or duplicate name in
-- @params:; - a
-- @paramline that cannot be read, a parameter declared twice, a default that is not a value of its type, or a name required by@paramsand 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 noLETof the Script defines; - a possible positional parameter
%1to%9, which were removed: usename=valuearguments and${name}. ALIKE '%1%'pattern is reported too: check it; - a
TEXT,DATEorTIMESTAMPparameter of-- @paramwritten without quotes in a SQL statement: its value is inserted as it is, soWHERE CONTINENT = ${continent}withAsiaasks the database for a columnASIA. Write'${continent}'. It is a hint: ignore it when the parameter holds a column or table name on purpose. BroadSQL commands such asECHOandDUMPare not checked; - an
@accessvalue other thanreadorwrite, 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, aWITHquery 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
@dialectvalue 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 withLIB DELif you wish (LIB UNDObrings 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.
Related
Used in these how-tos
Last modified in release development.
Found something wrong or unclear on this page? Tell us, with the page address.