forked from surrealdb/surrealdb
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(catalog/op_bridge): D-AR-6.2 — bridge 7 new ast::Kind variants (String/Bool/Float/Decimal/Datetime/Bytes/Uuid) #38
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 dependency bump selects the AST branch that now carries
FieldDefinition.assertand populates it fromvalidates_constraint, butFrom<ast::FieldDefinition>still only transfers the name/table/kind via.with_kind(Some(kind)). For schemas containing validations, the AST can renderASSERT $value != NONEwhile the bridged catalog field silently drops that clause, so the catalog accepts values that the generated schema intended to reject; please map the new assertion slot into the catalogwith_assertpath or avoid this branch until that is supported.Useful? React with 👍 / 👎.
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.
Fixed in follow-up PR #39 (
04fd090).From<ast::FieldDefinition> for catalog::FieldDefinitionnow calls.with_assert(rails_assert_to_expr(s))so the catalog carries the same$value != NONEconstraint the AST renders. Lowering is structural (Binary(Param "value", NotEqual, Literal::None)) rather than parser-based — one known AR-shape expression today, one explicit arm; unknown expressions fall back toNone(safe no-op preserving the pre-PR behaviour).PR #28's
normalize:annotation that renders as$value != NONE /* normalized */is handled by stripping the block comment + canonicalising whitespace before matching, so both forms lower to the sameExpr.Regression tests:
d_ar_6_3_field_definition_bridges_assert_claused_ar_6_3_assert_normalized_comment_is_strippedd_ar_6_3_no_assert_when_ast_field_has_noned_ar_6_3_unknown_assert_string_lowers_to_noneThanks for the catch — declared-vs-enforced drift is exactly what the bridge exists to prevent.