Ecosyste.ms: OpenCollective
An open API service for software projects hosted on Open Collective.
github.com/ivanceras/sql-ast
SQL abstract syntax tree
https://github.com/ivanceras/sql-ast
Clean up string-related variants in Token and Value
73f55fe1bb312c3f68deb274c3b38d531977ad07 authored almost 6 years ago by Andy Grove <[email protected]>Remove sqlparser_generic.rs/sqlparser_postgres.rs duplication
ff897b90860fc7911ccb5e6984ea3b435b81d517 authored almost 6 years ago by Andy Grove <[email protected]>0621f8d43c19c626eaa413661186ea2a721c4392 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
f30ab89ad289f50084f68824e3aaa8abb945e5b4 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
23a0fc79f5c5b9f23e25bd18ea57ab8e400f07a1 authored almost 6 years ago by Nikhil Benesch <[email protected]>
52e0f55b6f4d3330008ad1304d0270ba0f0bb6f6 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
https://jakewheat.github.io/sql-overview/sql-2011-foundation-grammar.html#character-string-type
533775c0dad14e7065a5f33b97b980df5f81a8b4 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>https://jakewheat.github.io/sql-overview/sql-2011-foundation-grammar.html#exact-numeric-type
23a0d032bde11538858b9ded98e3062048e91e5c authored almost 6 years ago by Nickolay Ponomarev <[email protected]>54c9ca86193d25fa29a2cd774a274bc9755dfabc authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
786b1cf18abad4bfbee5966bc31e0225eeb0fca0 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
bed03abe44035c4b3d8e9f5d6acafcddd1a90463 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
Some unsupported features are noted as TODOs.
bf0c07bb1bfcfafec42e07cc6f4acd2b0eb5818f authored almost 6 years ago by Nickolay Ponomarev <[email protected]>264319347dd6382ec9377a411f9c5fbedf5aa207 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
f958e9d3cf9cd2a8b8264dd9e93cf3bbe5c5cccd authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
028c613c3f4253a5ff9cb4a67380718a1b4969f6 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
Widely used in MS SQL and specified in ANSI.
35dd9342e2fa318be60b2dc5fb29d43eeb07680d authored almost 6 years ago by Nickolay Ponomarev <[email protected]>The dialect information is from https://en.wikibooks.org/wiki/SQL_Dialects_Reference/Data_struct...
b9f4b503b669930ece92b55fa02a0c5550e66515 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>b3693bfa63f14dff5e4c60485e85f06d37a7fb14 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
2e9da53ed3fce705df82defec5944981aae1e74c authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
577e634f3c341dcb2c4252647c073af991d31c39 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
0c0cbcaff4bfaca1d3e3512e5c44659ae084e20f authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
By not swallowing the Err from parse_data_type().
Also switch to `match` to enable parsing tabl...
346d1ff2e454d4df7b52798515c8609424e006f5 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
Don't need the duplicate `columns.push()` + we advance the tokenizer,
so no need to peek first.
89602dc0448157941505eb04eb77419430d2ef9d authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
...by reusing `parse_column_names` instead of extracting identifiers
out of the `parse_expr_list...
This happens all the time when I forget to check that the keyword I wanted
to use is actually li...
(the tests affected by "unboxing" in the previous commits.)
6b107065ac10dcd8cf92c38132f863e0da1545b5 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>Instead change ASTNode::SQLSubquery to be Box<SQLSelect>
e3b981a0e2c1c76779957886106d3706fefd92e5 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>This used to be needed when it was a variant in the ASTNode enum itself.
c5bbfc33fdcfe03031df873aca0f76a03b172d8f authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
It was probably copied from somewhere else when most types were variants
in ASTNode, and needed ...
ASTNode can now be renamed SQLExpression, as it represents a node in
the "expression" part of th...
Also move more things to use SQLIdent instead of String in the hope of
making it a newtype event...
Store (and parse) `table_name: SQLObjectName` instead of
`relation: Option<Box<ASTNode>>`, which...
...instead make `parse_compound_identifier()` return the underlying
Vec<> directly, and rename i...
...to match the name of the recently introduced `SQLObjectName` struct
and to avoid any reservat...
(To store "A name of a table, view, custom type, etc., possibly
multi-part, i.e. db.schema.obj"....
This makes the parser more strict when handling SELECTs nested
somewhere in the main statement:
...
I checked the docs of a few of the most popular RDBMSes, and it seems
there's consensus that the...
Parser::parse_sql() can now parse a semicolon-separated list of
statements, returning them in a ...
(The primary motivation was that it makes the tests more resilient to
the upcoming changes to th...
Before this change an expression like `(a+b)-(c+d)` was parsed correctly
(as a Minus node with t...
Before this commit there was a single `parse_expr(u8)` method, which
was called both
1) from wi...
b57c60a78c894c4f5d6d3621682aaaef25ef23de authored almost 6 years ago by Nickolay Ponomarev <[email protected]>Continuing from https://github.com/andygrove/sqlparser-rs/pull/33#issuecomment-453060427
This s...
2dec65fdb45f91d45b27f5a42b9e59daa698d43e authored almost 6 years ago by Nickolay Ponomarev <[email protected]>This will allow re-using it for SQLStatement in a later commit.
(Also split the new struct into...
d8173d4196d3a943d62b684053cf0b4d2f8c5654 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>45a5f844afee8eca26c8ce51aa57e1a4749dccb6 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
50b5724c39ad922814091caa84e921dfc948f018 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
The SQLAssignment *struct* is used directly in ASTNode::SQLUpdate (will
change to SQLStatement::...
...as in `FROM foo bar WHERE bar.x > 1`.
To avoid ambiguity as to whether a token is an alias o...
76ec175d20678771ee69e22b46b530d4b73217af authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
A "table factor" (name borrowed from the ANSI SQL grammar) is a table
name or a derived table (s...
This part changes behavior:
- Fail when no identifier is found.
- Avoid rewinding if EOF was hit...
Now populating SQLWord.keyword based on the list of globally supported
keywords.
991fd19b87df60d433fd903c3e13a31418426b09 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
...instead of parse_keyword / consume_token - to reduce nesting of `if`s.
(Follow-up to PR #35)
8c3479969f4b67f8aaceade56c4fb23d5b908c91 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
Fold Token::{Keyword, Identifier, DoubleQuotedString} into one
Token::SQLWord, which has the nec...
i.e. ASC/DESC/unspecified - so that we don't lose information about
source code.
Also don't tak...
3de2a0952cc4d1e6f78ebf3c1113d4d9cbd55729 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>because they share implementation.
d73a1e0e1d14a419fa0d9609d271544518c721f9 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>This reduces amount of boilerplate and avoids cloning the `expr` param.
eb4b5bc6864aa4ace9f63b95cf504aecc0a6d4d7 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>12b9f5aafc2846128d80205113e99d4d8c58dd24 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
70c799e21d295d45bc707afa03bb3c42a5547923 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
These have identical copies in sqlparser_generic.rs
d5109a2880bedfe7cb10d684f3a9a926a4fb0b7c authored almost 6 years ago by Nickolay Ponomarev <[email protected]>...as this syntax is not specific to the PostgreSQL dialect.
Also use verified() to assert that...
9441f9c5d84f117b21a72a35a2123e99c3df7980 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
...and parser support for the corresponding token, as "..." in SQL[*] is
not a literal string li...
Its existence alongside SingleQuotedString simply doesn't make sense:
`'a string'` is a string l...
Indeed, given that there is Token::SingleQuotedString and
Token::Identifier, there's no other "s...
An identifier is not a literal value, and parse_value is not called on
such a token anyway.
45dab0e2d4553b4eb0fec0993128300e273e90a3 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
Mainly by replacing `assert_eq!(sql, ast.to_string())` with a call to
the recently introduced `v...
82b14673243e5193c690a2cb50c009fac3a7fa87 authored almost 6 years ago by Andy Grove <[email protected]>
bde2e2d660992215ba1309289b60fc6aae6f6704 authored almost 6 years ago by Andy Grove <[email protected]>
Clean up consume_token() and parse/expect_keyword()
47e00af15b6f0585c8dbd9726bf21eaebcdd6d66 authored almost 6 years ago by Andy Grove <[email protected]>ae06dc79016051e81c0edc0c34fac66a618039c7 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
fd9e2818d71f38990e80f2053877c41bf7a60c7f authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
Add #[must_use] to warn against unchecked results of parse_keyword/s in
the future.
Before this missing keywords THEN/WHEN/AS would be parsed as if they
were in the text as the cod...
The function is invoked after a DoubleColon was already matched.
89cfa9e5997ae017ae2fd5a1b8fe560ab22e18bd authored almost 6 years ago by Nickolay Ponomarev <[email protected]>dce09f80542f0d0784af2f61240391fa0fa2c773 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
ac365bd44eda7e341848c864c663c9a1d445121b authored almost 6 years ago by Andy Grove <[email protected]>
a987503b2ce09ff27f5bc4252f691d4a7c2a32f3 authored almost 6 years ago by Andy Grove <[email protected]>
implement NOT
115c8e5595b1a0b61d1b12bc75c19a5f9e559f99 authored almost 6 years ago by Andy Grove <[email protected]>c0cafb7308846f22558ba08e7179b2050c1608b2 authored almost 6 years ago by Andy Grove <[email protected]>
777fd4c2ee48a26c0b8c04ea3e1fe5f13dc40a85 authored almost 6 years ago by Andy Grove <[email protected]>
a52b59e3ab6e064469c43e23a6e821c8b2d4f108 authored almost 6 years ago by Andy Grove <[email protected]>
f8c6fa96f4d82c031bc14cadce174fa4457d1433 authored almost 6 years ago by Andy Grove <[email protected]>
8c351fe10a9ef43f7cbcef3417e291e7b181e24c authored almost 6 years ago by Andy Grove <[email protected]>
32d53a6b7e0d95d36bc5c6fa0952849423cf337d authored almost 6 years ago by Andy Grove <[email protected]>
7233a7e71f8da3f73d31879650fe94fcfe746509 authored almost 6 years ago by Andy Grove <[email protected]>
81954bffb844a6841e806bff119a158188f65a0c authored almost 6 years ago by Andy Grove <[email protected]>
Miscellaneous fixes
25718b8028ae22a7114b87ee41ed3b42a219fd83 authored almost 6 years ago by Andy Grove <[email protected]>ab423bc9dc0e0c3f812985ab817a8faad367fe80 authored almost 6 years ago by Andy Grove <[email protected]>
...it gets handled just as well by the infix parser.
(Add a test while we're at it.)
1) Simplified the bit in parse_datatype()
2) Made sure it was covered by the test (the "public.y...
There's no Token::Period in such situation, so fractional part (from sec) was silently truncated...
3b13e153a8da17a38ed1bdf0c11dcaf47f620afb authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
Remove `pub` from the "internal" ones. Remove ones that duplicate each
other completely.
52277c3025d65e6669e1e9b19948055383ca872f authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
2873b0cee2ff886ea72cd827ed0e7f0129167da8 authored almost 6 years ago by Nickolay Ponomarev <[email protected]>
ee1944b9d94bd22f0da651b39dc6b433c45a00b3 authored about 6 years ago by Andy Grove <[email protected]>
5d62167d6e6a5506a35f4c1d709d67079d8fb80f authored about 6 years ago by Andy Grove <[email protected]>
7aab880387bf493b5fbafed9bccc282f4727dba8 authored about 6 years ago by Andy Grove <[email protected]>
2240dd09ffade8db5a068053fd1e07c6b054cb2b authored about 6 years ago by Andy Grove <[email protected]>
d0b5d5e8824b56ce4bc85414bf78a5691b6687e1 authored about 6 years ago by Andy Grove <[email protected]>