feat: add supabase_typegen package generating typed table definitions#1635
Draft
spydon wants to merge 8 commits into
Draft
feat: add supabase_typegen package generating typed table definitions#1635spydon wants to merge 8 commits into
spydon wants to merge 8 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
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?
dart run supabase_typegen --url https://your-project.supabase.co --key $SUPABASE_ANON_KEYreads the OpenAPI (Swagger 2.0) description that PostgREST serves at the API root 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 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:
SchemaDescriptionmodel later.NOT NULLcolumns with a database default, so getters are non-nullable only forrequiredcolumns and primary keys; everything else is conservatively nullable. Documented in the README as the main reason to add a pg-meta backend eventually.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
.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, 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.