Cannot parse sqlite `NVARCHAR` correctly
See original GitHub issueSQLite uses NVARCHAR()
for VARCHAR()
but it appears sqlglot does not support this.
sqlglot.errors.ParseError: Expecting ). Line 1, Col: 19.
CREATE TABLE z (a NVARCHAR(200) NOT NULL)
I think the correct thing is to map NVARCHAR
to VARCHAR
in the sqlite dialect definition’s keywords block, and that works the case above, but this case still fails:
sqlglot.errors.ParseError: Expecting ). Line 5, Col: 12.
CREATE TABLE "Track"
(
"TrackId" INTEGER NOT NULL,
"Name" NVARCHAR(200) NOT NULL,
"AlbumId" INTEGER,
"MediaTypeId" INTEGER NOT NULL,
"GenreId" INTEGER,
Not sure why the latter case isn’t fixed by adding the NVARCHAR
mapping to the VARCHAR token type.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Sqlite3 cannot correctly query a UTF-8 string? - Stack Overflow
To fix it, I had to convert all my input data to the decomposed form. from unicodedata import normalize with open(poll, encoding='utf-8') as ......
Read more >Frequently Asked Questions - SQLite
Short answer: A column declared INTEGER PRIMARY KEY will autoincrement. Longer answer: If you declare a column of a table to be INTEGER ......
Read more >SQLite can't open database file - error: encrypted or not a ...
I was able to copy the database file into the application's local folder. However, I can't open it. When I run this code,...
Read more >How to properly format sqlite shell output?
For "human readable" output, you can use column mode, and turn header output on. That will get you something similar to the sqlplus...
Read more >How to config Identity for SQLite · Issue #5131 - GitHub
I'm going in circles following the links and not finding a good summary. All I read is "I spent a lot of time...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i’ve added constraint and foreign key parsing
https://github.com/tobymao/sqlglot/commit/9059c552589b2d737d8e87b45728377adf1e0407