IF Commons GitHub

Lang Sql (2 of 2)

2 specifications, 17 requirements. All libraries

0011 Acceptance utilities, sqlfs and sqlfind

RequirementMechanismWhoNote
FR-001checkbun run verifysuite/acceptance.test.ts: the dialect reads GLOB, ILIKE and the units, the profile is one table with no join, aggregate or subquery, the catalog types its columns, and a library registers the dialect and its functions
FR-002checkbun run verifysuite/acceptance.test.ts: a query is read, conformed, bound, typed and planned, and an error of any step is an error value with a span that each utility prints with the line and a caret
FR-003checkbun run verifysuite/acceptance.test.ts: sqlfs runs a query over a file system given as an interface, prunes the walk where the filter allows, gives what the in-memory table gives, and limits the rows
FR-004checkbun run verifysuite/acceptance.test.ts: sqlfind compiles a query to the arguments of find: depth, type, name patterns, path, size in bytes, time, owner and permissions are pushed, and what find cannot say is left to the process
FR-005checkbun run verifysuite/acceptance.test.ts: the flavors differ in what they read and push, and no argument list holds a flag that writes or runs, whatever the query holds
FR-006checkbun run verifysuite/acceptance.test.ts: --explain prints the plan, what is pushed and what is left, and --emit prints the command as JSON or as one line quoted for a shell
FR-007checkbun run verifysuite/acceptance-aat.test.ts: for every query of the table, sqlfs over the disk, sqlfs over the entries the fixture is meant to have and sqlfind through the real find give the same rows
FR-008checkbun run verifysuite/acceptance-aat.test.ts: each utility exits 0 for a query that runs, 1 for one that is wrong and 2 for a usage error; reports what it cannot read, lists a link that loops and does not follow it, limits depth and rows, leaves a hostile value in its own condition, and searches ten thousand entries in under ten seconds
FR-009checkbun run verifysuite/acceptance-aat.test.ts: the scenarios are answered as written by hand by both utilities, and the demo files are what the utilities print

0012 The guard of a query that only reads

RequirementMechanismWhoNote
FR-001checkbun run verifysuite/guard.test.ts: a statement that only reads is allowed, anything that writes, defines, takes locks or makes a table is refused, and a word of a write in a string, an identifier or a comment is not a violation
FR-002checkbun run verifysuite/guard.test.ts: more than one statement, none and one that could not be read are each a violation, and a trailing semicolon is not
FR-003checkbun run verifysuite/guard.test.ts: the denied functions are refused without regard to case or schema, and the list can be replaced
FR-004checkbun run verifysuite/guard.test.ts: a PRAGMA that reads is allowed only where it is asked for, and a PRAGMA that sets never is; suite/guard.test.ts: a PRAGMA that lists a table is a read where PRAGMA is allowed, and a call that sets is not
FR-005checkbun run verifysuite/guard.test.ts: a plain SELECT is bound to a catalog, the tables can be restricted, and the size of the statement can be limited; suite/guard.test.ts: a common table expression's own name is not a table of the allow-list, while the tables its body reads are still checked, and a name does not shadow a table inside its own definition
FR-006checkbun run verifysuite/guard.test.ts: refusal gives the sentence and the place of the first violation, and nothing throws for any text in any dialect
FR-007checkbun run verifysuite/guard.test.ts: a catalog is made from tables described in the types of another system, with a map of types and unknown for the rest
FR-008checkbun run verifysuite/guard.test.ts: set operations, window functions, joins, NULLS, FETCH and recursive CTEs are allowed where nothing writes, and refused where a data change or a SELECT INTO stands in them

Titles, headings, exports, tables, columns and requirements. Esc closes.