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

IVOA Standard SQL/ADQL reserved terms used for CAOM Table names in CAOM 2.5 #25

Open
ebrassfieldbourke opened this issue Nov 25, 2024 · 1 comment

Comments

@ebrassfieldbourke
Copy link

As I understand it, part of CAOM version 2.5 is the intention to recommend CAOM as an IVOA standard. CAOM 2.5 currently uses SQL and ADQL reserved words for table names such as Position and Time. A workaround for reserved words is to place these table names into quotation marks. Perhaps the issue/fix could be added to the CAOM documentation upon IVOA Standardisation?
If this is a known issue or I missed it folded into the other issues, my apologies, and please feel free to delete or mark as 'Resolved'.

Output from a TAP Lint tool run by my colleague:
Section TME: Check content of tables metadata from /tables E-TME-TRSV-1 Table name is ADQL reserved word 'Position' E-TME-TRSV-2 Table name is ADQL reserved word 'Time' E-TME-CRSV-1 Column name is ADQL reserved word 'pi' in table Proposal - should delimit like '"pi"' E-TME-CRSV-2 Column name is ADQL reserved word 'coordsys' in table SpatialWCS - should delimit like '"coordsys"' E-TME-CRSV-3 Column name is ADQL reserved word 'coordsys' in table TargetPosition - should delimit like '"coordsys"'

Error also results from using a simple 'SELECT' command on these tables.

@pdowler
Copy link
Member

pdowler commented Jan 10, 2025

I take it that this is based on a database and TAP service where all tables were generated by @pahjbo vo-dml tools? There will definitely be discussion around model -> db schema related to #28

Still, use of names that are reserved words in some context is risky at least and tweaks to prevent future pain are a good idea. See #29 for an example.


Short blurb: those are not intended to end up being table names, but since the model comes before the standard relational mapping spec, it is possible someone would implement db tables like the boxes in the UML diagram. That's not necessary since a 0..1 relation can just be flattened into a set of columns in the "parent" table.

The intent is that entity classes map to tables (so currently 6 tables in total, 8 when PR #27 is done). That may drop back to 5 tables if we decide to completely remove part and chunk.

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

No branches or pull requests

2 participants