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

Hi there! I just found this library and I'm stoked because there are very very few good formatting options for SQL--at least that can be used on the command line....

I find that `StripWhitespaceFilter` may modify Whitespace token's `value` attribute directly, but `normalized` attribute is not updated. `Token`'s method `match()` relies on `normalized` attribute, and may not work as intended.

I wanna parse an Oracle sql using `sqlparse.parse` and see the content of parse tree. SQL Syntax: ```sql select FULL_LINK.t_E_join.id_e id_, FULL_LINK.t_B_join.*, FULL_LINK.t_E_join.name_e from FULL_LINK.t_B_join, FULL_LINK.t_E_join where FULL_LINK.t_E_join.id_e = '1'...

Addresses #384. Options added: - sql_dialect This option allows the user to select which sql dialect to use when parsing. Prior to this support, all SQL dialects (PGSQL, MYSQL, TSQL,...

When I try to format an SQL statement containing Chinese, it gives the following error. ```sql select * from mytest where name='测试'; ``` ``` Error: Traceback (most recent call last):...

For some reason when accessing json/jsonb structures in a select statement these statements get indented incorrectly: ``` select id, created_at, updated_at, row->'name', row->'age', row->'email' from users; ``` The command I...

# Thanks for contributing! Before submitting your pull request please have a look at the following checklist: - [x] ran the tests (`pytest`) - [ ] all style issues addressed...

**Describe the bug** Dollar quoted strings (e.g. PostgreSQL) are not properly detected, when there is an operator directly preceding the dollar quoted string (e.g `var=$$text$$`). While according to PostgreSQL docs...

In the python console: ``` >>> sqlparse.split('''CREATE OR REPLACE FUNCTION public.bug() RETURNS text ... LANGUAGE sql ... AS $func$ ... select $string$ Run this query: SELECT 123; $string$::text; ... $func$;''')...

**Describe the bug** When I'm using an "INSERT" preceded by "USE dbname; GO;", typically used in SQL Server, the first INSERT gives an error, being recognized as UNKNOWN . Example...