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:
Martin Kleusberg
2014-05-09 14:46:42 +02:00
parent 69df819687
commit 3761acfd02
8 changed files with 883 additions and 813 deletions
+3 -1
View File
@@ -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);}