fix: re-add generation for ilike & co operators - #104
Merged
Conversation
There was a problem hiding this comment.
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_ALIASESand 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 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 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
force-pushed
the
fix-ilike-generation
branch
from
August 7, 2026 22:29
909b5d0 to
22c63f8
Compare
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.
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.