Skip to content

fix: re-add generation for ilike & co operators - #104

Merged
ryanrasti merged 1 commit into
mainfrom
fix-ilike-generation
Aug 7, 2026
Merged

fix: re-add generation for ilike & co operators#104
ryanrasti merged 1 commit into
mainfrom
fix-ilike-generation

Conversation

@ryanrasti

@ryanrasti ryanrasti commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Restores //!/! to OPERATOR_ALIASES, so .ilike() and friends generate again.

Also makes introspection ordering deterministic — the four catalog queries ordered by name only, and overloads share a name, so pg returned them in scan order and codegen:check could fail on a diff nobody introduced. Now tiebroken on the full signature.

Of the 28 regenerated files, 25 changed order only; text/bpchar/bytea changed method sets. Adding an alias hides that operator's oprcode implementation by design (introspect.ts:94), so textlike/texticlike/bpcharlike/bytealike are replaced by like/ilike/notLike/notIlike — technically breaking for anyone calling those internal names directly.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores readable operator-alias method generation for Postgres pattern-matching operators (notably ~~*.ilike() and related negations) and makes introspection/codegen output deterministic to avoid spurious codegen:check diffs.

Changes:

  • Add pattern-matching entries to OPERATOR_ALIASES and validate operator-alias emission with targeted unit + e2e tests.
  • Stabilize Postgres introspection ordering (functions, aggregates, SRFs, operators) to make generated output reproducible.
  • Refresh generated Postgres type surfaces to include the new alias methods and reflect the updated introspection ordering.

Reviewed changes

Copilot reviewed 4 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types/postgres/introspect.ts Makes introspection query ordering deterministic for reproducible codegen output.
src/types/postgres/index.test.ts Adds regression tests for operator alias emission and e2e coverage for ilike/negations.
src/types/postgres/generated/xid.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/tsvector.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/tsquery.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/timetz.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/timestamptz.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/timestamp.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/time.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/text.ts Adds operator-alias methods for pattern operators (ilike, notLike, notIlike) and regenerates ordering.
src/types/postgres/generated/regconfig.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/polygon.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/numeric.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/money.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/jsonb.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/json.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/interval.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/int8.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/int4.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/int2.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/float8.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/float4.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/date.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/bytea.ts Adds pattern operator alias method(s) where applicable and regenerates ordering.
src/types/postgres/generated/bpchar.ts Adds pattern operator alias methods (like, ilike, notLike, notIlike) and regenerates ordering.
src/types/postgres/generated/bit.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/anyrange.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/anymultirange.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/anycompatiblearray.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/postgres/generated/anyarray.ts Regenerated overload ordering/dispatch consistent with updated introspection ordering.
src/types/emission/common.ts Extends operator-alias table to include Postgres pattern-matching operators.
site/src/pages/_HomePage.tsx Fixes minor wording/grammar on the landing page copy.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/types/postgres/index.test.ts Outdated
Comment on lines +660 to +666
// --- Operator aliases ---
//
// OPERATOR_ALIASES gives each operator symbol a readable twin next to its
// bracket form. The four pattern operators were dropped from that table in
// the clean-slate rewrite, which silently removed `.ilike()` from the
// generated surface — the landing page kept advertising it for months.
// These two tests pin the behaviour and the table.
Comment thread src/types/emission/common.ts Outdated
Comment on lines +22 to +24
// Pattern matching. `like` collides with a real host function on
// sqlite (like(X,Y)), so the collision rule below drops the alias
// there and keeps the function's own signature authoritative.
@ryanrasti
ryanrasti force-pushed the fix-ilike-generation branch from 909b5d0 to 22c63f8 Compare August 7, 2026 22:29
@ryanrasti
ryanrasti merged commit c7a2ee3 into main Aug 7, 2026
5 of 6 checks passed
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.

2 participants