mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 15:36:33 +00:00
build(server): count the bare datetime name the query builder takes
The datetime rule only matched a literal holding a call such as
datetime('now'). The query builder spells the same function as
eb.fn('datetime', [...]), where the literal is just the name, so that form
slipped through while strftime, json_extract and glob are caught bare. A
literal that is exactly datetime, julianday or unixepoch now counts as well,
the same way the glob rule treats a bare glob. The only such call lives in the
dialect layer, which is not scanned, so the baseline does not change.
This commit is contained in:
@@ -72,6 +72,7 @@ describe('dialect-lint.mjs', () => {
|
||||
['insert-or', "void 'INSERT OR IGNORE INTO t (a) VALUES (?)';"],
|
||||
['insert-or', 'void `INSERT OR REPLACE INTO t (a) VALUES (?)`;'],
|
||||
['datetime', "void \"UPDATE t SET at = datetime('now')\";"],
|
||||
['datetime', "declare function fn(name: string, args: string[]): void;\nfn('julianday', ['now']);"],
|
||||
['strftime', "void `SELECT strftime('%s', 'now')`;"],
|
||||
['json', "void 'SELECT json_extract(settings, ?) FROM users';"],
|
||||
['glob', "void 'SELECT id FROM t WHERE name GLOB ?';"],
|
||||
|
||||
Reference in New Issue
Block a user