Skip to content

Seed with a Script #66

Closed
Closed

Description

@clouedoc

Feature request

Is your feature request related to a problem? Please describe.

We currently have seeding scripts written in TypeScript.

They served two purposes:

  1. Reproducibility of the project: if we had to deploy somewhere else, we would still have the essential data needed for the app to work.
  2. Easily provision a local development environment.

There is currently no way to run such seeding scripts after running supabase start since the CLI is blocking, which means we can't simply add a dev:start script to run supabase start && yarn db:seed.

Describe the solution you'd like

  • We would like supabase start to accept a flag to run a custom seeding command.
  • We would like to have the possibility to edit the Supabase config to run a seeding script

Describe alternatives you've considered

We considered converting our seeding scripts to SQL, but I believe this is a feature that could benefit Supabase too.

Additional context

The data we want to seed is pretty static.
We wrote our seeding scripts in TypeScript.
We could also solve our problem with #30.

Activity

  1. madeleineostoja commented on Oct 8, 2022

    @madeleineostoja

    This would be awesome for seeding local storage with the supabase API as well, rather than running a custom command with a node script for doing that after seeding.

  2. sweatybridge commented on Oct 14, 2022

    @sweatybridge
    Contributor

    Hello, since supabase start is no longer blocking, the suggested script in this ticket supabase start && yarn db:seed should work now.

    The more general request for running custom command after supabase start is similar to hooks. We have a proposal in #501 on how this might be done. Please have a look there and comment on anything you'd like to add.

    Appreciate your feedback.

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 request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions