iafisher / sqliteparser

A parser for SQLite's dialect of SQL
https://sqliteparser.readthedocs.io/en/latest/
MIT License
1 stars 1 forks source link

Parse `CASE` expressions #11

Open iafisher opened 2 years ago

iafisher commented 2 years ago

e.g.,

CREATE TABLE "~usertenant" (
"user" TEXT NOT NULL,
"tenant" TEXT NOT NULL,
"is_admin" INT,
"is_sys" INT DEFAULT 0,
"allow" AS (CASE WHEN is_admin = 1 THEN 'a' ELSE '' END ||
CASE WHEN is_sys = 1 then 's'ELSE '' END) STORED);

See #10 for background.