* Add derive based AST visitor
* Fix BigDecimal
* Fix no visitor feature
* Add test
* Rename visit_table to visit_relation
* Review feedback
* Add pre and post visit
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* fix: Handle double quotes inside quoted identifiers correctly
This fixes#410 for standard SQL, however I don't know enough about other dialects to know if they
handle this differently. May need more extensive testing as well.
* refactor: Make quoted identifier parsing a seperate function
* test: Check that quoted identifier tokenization works
Added `pretty_assertions` so that the `assert_eq!` in the tokenization is readable
* test: Check that quoted identifiers work in mysql
* chore: cargo clippy
* Move the keywords mod from dialect mod into the root of library
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
* re-export keywords from dialect for backwards compatiblity
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
To share helper macros between various tests/* we added a new module
(tests/macros/mod.rs). This made the prologue to be used in tests quite
long and a little weird:
```
#[macro_use]
#[path = "macros/mod.rs"]
mod macros;
use sqlparser::test_utils::*;
```
This simplifies it to:
```
#[macro_use]
mod test_utils;
use test_utils::*;
```
- and switches all existing tests to the new prologue simultaneously...
...while fixing a few other inconsistencies and adding a few comments
about the way `test_utils` work.
* 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>
The rationale here is the same as the last commit: since this crate
exclusively parses SQL, there's no need to restate that in every type
name. (The prefix seems to be an artifact of this crate's history as a
submodule of Datafusion, where it was useful to explicitly call out
which types were related to SQL parsing.)
This commit has the additional benefit of making all type names
consistent; over type we'd added some types which were not prefixed with
"SQL".
Standardize the license header, removing the Grove Enterprise copyright
notice where it exists per #58. Also add a CI check to ensure that files
without license headers don't get merged.
Fix#58.