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

Tests using PooledPostgresqlExtDatabase #237

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

2 participants