Skip to content

sqlparser breaks CURRENT_TIMESTAMP for sqlite #918

Closed
@lovasoa

Description

@lovasoa

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions