Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seed with a Script #66

Closed
clouedoc opened this issue Oct 29, 2021 · 2 comments
Closed

Seed with a Script #66

clouedoc opened this issue Oct 29, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@clouedoc
Copy link

clouedoc commented Oct 29, 2021

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.

@madeleineostoja
Copy link

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.

@sweatybridge
Copy link
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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants