The relations MUST be (stop is the end of a range, end being a word of SQL): statement(id, kind, start, stop, text, fingerprint, read_only); node(id, parent, stmt, kind, field, ordinal, depth, start, stop) for every node of every statement in the order of the text, where parent is 0 for a statement and field names the field of the parent that holds the node; attr(node, name, value) for every field of a node that is not a node; ancestor(node, ancestor, distance); token(id, kind, start, stop, text); comment(id, style, marker, text, start, stop, placement, node); table_ref(node, name, access), where the access is read, write, create, alter or drop; column_ref(node, name, qualifier); function_call(node, name, argc, is_distinct); param(node, style, text); cte(node, name, uses); and diagnostic(id, severity, code, message, start, stop, rule, node).
Enforced (check): .github: cd commons/lang-sql && bun run verify — suite/introspect.test.ts: the relations give the statements, the nodes in the order of the text with their fields, attributes, ancestors, tokens, comments, names, calls, parameters, common table expressions and diagnostics
Proved by: lang-sql/suite/introspect.test.ts
Tests: passed: suite/introspect.test.ts the relations give the statements, the nodes in the order of the text with their fields, a
Cited by: aide/introspect/relations, Lang Sql