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

find tables inside non-default schema when serving off a metadata #1145

Merged
merged 2 commits into from
Jun 25, 2015

Conversation

llllllllll
Copy link
Member

The name of a table include the schema prefix which would disallow us from finding a table in a metadata object if it was not the default schema. This goes with: blaze/odo#242

The '.',join is okay because that is what the key will look like when you have a dotted schema name:

In [2]: import sqlalchemy as sa

In [3]: ds = bz.Data(sa.MetaData('postgresql://localhost/test', schema='wow.this.sucks'))

In [4]: ds.data.tables
Out[4]: immutabledict({'wow.this.sucks.test': Table('test', MetaData(bind=Engine(postgresql://localhost/test)), Column('a', INTEGER(), table=<test>), schema='wow.this.sucks')})

@cpcloud
Copy link
Member

cpcloud commented Jun 25, 2015

Somewhat related: Should we discover all schemata in the database if just a database is given to resource?

For example:

d = Data('postgresql://localhost/db')
d.my_schema.table1  # not the default schema
d.table1  # public schema

We can merge this PR before deciding on this.

@llllllllll
Copy link
Member Author

I think that would be a great addition; I will work on that as a separate pr. Does this pr look good though?

@cpcloud
Copy link
Member

cpcloud commented Jun 25, 2015

yep 👍

@cpcloud cpcloud added this to the 0.8.1 milestone Jun 25, 2015
llllllllll added a commit that referenced this pull request Jun 25, 2015
find tables inside non-default schema when serving off a metadata
@llllllllll llllllllll merged commit dc59300 into blaze:master Jun 25, 2015
@llllllllll llllllllll deleted the single-metadata branch June 25, 2015 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants