feat(checks): full check-predicate dialect (#346) - #352
Merged
Conversation
Extend table-check lowering to comparisons, column-to-column tests, in_/like, and enum literals with closure and call validation so CHECK bodies stay literal-only per ADR-0016 while Transfer-shaped NULL/OR predicates stay byte-identical. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Gate: clearRead the full diff (
Nits, not blocking: Merging into |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
compile_table_checks/_lower_nodeto lower the full root-columnwhere()dialect intoCheckExprIR: comparisons, column-to-column,.in_(),.like(), enum member literals, plus existing NULL/OR/NOT combinators.Status.MEMBERspellings) and arbitrary function calls viaco_freevars+ AST inspection;.in_()/.like()remain allowed.tests/test_check_predicate_dialect.pywith compilation, rejection, and live enforcement pins; trimtest_table_checks.pyrejection cases now covered by the dialect.Closes #346
Part of #339 (parent issue stays open).
Test plan
uv run pytest tests/test_check_predicate_dialect.py tests/test_table_checks.pytest_table_checks.pyregression)backend_matrixcases in new file)feat/table-checksbaseExit steps
Closes #346)featPRD: table-level CHECK constraints (multi-column), auto-migrated #339CHANGELOG.md(I-10)Made with Cursor