-
Notifications
You must be signed in to change notification settings - Fork 3
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-45938: Add support for generating IDs on data model objects #100
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
==========================================
+ Coverage 90.74% 90.92% +0.18%
==========================================
Files 16 16
Lines 1805 1885 +80
Branches 386 417 +31
==========================================
+ Hits 1638 1714 +76
+ Misses 101 97 -4
- Partials 66 74 +8 ☔ View full report in Codecov by Sentry. |
e7285e1
to
22c03e3
Compare
Implement a pre-validator which creates object IDs where they are missing on Schema objects. The values of the generated IDs for schema, table and column objects are constructed based on the common usage patterns from SDM Schemas. Constraints and indexes use the name field as the ID. The `--id-generation` flag must be used from the command-line to enable this feature, as it is off by default.
Add a top-level flag for enabling ID generation and pass it to the other commands via the Click context.
Load a schema without IDs and set them, and load the same schema with ID generation turned off to check that an exception is thrown.
22c03e3
to
0da628c
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.
Looks good now. Very much agree with the goal of removing the requirement to tediously supply IDs in the input schema files.
Add an
--id-generation
flag which turns on generation of@id
values for schema objects that do not have them.Add a Schema validator that checks if index names are unique.