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

Using diesel_cli for development only and running migrations from the binary #1840

Closed
kpcyrd opened this Issue Sep 10, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@kpcyrd
Contributor

kpcyrd commented Sep 10, 2018

I'm not sure if this has been requested before, but I couldn't find anything in the issue tracker or the docs. If there's something, please point me to it.

My usecase is somewhat straightforward. I'm writing a small application that uses sqlite and I would like to use diesel to abstract the database layer (the examples in the guides look really good!).

What makes my usecase special: It seems diesel is supposed to be used together with diesel_cli in a way that an administrator runs migrations on the database before upgrading to a new version. This is a very sensible choice for deployments with multiple deployments that talk to a central database.

My usecase is much simpler in the way that only a local sqlite is used. This means that I don't want to ask the user to run database migrations manually, instead I want to have this part in my binary so I can trigger both the database initialization and execute migrations if needed.

Ideally, diesel_cli would only be used by developers in my usecase, while the user doesn't need to know what diesel is or how to run database migrations. :)

Please let me know what you think!

@weiznich

This comment has been minimized.

Contributor

weiznich commented Sep 10, 2018

You are basically describing the current state 😉
(You are looking for diesel-migrations, especially embed_migrations!)

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