Skip to content

Conversation

@albireox
Copy link
Member

@albireox albireox commented Feb 2, 2024

For #236

@albireox
Copy link
Member Author

albireox commented Feb 2, 2024

Right now this does not work for me for some reason. The setup with which it fails is that I have a local sdss5db (without a catalogdb.catalog table). If I then import from sdssdb.peewee.sdss5db import catalogdb and do

catalogdb.database.set_profile('tunnel_operations')

and then try to query Catalog

list(catalogdb.Catalog.select().limit(1).tuples())

it fails and complains that catalogdb.catalog does not exist, so I think at that point is still trying to connect to my local DB.

@havok2063
Copy link
Collaborator

Yeah I'm seeing the same thing. I don't have vizdb locally. It works when you connect directly. Maybe there are subtle differences between PostgresqlDatabase and PooledPostgresqlExtDatabase with passing the connection params.

db = PooledPostgresqlExtDatabase(user='u0857802', host='localhost', port=6000, database='sdss5db')
rows = db.execute_sql('select * from vizdb.sdss_id_stacked limit 1;').fetchall()
rows
[(7613823349, None, None, 315.01922607421875, 35.29448988981897, 47510284)]

or

db = PooledPostgresqlExtDatabase(None)
db.init('sdss5db', host='localhost', port=6000, user='u0857802')
rows = db.execute_sql('select * from vizdb.sdss_id_stacked limit 1;').fetchall()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants