mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-03 10:29:54 -05:00
Extend SQL grammar to recognise 'without rowid' tables correctly
Since version 3.8.2 SQLite supports tables without the internal rowid column added to the table. For these tables the primary key serves as a replacement for the rowid column. These changes update the grammar parser to correctly handle 'without rowid' tables and also generate 'without rowid' SQL statements.
This commit is contained in:
@@ -62,6 +62,7 @@ tokens {
|
||||
REPLACE="REPLACE";
|
||||
RESTRICT="RESTRICT";
|
||||
ROLLBACK="ROLLBACK";
|
||||
ROWID="ROWID";
|
||||
SET="SET";
|
||||
TEMPORARY="TEMPORARY";
|
||||
TEMP="TEMP";
|
||||
@@ -69,6 +70,7 @@ tokens {
|
||||
UNIQUE="UNIQUE";
|
||||
UPDATE="UPDATE";
|
||||
WHEN="WHEN";
|
||||
WITHOUT="WITHOUT";
|
||||
|
||||
//ast
|
||||
|
||||
@@ -252,7 +254,7 @@ keywordastablename
|
||||
createtable
|
||||
:
|
||||
CREATE (TEMP|TEMPORARY)? TABLE (IF_T NOT EXISTS)? (tablename | keywordastablename)
|
||||
( LPAREN columndef (COMMA columndef)* (COMMA tableconstraint)* RPAREN
|
||||
( LPAREN columndef (COMMA columndef)* (COMMA tableconstraint)* RPAREN (WITHOUT ROWID)?
|
||||
| AS selectstmt
|
||||
)
|
||||
{#createtable = #([CREATETABLE, "CREATETABLE"], #createtable);}
|
||||
|
||||
Reference in New Issue
Block a user