This commit is contained in:
seb
2026-10-30 15:43:28 +01:00
parent 0fdffb864f
commit a4718d81c0
5 changed files with 32 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ export function sqliteQuery(sql) {
let result = quoteIdentifiers(sql)
.replace(/\bWITH\s*\(\s*(?:NOLOCK|UPDLOCK|ROWLOCK|HOLDLOCK|READPAST)(?:\s*,\s*(?:NOLOCK|UPDLOCK|ROWLOCK|HOLDLOCK|READPAST))*\s*\)/gi, '')
.replace(/\bISNULL\s*\(/gi, 'IFNULL(')
.replace(/\bLEN\s*\(/gi, 'LENGTH(')
.replace(/\bSYSUTCDATETIME\s*\(\s*\)/gi, "strftime('%Y-%m-%dT%H:%M:%fZ', 'now')")
.replace(/\bDATEDIFF_BIG\s*\(\s*second\s*,\s*'1970-01-01'\s*,\s*([^)]+?)\s*\)/gi, "CAST(strftime('%s', $1) AS INTEGER)")
.replace(/\bCAST\s*\(([^()]+?)\s+AS\s+INT\s*\)/gi, 'CAST($1 AS INTEGER)')