sqlparse
sqlparse copied to clipboard
A non-validating SQL parser module for Python
@andialbrecht & @mrmasterplan update my initial PR with the lexer changes. See below! This PR will add frequently used Databricks and [Delta](https://delta.io/) table syntax. Databricks SQL has a lot of...
Hey, I just did my first test with a JOIN. At the end you see the "ON", which could look better with an "\n" infront. ` < snip > JOIN...
The below one REPLACE PROCEDURE is split into multiple as in screenshot REPLACE PROCEDURE WDP1POMD_OBJECT.TYPE_DO_DELETE( P_OBJECT_TYPE_CODE VARCHAR(1)) SQL SECURITY CREATOR #MAIN# : BEGIN DECLARE GV_PACKAGE_NAME VARCHAR(50) DEFAULT 'WDP1POMD_OBJECT_TYPE'; DECLARE gv_module_name...
https://github.com/andialbrecht/sqlparse/blob/9f44d54c07180b826a6276d3acf5e1458b507c3f/sqlparse/utils.py#L81-L90 FOO has a type of Name while $FOO has a type of Name.Placeholder. As FOO.BAR is parsed as an IdentifierList, I think $FOO.BAR should be parsed as IdentiferList as...
hey, recently I encountered `RecursionError: maximum recursion depth` when using the library to strip comments from a long query, please see my code for reproduce. I took a look into...
I was trying to combine sqlparse.parsestream with reading from stdin, but could not get it to work properly. Here's my approach: stream.py: ``` import sys import os import sqlparse #newin...
How to extract columns name from complex query having subquery like below: ` SELECT "Gender" AS "Gender", "Ethnicity" AS "Ethnicity", count(*) AS "count" FROM (Select distinct avg(t3."Age") As "Age", t1."Ethnicity"...
Suppose I have a query like this: ```tsql SELECT CASE WHEN condition_1 = 1 AND condition_2 = 2 AND condition_3 = 3 AND condition_4 = 4 AND condition_5 = 5...
**Is your feature request related to a problem? Please describe.** Do you want a feature to generalize the sql: ```'SELECT /* Test */ foo FROM bar WHERE id in (1,...
I'm not sure what the proper parsing should be exactly, but I don't think this is it. The way it parsed the various NULL, NULLs, FIRST, LAST that are identifier...