sql-metadata
sql-metadata copied to clipboard
Uses tokenized query returned by python-sqlparse and generates query metadata
When there are nested CTEs, the parser returns invalid tables. It returns one of the CTEs as a table. SQL: ``` WITH CTE_ROOT_1 as ( With CTE_CHILD as ( SELECT...
I am trying to parse the query of the following nature - ```sql SELECT ARRAY['seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'years']; ``` Which is a valid statement and returns a...
Hi, There is no way to use parser if aliases of columns and subqueries are somewhere in common, for example: select a.id as a_id, b.name as **b_name** from table_a as...
Hi, I think I have found a bug regarding subqueries, namely a subquery that seems intentionally left out in (https://github.com/macbre/sql-metadata/blob/master/sql_metadata/keywords_lists.py): `query = "SELECT a.model FROM CAR_NAMES a JOIN CARS_DATA b...
How can I get the aggregation function? for example, select sum(columnA) from a , I want to get the aggregate function "sum()". Is there any function in this package can...
Hi, While trying to extract the columns from the below query I'm getting a value error "ValueError: 'posted_dt' is not in list". 1. SELECT app.acty_dt , base.posted_dt FROM DB.SCH.WTBL app...
Many Parser methods return UniqueList but the type hinting indicates List. This is confusing when you first write tests and leads to inconsistency between the type hints in consuming code...
If I parse this, valid Presto, query: ```SQL SELECT col_ FROM my_table CROSS JOIN UNNEST(my_col) AS t(col_) ``` I get three table names: * `my_table` (correct) * `my_col` (incorrect) *...
Hi, I am using following query. In this, two tables and two columns (columns_dict['where']) are the output. There is not info to relate which column corresponds to which table. "SELECT...
Hi, I am using this library for extracting columns and tables from a view definition, and when I run it against a view definition, it shows the following error: ---------------------------------------------------------------------------...