Repository navigation
fix(postgrest-typegen): inline pg-format literal and drop the dependency - #138
Merged
spydon merged 1 commit intoSep 2, 2026
Merged
Conversation
`pg-format` is CommonJS-only and its transitive footprint made it painful to consume `@supabase/postgrest-typegen` from ESM/bundled CLIs (supabase/cli). The package only ever used `literal()`, so inline a minimal port of it in `src/introspection/sql/pg-format.ts` (the same approach `packages/pg-meta` took in supabase/supabase) and remove `pg-format` + `@types/pg-format`. The port mirrors `[email protected]` byte-for-byte, including quoting numbers (`limit '10'`), because postgres-meta emits exactly that and this package is byte-parity constrained against it. It deliberately does not adopt pg-meta's unquoted-number variant. RED (before the helper existed): error: Cannot find module '../../src/introspection/sql/pg-format.ts' 0 pass / 1 fail GREEN: 100 pass across the Docker-free unit suites; check-types, oxfmt/oxlint, knip and build all clean. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WvDCziDG3ahaFdo781wyEf
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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 |
spydon
pushed a commit
that referenced
this pull request
Sep 2, 2026
🤖 I have created a release *beep* *boop* --- ## [0.2.1](postgrest-typegen-v0.2.0...postgrest-typegen-v0.2.1) (2026-09-02) ### Bug Fixes * **postgrest-typegen:** escape database values in Swift string literals ([#123](#123)) ([4a5cef5](4a5cef5)) * **postgrest-typegen:** escape Go struct tags for pathological column names ([#122](#122)) ([42c0249](42c0249)) * **postgrest-typegen:** generated columns, NonNullable json, zero-arg Args, trigger-writable views ([#125](#125)) ([67650c6](67650c6)) * **postgrest-typegen:** inline pg-format literal and drop the dependency ([#138](#138)) ([2c16a15](2c16a15)) * **postgrest-typegen:** python escaping, 3.9 imports, JsonValue json columns, composite nullability ([#124](#124)) ([d1f9b3b](d1f9b3b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
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
literal()port of[email protected]intopackages/postgrest-typegenand drop thepg-format/@types/pg-formatdependencies.pg-formatis CommonJS-only and its transitive footprint made@supabase/postgrest-typegenpainful to consume from ESM/bundled CLIs (supabase/cli). The package only ever usedliteral().limit '10') because this package is byte-parity constrained against postgres-meta. It does not adoptpackages/pg-meta's unquoted-number variant.Test plan
bun run check-typesinpackages/postgrest-typegenbun run format-and-lintbun test test/introspection/pg-format.test.ts(8 pass)Made with Cursor