feat: add supabase_typegen package generating typed table definitions - #1635
Draft
spydon wants to merge 18 commits into
Draft
feat: add supabase_typegen package generating typed table definitions#1635spydon wants to merge 18 commits into
spydon wants to merge 18 commits into
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus 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 |
spydon
added a commit
that referenced
this pull request
Jul 23, 2026
## What kind of change does this PR introduce? Feature. Adds an empty skeleton for a new `supabase_typegen` package so we can publish it to pub.dev and reserve the name. The full generator implementation lands separately in #1635; this PR intentionally contains only the minimal publishable placeholder. ## What is the new behavior? A new `packages/supabase_typegen` package containing: - a publishable `pubspec.yaml` (version `0.1.0`, no `publish_to: none`) so the melos release pipeline picks it up, - a placeholder library, `README`, `CHANGELOG` and `LICENSE`, - `supabase_lints` wired in via `analysis_options.yaml` (analyzes clean). It is wired into: - the root workspace in `pubspec.yaml`, - the Dart CI test matrix in `test.yml`, - the pana release matrix in `release-pana.yml`, - the SDK compliance parse ignore (`.sdk-parse-ignore`), since it is a development-time tool rather than SDK client surface. ## Additional context The README and CHANGELOG flag `0.1.0` as a name-reserving placeholder; the generator implementation will replace it in a later release. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a new `supabase_typegen` package placeholder (v0.1.0) to generate typed Dart table definitions from Supabase schemas. * **Documentation** * Added initial README and changelog entries documenting current placeholder status and reserved pub.dev name. * **CI / Chores** * Updated release and test workflows to run checks for `supabase_typegen` when relevant, including coverage carryforward. * Excluded `supabase_typegen` from SDK public API scanning (development-time generator). * **Legal** * Added the MIT license for the new package. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
spydon
force-pushed
the
feat/typed-table-access
branch
from
July 23, 2026 11:48
17d12c1 to
6a64143
Compare
spydon
force-pushed
the
feat/supabase-gen
branch
from
July 23, 2026 11:53
07cdee7 to
c795ded
Compare
Vinzent03
pushed a commit
that referenced
this pull request
Jul 28, 2026
## What kind of change does this PR introduce? Feature. Adds an empty skeleton for a new `supabase_typegen` package so we can publish it to pub.dev and reserve the name. The full generator implementation lands separately in #1635; this PR intentionally contains only the minimal publishable placeholder. ## What is the new behavior? A new `packages/supabase_typegen` package containing: - a publishable `pubspec.yaml` (version `0.1.0`, no `publish_to: none`) so the melos release pipeline picks it up, - a placeholder library, `README`, `CHANGELOG` and `LICENSE`, - `supabase_lints` wired in via `analysis_options.yaml` (analyzes clean). It is wired into: - the root workspace in `pubspec.yaml`, - the Dart CI test matrix in `test.yml`, - the pana release matrix in `release-pana.yml`, - the SDK compliance parse ignore (`.sdk-parse-ignore`), since it is a development-time tool rather than SDK client surface. ## Additional context The README and CHANGELOG flag `0.1.0` as a name-reserving placeholder; the generator implementation will replace it in a later release. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a new `supabase_typegen` package placeholder (v0.1.0) to generate typed Dart table definitions from Supabase schemas. * **Documentation** * Added initial README and changelog entries documenting current placeholder status and reserved pub.dev name. * **CI / Chores** * Updated release and test workflows to run checks for `supabase_typegen` when relevant, including coverage carryforward. * Excluded `supabase_typegen` from SDK public API scanning (development-time generator). * **Legal** * Added the MIT license for the new package. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…of the OpenAPI description
4 tasks
…zed Postgres types
… to run the generator
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.
What kind of change does this PR introduce?
Feature (draft, layer 2 of the typed table access work, stacked on #1634). Adds a new
supabase_typegenpackage: a standalone code generator that turns a database schema into the typed table definitions introduced in #1634, so users get the fully typed surface without writing any of it by hand.Linear: SDK-1362
What is the new behavior?
supabase gen types --lang json --local > schema.json dart run supabase_typegen --input schema.jsonreads the language-neutral
GeneratorMetadataintrospection document (the@supabase/postgrest-typegencontract from supabase/pg-toolbelt#302, which postgres-meta itself consumes after supabase/postgres-meta#1084;--input -reads it from stdin) and emits one Dart file containing, per table:DateTimeparsing,double/numcoercion,Listcasts, Postgres enum mapping),InsertandUpdatevalue extension types that implementMap<String, dynamic>, with required parameters derived fromNOT NULL-without-default columns and null-aware omission for everything else; explicit SQL NULL writes go through generatedset…ToNullcopy methods that only exist for nullable, writable columns,PostgrestTabledefinition plusTableColumntokens for compile-time checked filters,toStringreturns the wire name so enum values work directly in filters).See
packages/supabase_typegen/test/goldens/supabase_schema.dartfor what the output looks like for the fixture schema.Design choices worth reviewing:
GeneratorMetadatacontract of@supabase/postgrest-typegen(feat(postgrest-typegen): add package with multi-language code generation pg-toolbelt#302), the same document the TypeScript, Go, Swift, and Python generators consume; structural validation rejects non-matching documents. It comes straight from the database catalog, so the output is exact where API-derived descriptions are lossy:NOT NULLcolumns with a database default read as non-nullable but stay optional on insert, identity columns are recognized, andGENERATED ALWAYScolumns appear in the row type but are excluded from the insert and update types. This is the single introspection source; the parser is a pure function over the JSON document behind theSchemaDescriptionmodel.booksemitsBooksRow/BooksInsert/BooksUpdateplus aBooksnamespace class (no English singularization, so names stay predictable). Identifiers are sanitized against Dart reserved words andMapmember names with a$suffix, and collisions are deduplicated.supabase_lintsand DCM with zero issues, including the strict extension type rules.Deliberately deferred: foreign key relationship getters (the fk targets are already parsed into the model) and typed rpc functions.
Additional context
supabase gen types --lang jsonand--lang dart..sdk-parse-ignoresince it is a development-time tool, not SDK client surface; the symbol, drift and schema checks pass locally against the base branch.supabase_typegenis added to the CI dart test matrix; tests are fully mocked/fixture-based (introspection unit tests over a checked-in metadata fixture, a whitespace-insensitive golden comparison with atool/regenerate_goldens.dartrefresh script, and behavior tests that run the generated golden code against a mock HTTP client to verify wire formats end to end).publish_to: noneuntil the API settles.