Skip to content

feat(eql v3)!: query-operand domains renamed to the query_<name> prefix (CIP-3442)#379

Open
freshtonic wants to merge 2 commits into
eql_v3from
james/cip-3442-query-domain-prefix-naming
Open

feat(eql v3)!: query-operand domains renamed to the query_<name> prefix (CIP-3442)#379
freshtonic wants to merge 2 commits into
eql_v3from
james/cip-3442-query-domain-prefix-naming

Conversation

@freshtonic

Copy link
Copy Markdown
Contributor

Implements CIP-3442: rename every query-operand domain from the <name>_query suffix to a query_<name> prefix.

Why: the query-operand domains live in public alongside 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_eq next to integer_eq_query). A shared query_ prefix sorts every query operand together, apart from the column domains.

What's here

  • Catalog: 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.
  • Scalar twins: all 37 become 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.
  • Encrypted-JSONB needle follows the same convention: public.jsonb_querypublic.query_jsonb, carried as a second documented full_name exception beside public.json. (All three json domains were already created in public.)
  • Bindings: DomainType::sql_domain strings, QueryPayload::parse names, and the exported JSON Schema file names (schema/v3/query_<name>.json) carry the new names; from_v2_query / from_v2_query_typed target them. Rust/TS struct names (IntegerEqQuery) are unchanged — the convention governs SQL domain names.
  • Docs: CHANGELOG entries (EQL + eql-bindings) and upgrade note U-002 in 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.
  • Separate commit — non-vacuous operator-equivalents gate: test Create README.bigpicture.md #1 in v3_operator_equivalents_tests.rs filtered operand types on nspname = 'eql_v3', where no types live, so it matched zero operators and passed vacuously. It now identifies EQL operands by catalog domain name in public (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, the full_name needle 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 the proptest-e2e fresh-encryption query-operand conformance (independently-encrypted query_* operands match exactly the equal / correctly-ordered rows, both operand directions, and a c-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_ID being set locally (CI doesn't set it, and CI is green).

…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.
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 467869d1-e81d-4398-b728-97095344f85f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch james/cip-3442-query-domain-prefix-naming

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@freshtonic freshtonic requested review from coderdan and tobyhede July 7, 2026 15:31
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

Successfully merging this pull request may close these issues.

1 participant