* Generalize EscapeSingleQuoteString to arbitrary quote character
* Fix escaping of trailing quote in quoted identifiers
* Add new tests instead of modifying existing tests
* support MySQL UNSIGNED
* fix: 🐛 `unsigned` is not column option
* test: 💍 add `unsigned` test
* fix: 🐛 `unsigned` is not column option
* feat: 🎸 declare unsigned data_types
* feat: 🎸 display unsigned
* fix: 🐛 unsigned is not column type option
* feat: 🎸 parse_data_type can parse unsigned
* feat: 🎸 int or decimal or float is unsigned selectable
* fix: 🐛 FLOAT/DOUBLE/DECIMAL + UNSIGNED is not recommended
https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html
* test: 💍 add test
* style: 💄 fmt
* 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
* Add FunctionArgExpr and remove Expr::[Qualified]Wildcard,
There is no use case of `Expr::Wildcard` and `Expr::QualifiedWildcard` only except for function argments.
Add `FunctionArgExpr` to have `Wildcard` and `QualifiedWildcard`, and remove wildcards in `Expr`.
* Apply `FunctionArgExpr` to sqlparser_mysql tests
* * implement the ON DUPLICATE KEY syntax for MySQL in an INSERT statement
* * add MySQL to the cli example
* remove the dialect check for the ON DUPLICATE KEY insert to support
custom dialects and unwrap some missing results
* * use the Assignment DataType for the ON DUPLICATE KEY UPDATE
* * add support for table aliases in an UPDATE statement
* add support for JOINS in an UPDATE statement (for MySQL)
* * implement the MySQL ALTER TABLE CHANGE COLUMN syntax
* * fix the formatting of the else * rename the parse_identifiers_strict
to parse_identifiers_non_keywords
* Parse SUBSTRING calls that are separated with a comma instead of
keywords
* Fix the linting errors
Co-authored-by: Piotr <piotr.morawski@nc-vision.com>
Co-authored-by: Piotr Morawski <contact@peter-morawski.de>
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.
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.
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.