You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@gwenn I think this is something really specific, and validating semantics is a really dangerous place to go.
I think we could look into that, but that would require a good study of the approach of each dialect and, as stated on SQL ANSI 2011 (1):
Sometimes the Syntax Rules forbid two elements at different ordinal positions from having
equivalent names (particularly when created through an ). When two elements with
equivalent names are permitted, then the element name is ambiguous and attempts to reference either element
by name will raise a syntax error.
Therefore, not necessarily all databases return errors when we have ambiguous columns on creation. @alamb what do you think?
I agree -- this crate is designed to parse SQL syntax and does so quite forgivingly (doesn't error as much as parsers tied to a specific implementation might).
We have purposely left checks of what syntax is semantically valid / invalid to the users of this crate.
Another example is that I suspect this crate parses more and different data types than sqlite allows
@AugustoFKL maybe this is good information we can add to the readme so it doesn't keep getting asked or causing confusion
SQLite raises a parser error with the following DDL:
But
sqlparser
doesn't:% cargo run --example cli ddl.sql --sqlite ... Round-trip: 'CREATE TABLE test (x TEXT, x TEXT)' Parse results: [ CreateTable { ...
Is this kind of checks considered out of scope ?
Thanks.
The text was updated successfully, but these errors were encountered: