mz
09ca14fe8e
Support dialect-specific auto-increment column options for MySQL and SQLite ( #234 )
...
In MySQL it's AUTO_INCREMENT
(see https://dev.mysql.com/doc/refman/8.0/en/create-table.html )
and in SQLite it's AUTOINCREMENT.
We use `ColumnOption::DialectSpecific(Vec<Token>)` to avoid adding a new variant for each vendor-specific column option.
2020-07-28 23:34:21 +03:00
Daniël Heres
15d5f71646
Add CREATE TABLE AS support ( #206 )
...
We parse it as a regular `CREATE TABLE` statement
followed by an `AS <query>`, which is how BigQuery works:
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_statement
ANSI SQL and PostgreSQL only support a plain list of columns
after the table name in a CTAS
`CREATE TABLE t (a) AS SELECT a FROM foo`
We currently only allow specifying a full schema with data
types, or omitting it altogether.
https://www.postgresql.org/docs/12/sql-createtableas.html
https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#as-subquery-clause
Finally, when no schema is specified, we print empty parens after a
plain `CREATE TABLE t ();` as required by PostgreSQL, but skip them
in a CTAS: `CREATE TABLE t AS ...`. This affects serialization only,
the parser allows omitting the schema in a regular `CREATE TABLE` too
since the first release of the parser:
7d27abdfb4/src/sqlparser.rs (L325-L332)
Co-authored-by: Nickolay Ponomarev <asqueella@gmail.com>
2020-06-23 16:30:22 +03:00
Alex Kyllo
172ba42001
Add support for MSSQL's SELECT TOP N syntax ( #150 )
...
Add support for MSSQL SELECT TOP (N) [PERCENT] [WITH TIES] syntax.
2020-01-12 23:20:48 -05:00
Robert Grimm
b1cbc55128
Turn type Ident into struct Ident
...
The Ident type was previously an alias for a String. Turn it into a full
fledged struct, so that the parser can preserve the distinction between
identifier value and quote style already made by the tokenizer's Word
structure.
2019-10-20 00:16:41 -04:00
Brandon W Maister
f64928e994
Support MySQL SHOW COLUMNS
statement
...
Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
2019-08-14 15:13:05 -04:00