-
Notifications
You must be signed in to change notification settings - Fork 99
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
How do I specify a catalog if I'm defining mutiple tables using the sqlalchemy ORM style? #446
Comments
What happens when you attempt to query with those definitions? It should "just work". If you needed to join data across catalogs that could lead to some issues — although I'm still curious what happens when you try it. |
I get the following error if I try to query a Table who'se catalog doesn't match. E.g using |
Interesting! Does the same thing happen if you try query the table directly using the SQLAlchemy engine versus using ORM? Your answer to this makes it easier to determine where a fix would need to be applied. |
What would the syntax be for querying the table directly using the SQLAlchemy engine? I wnat to make sure I'm testing the right thing :) |
with engine.begin() as conn:
cursor = conn.execute("SELECT field FROM catalog1.schema1.table1 LEFT JOIN catalog2.schema2.table2 ON ...")
result = cursor.fetchall() |
That works with no error (probably because the sql text has a fully qualified table name that includes catalog and schema) |
I have two tables I want to query from, the fully qualified names are
foo_catalog.foo_schema.foo
andbar_catalog.bar_schema.bar
. I can specify a schema and a tablename in the table definition but I only get a chance to specify the catalog once in the connection.How do I specify a catalog using declarative base style?
If I was writing raw sql I could query accross both catalogs no problem.
The text was updated successfully, but these errors were encountered: