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

[Feature] Add a cargo binary for running diesel migrations locally #4589

Open
lsampras opened this issue May 8, 2024 · 2 comments
Open

[Feature] Add a cargo binary for running diesel migrations locally #4589

lsampras opened this issue May 8, 2024 · 2 comments
Assignees
Labels
C-feature Category: Feature request or enhancement Developer Experience Product enhancements to enhance developer experience good first issue Good for newcomers

Comments

@lsampras
Copy link
Member

lsampras commented May 8, 2024

Objective

Add a new binary in the router crate that would run migrations locally via cli i.e cargo run migrations.

Context

Currently migrations are managed via the diesel_cli which rely on explicitly providing the database username/password & host,
This is a bit cumbersome when you have to provide the variables over & over again.

diesel migration --database-url postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME run

It would be somewhat easier if we could leverage diesel_migrations to read the credentials from config file / env & apply migrations.

(Open to alternative approaches as well for this)

Outcomes

  • A new rust binary that can be used for running local db migrations from file
  • Updates to the local setup documentation outlining the usage of this cli tool
@lsampras lsampras added C-feature Category: Feature request or enhancement good first issue Good for newcomers Developer Experience Product enhancements to enhance developer experience labels May 8, 2024
@davidkurilla
Copy link

I am interested in taking on this issue!

@lsampras
Copy link
Member Author

lsampras commented May 15, 2024

Hey @davidkurilla , thanks for your interest.
I'm assigning you this issue, you can ask any doubts here or reach out to me or @SanchithHegde on our slack/discord.

In case you are considering alternative approaches (apart from what I've described in the issue description) would love if you could share them here before starting implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement Developer Experience Product enhancements to enhance developer experience good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants