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

sql-metadata does not understand VALUES Lists constructs

Open YoannQDQ opened this issue 4 years ago • 3 comments

Example (Postgresql) : https://www.postgresql.org/docs/9.4/queries-values.html


>>> from sql_metadata import Parser
>>> SQL = "SELECT * FROM (VALUES (1), (2), (3)) AS X(a);"
>>> Parser(SQL).tables
["VALUES"]

YoannQDQ avatar Jun 15 '21 09:06 YoannQDQ

@macbre how do you see this?

For me it's more an enhancement than a bug as this use of values is a generative function like the ones described in #166 . In sample provided there is no real table or column. a is a column alias but refer to manually typed values and not real db column/data.

collerek avatar Jun 16 '21 09:06 collerek

@collerek - you're right, this does look more like an enhancement then a bug.

macbre avatar Jun 16 '21 09:06 macbre