-
Notifications
You must be signed in to change notification settings - Fork 19
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
wip: postgres integration #959
base: master
Are you sure you want to change the base?
Conversation
import gzip | ||
import os | ||
|
||
GET_TABLE_CREATE = """with table_info as ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was the schema being created before?
Wouldn't it be best to have this as part of a migration script, through alembic or similar, if we're not using an ORM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to dump an existing DB to a file, similar to SQLite to file function. I do not know how the schema is created. @mhasself can you provide some more information here?
"`tag` varchar(256)", | ||
"CONSTRAINT one_tag UNIQUE (`obs_id`, `tag`)", | ||
"tags": [ | ||
"obs_id varchar(256)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obs_id is not a foreign key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it is not. I think it should be and it will make search and joins even faster
This is to continue the discussion about postgres as the metadata DB. I made some changes in ObsDB to connect to a postgres and run most of the ObsDB commands. I want to do some extra updates and then fix the unit test.
Having said that the size of the changes is not significant in terms of code that is changed. It is more to make sure the SQL code is correct.
Let me know what you think, because I will have to discuss it also with Research Computing at Princeton to have the ability to connect from the compute nodes.