Support SQLite's WITHOUT ROWID in CREATE TABLE (#208)

Per https://sqlite.org/lang_createtable.html

Co-authored-by: mashuai <mashuai@bytedance.com>
This commit is contained in:
mz 2020-06-26 20:11:46 +08:00 committed by GitHub
parent 0c82be5c3b
commit 0c83e5d9e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 3 deletions

View file

@ -1021,6 +1021,7 @@ impl Parser {
file_format: Some(file_format),
location: Some(location),
query: None,
without_rowid: false,
})
}
@ -1110,6 +1111,9 @@ impl Parser {
// parse optional column list (schema)
let (columns, constraints) = self.parse_columns()?;
// SQLite supports `WITHOUT ROWID` at the end of `CREATE TABLE`
let without_rowid = self.parse_keywords(&[Keyword::WITHOUT, Keyword::ROWID]);
// PostgreSQL supports `WITH ( options )`, before `AS`
let with_options = self.parse_with_options()?;
@ -1130,6 +1134,7 @@ impl Parser {
file_format: None,
location: None,
query,
without_rowid,
})
}