sql-metadata icon indicating copy to clipboard operation
sql-metadata copied to clipboard

Uses tokenized query returned by python-sqlparse and generates query metadata

Results 102 sql-metadata issues
Sort by recently updated
recently updated
newest added

I'd like to extract all the subqueries of a query. How can I do that? I tried the below, it didn't work. ``` query = """SELECT * FROM customers WHERE...

Hi Macbre, First off all I would like to congratule you and say thank you for your work and sharing it with the community. I would like to know if...

If I want to parse the following sql, the `columns`, `columns_dict` and so on are not correct. ```sql CREATE TABLE `jeecg_order_main` ( `id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT...

sql_metadata.Parser("""MERGE INTO wines w USING (VALUES('Chateau Lafite 2003', '24')) v ON v.column1 = w.winename WHEN NOT MATCHED INSERT VALUES(v.column1, v.column2) WHEN MATCHED UPDATE SET stock = stock + v.column2;""").tokens raise...

This may not be a bug but a new feature but I have experienced that queries that have UNION or INTERSECT / MINUS (less common) are not parsed correctly. Especially...

bug

Can we modify the two functions below? Microsoft SQL Server and Sybase both allow empty db schema(s). If empty it defaults to either the user login or "dbo" depending if...

SQL Server
Sybase

Hi, I would like to know whether this python library is currently supporting Oracle based SQL query syntaxes? More appropriately, following is the version information ``` Oracle Database 19c Enterprise...

question
Oracle SQL

Solved the nested query parser.columns_dict set result. Excluded 'join' and 'where' columns from 'select' dict of parser.columns_dict

bug

I just found that the **"INSERT OVERWRITE TABLE"** statement cannot be parsed incorrectly. The variable name that represents the partition was also recognized as the table name. The case is...

bug
Hive

The input SQL is : SQL = “ALTER TABLE table_name DROP IF EXISTS PARTITION (dt = 20240524)” The code is : >>> Parser(SQL).tables The output is: ['table_name', 'PARTITION', 'dt'] While...

bug
Hive