sql-metadata
sql-metadata copied to clipboard
table function support
Postgres supports table function (SQL server supports it as well), currently, the usage of table function is not supported. For some examples:
- table function with table alias
SELECT
m.id
FROM
my_func() m
parser.columnsis expected to return['my_func.id'], but currently it returns['m.id']parser.tables_aliasesis expected to return{'m': 'my_func'}, but currently it returns{}
- table function in parameterized statement
SELECT
m.id
FROM
my_func(?) m
parser.tables is expected to return ['my_func'], but currently it returns ['?', 'my_func']
- References
- postgres table function, https://www.postgresql.org/docs/7.3/xfunc-tablefunctions.html
- SQL server table valued function, https://www.sqlservertutorial.net/sql-server-user-defined-functions/sql-server-table-valued-functions/