feat(eql v3)!: query-operand domains renamed to the query_<name> prefix (CIP-3442)#379
Open
freshtonic wants to merge 2 commits into
Open
feat(eql v3)!: query-operand domains renamed to the query_<name> prefix (CIP-3442)#379freshtonic wants to merge 2 commits into
freshtonic wants to merge 2 commits into
Conversation
…ix (CIP-3442) Every scalar query twin is now public.query_<name> (query_integer_eq, ...), and the hand-written SteVec containment needle follows the same convention: public.jsonb_query -> public.query_jsonb. Domain::query_name (eql-domains) is the single source of truth for the twin naming; Domain::full_name carries the needle's documented exception alongside the existing public.json one. Why: the query operands live in public beside the column domains they twin, so Supabase Studio's Table Builder type picker interleaved never-a-column-type operands with the actual column types. A shared query_ prefix sorts every query operand together, apart from the column domains. Generated artifacts regenerated in place: src/v3/scalars (file names follow the domain names; old files orphan-swept), eql-bindings Rust/TS/JSON (query_<name>.json schema files), and the public-surface golden snapshot. CHANGELOG entries updated/added and U-002 added to docs/upgrading/v3.0.md (the suffix names shipped only in 3.0.0 pre-releases).
The #1 gate filtered operand types on nspname = 'eql_v3', but no type lives in that schema (domains are in public, SEM term types in eql_v3_internal), so the scan matched zero operators and passed vacuously — the invariant was really held up by the name checks and the codegen. Identify EQL operands by catalog domain name in the public namespace instead (including the query_<name> twins), and assert the scan matches a healthy floor of operators before trusting an empty offender list.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Implements CIP-3442: rename every query-operand domain from the
<name>_querysuffix to aquery_<name>prefix.Why: the query-operand domains live in
publicalongside the column domains they twin, so Supabase Studio's Table Builder type picker (and any alphabetical type listing) interleaved never-a-column-type query operands with the actual column types (integer_eqnext tointeger_eq_query). A sharedquery_prefix sorts every query operand together, apart from the column domains.What's here
Domain::query_name(crates/eql-domains) is the single source of truth for the twin naming (query_<full_name>); every consumer — SQL renderers, generated file names, bindings emitter,QueryPayload— derives from it.public.query_<name>(query_integer_eq,query_text_ord, …). Generated file names follow (query_<name>_functions.sql/_operators.sql,query_<T>_types.sql); the old files are orphan-swept.public.jsonb_query→public.query_jsonb, carried as a second documentedfull_nameexception besidepublic.json. (All three json domains were already created inpublic.)DomainType::sql_domainstrings,QueryPayload::parsenames, and the exported JSON Schema file names (schema/v3/query_<name>.json) carry the new names;from_v2_query/from_v2_query_typedtarget them. Rust/TS struct names (IntegerEqQuery) are unchanged — the convention governs SQL domain names.docs/upgrading/v3.0.md— the suffix names shipped only in 3.0.0 pre-releases, so protect-ffi and other alpha adopters need the coordinated cast rename.v3_operator_equivalents_tests.rsfiltered operand types onnspname = 'eql_v3', where no types live, so it matched zero operators and passed vacuously. It now identifies EQL operands by catalog domain name inpublic(including the query twins) and asserts a ≥100-operator match floor before trusting an empty offender list.Reviewing
The SQL is machine-generated — review the naming source (
Domain::query_name, thefull_nameneedle exception), the generator diffs (generate.rs,context.rs,bindings.rs,query_types.sql.j2), and one concrete output (src/v3/scalars/integer/query_integer_eq_*.sql); the rest is 1:1. The public-surface golden regenerated as a clean ±426 symmetric rename.Validation (local, PG 17)
codegen:parity·types:check·test:matrix:inventory·docs:validate·test:self_contained_v3· full SQLx suite including theproptest-e2efresh-encryption query-operand conformance (independently-encryptedquery_*operands match exactly the equal / correctly-ordered rows, both operand directions, and ac-bearing operand still violates the CHECK).Known-unrelated local failures: 45 tests (jsonb_entry / v3_jsonb) fail on my machine because locally regenerated SteVec fixtures no longer emit the pinned selector constants — reproduces on the clean base tree; root cause traced to the cipherstash-client 0.35.0→0.38.1 bump interacting with
CS_DEFAULT_KEYSET_IDbeing set locally (CI doesn't set it, and CI is green).