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
DM-41029: Add metadata table to APDB schema #171
Conversation
@andy-slac Can you describe how the new metadata table will be used? |
One purpose is to hold schema version, some details are in https://dmtn-269.lsst.io/. There may be other uses to store per-database information, e.g. instrument name. This should be considered as implementation detail, I'm not even sure that it needs to be in sdm_schemas, but my impression is that people prefer to have it here. |
68af1cf
to
d0bfc2d
Compare
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.
Seems reasonable
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.
Just to confirm: this would make the stored version numbers strings, so we'd have to do some version parsing with an appropriate library to compare them? I think that's fine, I just wanted to check.
- name: name | ||
"@id": "#metadata.name" |
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.
Should we call this key
, in keeping with python dictionaries (which this effectively is), or is name
the typical database term for this kind of key:value store?
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.
key
is more natural, but in some database systems key
is a reserved keyword and needs special care when used as column name (proper quoting). It's easier to avoid using keywords for column names.
Right, all values are stored as strings in the metadata table and need de/serialization if original type is different from string. This will need client-side code to do that transformation. It's hard to implement generic type-safe storage, at this point I think we are OK with handling this entirely on client side. Version numbers for APDB will be stored in SemVer format (X.Y.Z) and there is a class to support that format, for other potential cases I think we can introduce some helper methods when necessary. |
d0bfc2d
to
6c45145
Compare
@andy-slac We've been fiddling with some of the test workflows in this repo. You may want to trigger a re-run of the tests. |
This also adds version number to APDB schema and "advances" it to 0.1.1, all schema versions before metadata are considered 0.1.0.
6c45145
to
093d7af
Compare
This also adds version number to APDB schema and "advances" it to 0.1.1, all schema versions before metadata are considered 0.1.0.