-
Notifications
You must be signed in to change notification settings - Fork 1
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
Only latest table name is saved #50
Comments
Thanks for your support. I need this table name extraction feature over there right now, and probably later for other spots as well. So, when looking at this... schema=['sys', 'doc'], table_name=['t', 'b'] ... would I need to coalesce them together again to get full-qualified table names like /cc @matriv, @hlcianfagna, @hammerhead, @seut |
Idea:
>>> t = Table(schema='doc', name='t')
>>> t.quoted
"doc"."t" Would also enable new stuff in the future like aliases. >>> stmt = sqlparse('SELECT a FROM sys.t alias_a JOIN doc.b alias_b ON t.a = b.a')[0]
>>> t = stmt.tables[0]
>>> t
Table(schema='sys', name='t')
>>> t.quoted
'"sys"."t"'
>>> t.alias
{"alias_b": 'sys.t'} |
OO FTW. Excellent, je vous remercie. Suggestion: Maybe use |
JFYI: Maybe CrateDB Toolkit's quote_relation_name() function is helpful in any way? Please let me know, I planned to refactor it to sqlalchemy-cratedb earlier or later. You may not necessarily need it in your context, but if you do, I would be convinced enough to make it happen earlier than later. |
Sql queries can have several schemas/table names.
sys.t
table information is lost, it's easy to fix, the question is about the resulting APIMetadata(schema=['sys', 'doc'], table_name=['t', 'b'], parameterized_properties={}, with_properties={})
would this be good enough, where schemas and table_name are ordered?If no schema it'd be:
Metadata(schema=[None, 'doc'], table_name=['t', 'b'], parameterized_properties={}, with_properties={})
Now that you are integrating into this, wdyt? @amotl
The text was updated successfully, but these errors were encountered: