Skip to content

sqlparser breaks CURRENT_TIMESTAMP for sqlite #918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lovasoa opened this issue Jul 14, 2023 · 2 comments · Fixed by #930
Closed

sqlparser breaks CURRENT_TIMESTAMP for sqlite #918

lovasoa opened this issue Jul 14, 2023 · 2 comments · Fixed by #930

Comments

@lovasoa
Copy link
Contributor

lovasoa commented Jul 14, 2023

In SQLPage, we parse SQL queries using sqlparser in order to be able to modify them, and then dump them as text to run them on the database. This requires the process of parsing and then stringifying back not to break the semantics nor the syntax of the query.

However, the following SQLite query:

SELECT CURRENT_TIMESTAMP;

when parsed and then dumped back, gives:

SELECT CURRENT_TIMESTAMP();

This breaks the syntax for SQLite, which gives

sqlite> SELECT CURRENT_TIMESTAMP();
Error: in prepare, near "(": syntax error (1)
@alamb
Copy link
Contributor

alamb commented Jul 19, 2023

@lovasoa
Copy link
Contributor Author

lovasoa commented Jul 22, 2023

@alamb : thanks for the pointers ! I opened a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants