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.
* Support create or replace table
* Support create or replace view
* Simplify create or replace table parser
* Add tests for create or replace external table and materialized view
* Formatting
* Address review comments
* Create error if we didn't see a (external) table or (materialized) view afer create or replace
* update travis badge to point to actions status
It seems Travis is currently not updating as expected, likely as a side effect of the repo moving. If we're comfortable leaning on Actions, then we can switch out the badge here and plan to remove Travis entirely. Alternatively we could reconfigure Travis to work with the new repo name.
* Refer to correct branch
Co-authored-by: Dandandan <danielheres@gmail.com>
This implements `DROP [ COLUMN ] [ IF EXISTS ] column_name [ CASCADE ]`
sub-command of `ALTER TABLE`, which is what PostgreSQL supports https://www.postgresql.org/docs/12/sql-altertable.html
(except for the RESTRICT option)
Co-authored-by: Nickolay Ponomarev <asqueella@gmail.com>
Fixes#168 by enabling `DATE` and other keywords to be used as
identifiers when not followed by a string literal.
A "typed string" is our term for generalized version of `DATE '...'`/`TIME '...'`/
`TIMESTAMP '...'` literals, represented as `TypedString { data_type, value }`
in the AST.
Unlike DATE/TIME/TIMESTAMP literals, this is a non-standard extension
supported by PostgreSQL at least.
This is a port of MaterializeInc/materialize#3146
Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
Co-authored-by: Nickolay Ponomarev <asqueella@gmail.com>
This simplifies codes slightly, removing the need deal with the EOF case explicitly.
The clone kludge in `_ => self.expected("date/time field",
Token::Word(w.clone())))` will become unnecessary once we stop using
a separate match for the keywords, as suggested in
https://github.com/andygrove/sqlparser-rs/pull/193#issuecomment-641607194
Alter INTERVAL to support postgres syntax
This patch updates our INTERVAL implementation such that the Postgres
and Redshfit variation of the syntax is supported: namely that 'leading
field' is optional.
Fixes#177.
This patch provides an initial implemenation of LISTAGG[1]. Notably this
implemenation deviates from ANSI SQL by allowing both WITHIN GROUP and
the delimiter to be optional. We do so because Redshift SQL works this
way and this approach is ultimately more flexible.
Fixes#169.
[1] https://modern-sql.com/feature/listagg
Support `CREATE SCHEMA schema_name` and `DROP SCHEMA schema_name`.
Both ANSI SQL and Posgres define a number of options for the CREATE SCHEMA statement.
They also support including other CREATE statements as part of the schema definition,
rather than separate statements. This PR supports neither.