Skip to content

Commit 16a0e8c

Browse files
committed
Allow for if() function in SQLite
The IF keyword won't be allowed in CREATE TABLE because it will naturally conflict with CREATE TABLE IF NOT EXISTS.
1 parent a550fbc commit 16a0e8c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/keywords/sqlite.keywords.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const keywordDefs: Record<string, string[]> = {
7979
GROUP: ["create-table", "col-alias", "tbl-alias", "col-name"],
8080
GROUPS: ["parser-issue"], // Should be allowed as alias name, but currently causes parsing issues.
8181
HAVING: ["create-table", "col-alias", "tbl-alias", "col-name"],
82-
IF: ["create-table"],
82+
IF: [],
8383
IGNORE: [],
8484
IMMEDIATE: [],
8585
IN: ["create-table", "col-alias", "tbl-alias", "col-name"],

test/expr/builtin_functions.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ describe("builtin functions", () => {
2121
"glob",
2222
"hex",
2323
"ifnull",
24+
"if",
2425
"iif",
2526
"instr",
2627
"last_insert_rowid",

0 commit comments

Comments
 (0)