Skip to content

Add gen tanstack-db command to the Supabase CLI #12

Description

@ivasilov

What to build

Add a gen tanstack-db command to the Supabase CLI so users can generate TanStack DB collection definitions from their Supabase database schema instead of hand-writing table names, primary keys, schemas, and collection options.

The first version should define the CLI UX and generated output shape. It should focus on the common path: generating collection modules for exposed tables, including table names, primary keys, Standard Schema-compatible row schemas, and supabaseCollectionOptions wiring that users can import into their frontend app.

The issue should also decide how regeneration works. Generated files should be useful as a starting point without making it easy to accidentally overwrite user edits. Open questions include how to represent relationships, composite primary keys, schema libraries, custom schemas, and whether generated output should live beside existing Supabase type generation.

Acceptance criteria

  • Define the intended supabase gen tanstack-db CLI UX.
  • Define the generated collection module shape.
  • Include table names, primary keys, row schemas, and supabaseCollectionOptions wiring.
  • Describe how regeneration avoids clobbering user edits.
  • Document open questions or follow-up work for relationships, composite keys, and schema-library choices.

Blocked by

None - can start immediately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions