Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create table with schema detects field names as tables #168

Closed
YoannQDQ opened this issue Jun 15, 2021 · 0 comments · Fixed by #171
Closed

Create table with schema detects field names as tables #168

YoannQDQ opened this issue Jun 15, 2021 · 0 comments · Fixed by #171
Labels
Milestone

Comments

@YoannQDQ
Copy link

When creating a fully qualified table (with explicit schema), field names are recognized as tables.

from sql-metadata import Parser

SQL = """
CREATE TABLE mytable (
    code INTEGER NOT NULL,
    short_name CHAR(9)
);
"""
SQL2 = """
CREATE TABLE myschema.mytable (
    code INTEGER NOT NULL,
    short_name CHAR(9)
);
"""

Result

>>> Parser(SQL).tables
['mytable']

>>> Parser(SQL2).tables
['myschema.mytable', 'code', 'short_name']

@macbre macbre added this to the v2.3 milestone Jun 15, 2021
@macbre macbre added the bug label Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants