sqlparse icon indicating copy to clipboard operation
sqlparse copied to clipboard

A non-validating SQL parser module for Python

Results 194 sqlparse issues
Sort by recently updated
recently updated
newest added

A query without MATERIALIZED is formatted e.g. like this ``` WITH test_data AS (SELECT data1, data2, data3 FROM test_table) SELECT * FROM test_data ``` after adding the MATERIALIZED keyword it...

I am concerned that this extraction of column names is a very common sql parsing application #680, but there is no relevant example in the example, and such an example...

Hi team, when using sqlparser to extract token names and their parameters from queries as indicated in the following image: ![1](https://user-images.githubusercontent.com/96908558/219338117-dcc09ba7-22e6-4256-b9d4-ef0d6a3277c8.jpg) and given the following query: ![2](https://user-images.githubusercontent.com/96908558/219338125-1490568f-218d-4c5f-9292-b5ba89a5c4da.jpg) when we try...

Hi team, I'm currently experiencing a formatter issue. ![Screen Shot 2023-02-14 at 1 27 16 PM](https://user-images.githubusercontent.com/74613115/218825310-318afd0a-5fd5-4e89-bd89-294ca01f7516.png) Do we have a temporary solution or are we going to fix this indentation...

Lexer.get_default_instance() is not working because the current release [0.4.3](https://github.com/andialbrecht/sqlparse/releases/tag/0.4.3) does not have the updated code for lexer in source code. Can you please fix it?

MSSQL has queries of the form `SELECT TOP 10 "name", "id" from some_table`, but `TOP` is misparsed as an identifer rather than a keyword. Would it be possible to add...

When there is a Window Function (e.g., `ROW_NUMBER()`) followed by `OVER ( ... )` in the expressions after the `SELECT` statement, these expressions are not split correctly into individual `Identifier`s....

Expressions containing string aggregation with group ordering are parsed incorrectly. Example: statement = parse("SELECT LISTAGG(attr,', ') WITHIN GROUP(ORDER BY attr) as column FROM table") print(statement[0].tokens) results in: [, , ,...

This PR adds 2 new dicts to extend sqlparse's lexer: 1 for Snowflake and 1 for BigQuery. The proposed dicts are not exhaustive, and only add keywords not already covered...

Right now, sqlparse treats `\` as an escape character in strings, but this is not universal across all sql dialects. postgres and athena/presto both do not consider `\` as string...