How do I specify a catalog if I'm defining mutiple tables using the sqlalchemy ORM style?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the Foo and Bar declarative examples in the issue and trace how their schema and table names reach the connector's catalog setting. Confirm whether declarative mappings can carry distinct catalogs and define the expected behavior for querying both fully qualified tables.
Written by the indexing model from the issue text.
Description
I have two tables I want to query from, the fully qualified names are foo_catalog.foo_schema.foo and bar_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.
class Base(declarative_base(metaclass=DeclarativeABCMeta)):
__abstract__ = True
class Foo(Base):
__tablename__ = "foo"
__table_args__ = { "schema": "foo_schema"}
id: Mapped[int] = mapped_column(name="id", type_=INTEGER, primary_key=True)
class Bar(Base):
__tablename__ = "bar"
__table_args__ = { "schema": "bar_schema"}
id: Mapped[int] = mapped_column(name="id", type_=INTEGER, primary_key=True)
- Dominant language
- Python
- Stars
- 236
- Forks
- 162
- Avg merge
- 13h 13m
- Merged PRs (30d)
- 23
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/databricks-sql-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databricks/databricks-sql-python#1034 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databricks/databricks-sql-python#1012 ·
Maintainers usually reply within 1 day
-
Token federation: `_exchange_token` raises KeyError('access_token') on error responses, discarding the real failure reasonPossibly taken @TangoEnSkai claimed this 81 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
databricks/databricks-sql-python#904 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
databricks/databricks-sql-python#865 ·
Maintainers usually reply within 1 day
-
engineer-bot
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
databricks/databricks-sql-python#860 · 3 comments ·
Maintainers usually reply within 1 day
All issues in databricks/databricks-sql-python
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
aws-samples/sample-per-model-bedrock#857 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
521xueweihan/HelloGitHub#4328 ·
-
documentation maintainer-managed
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
awslabs/visual-asset-management-system#1418 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day