We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite allows some ways of defining a generated column which sqlparser currently rejects.
First, the GENERATED ALWAYS keywords are optional:
GENERATED ALWAYS
Parser::parse_sql(&SQLiteDialect {}, "CREATE TABLE t1(a INT, b INT AS (a * 2) STORED);")?;
Error: sql parser error: Expected ',' or ')' after column definition, found: AS at Line: 1, Column 30
Second, the clause can have a VIRTUAL keyword stuck on the end (instead of STORED). This is the default behaviour anyway, just made explicit.
VIRTUAL
STORED
Parser::parse_sql(&SQLiteDialect {}, "CREATE TABLE t1(a INT, b INT GENERATED ALWAYS AS (a * 2) VIRTUAL);")?;
Error: sql parser error: Expected ',' or ')' after column definition, found: VIRTUAL at Line: 1, Column 58
I think the distinction of stored-or-not is also not exposed in the AST at present.
I can have a go at fixing one or both of these, but I wanted to record the issue clearly first.
The text was updated successfully, but these errors were encountered:
#1051 fixed VIRTUAL. I'll work on making GENERATED ALWAYS optional, but probably not until next week.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
SQLite allows some ways of defining a generated column which sqlparser currently rejects.
First, the
GENERATED ALWAYS
keywords are optional:Second, the clause can have a
VIRTUAL
keyword stuck on the end (instead ofSTORED
). This is the default behaviour anyway, just made explicit.I think the distinction of stored-or-not is also not exposed in the AST at present.I can have a go at fixing one or both of these, but I wanted to record the issue clearly first.
The text was updated successfully, but these errors were encountered: