Enable dialect specific behaviours in the parser (#254)

* Change `Parser { ... }` to store the dialect used:
    `Parser<'a> { ... dialect: &'a dyn Dialect }`

    Thanks to @c7hm4r for the initial version of this submitted as
    part of https://github.com/ballista-compute/sqlparser-rs/pull/170

* Introduce `dialect_of!(parser is SQLiteDialect |  GenericDialect)` helper
    to branch on the dialect's type

* Use the new functionality to make `AUTO_INCREMENT` and `AUTOINCREMENT`
  parsing dialect-dependent.


Co-authored-by: Christoph Müller <pmzqxfmn@runbox.com>
Co-authored-by: Nickolay Ponomarev <asqueella@gmail.com>
This commit is contained in:
eyalleshem 2020-08-10 16:51:59 +03:00 committed by GitHub
parent 3871bbc5ee
commit 1b46e82eec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 17 deletions

View file

@ -35,6 +35,7 @@
#![warn(clippy::all)]
pub mod ast;
#[macro_use]
pub mod dialect;
pub mod parser;
pub mod tokenizer;