mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-22 23:14:07 +00:00
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:
parent
0c82be5c3b
commit
0c83e5d9e8
7 changed files with 57 additions and 3 deletions
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue