cli icon indicating copy to clipboard operation
cli copied to clipboard

Allow for more fine-tuned configuration in local dev environments

Open Matsuuu opened this issue 1 year ago • 1 comments

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

This is a continuation to what https://github.com/supabase/cli/issues/1518 wants to have added to the CLI interfaces.

When working in local dev environments, a lot of things might differ from the actual prod setups. There might be different environment variable files, there might be multiple different seeding profiles for different data use cases, and so on.

Describe the solution you'd like

Create an easy way for us to expand the API by allowing the addition of different flags to maps varying file mappings in all supabase commands. Some examples of what would be beneficial:

  • a --env-file mapping for ALL commands. This would allow using multiple different env files as well as make it easier to host local setups in OS's that don't have the easiest of ways to add env variables cough windows cough.

  • a --seed-file mapping to db reset etc. commands. This would allow users to have more fine grained control around seeding, as well as allow the seed.sql to be used for actually seeding e.g. staging environment dumps. This would allow more varied usage of seeding with the database without having to overwrite files.

  • I'm sure there's plenty more.

Describe alternatives you've considered

One way of approaching this might be just having the API's take these variables but as with e.g. the env one, it would be easier if there was a general utility that could handle these as they would need to be retrofitted to all endpoints otherwise.

Additional context

I've looked at the CLI database quite a lot before and would like to contribute to it. If this is something that would accept a PR for, I could maybe take a look at it.

Matsuuu avatar Apr 19 '24 09:04 Matsuuu

related https://github.com/supabase/cli/issues/2026

sweatybridge avatar Jun 10 '24 16:06 sweatybridge

We have added npx supabase@beta seed buckets command.

The long term plan is to expand this top level command to seed users and run seed.sql against staging db.

Thanks for taking time to make this suggestion.

sweatybridge avatar Jul 06 '24 16:07 sweatybridge