byronwasti / movine

A migration manager written in Rust that attempts to be smart yet minimal
MIT License
109 stars 9 forks source link

Allow using your own DB connection with adapters #10

Closed kdar closed 4 years ago

kdar commented 4 years ago

When using the movine crate, it would be nice if we could supply our own connection. e.g. SqliteAdaptor::from_conn(). This way, we can reuse the connection and/or do some other setup (like with Sqlite and SqlCipher, needing to set the encryption key).

byronwasti commented 4 years ago

That is a great point, and definitely a use-case I'd like to support. The in-code support for Movine is still a work in progress (as you can probably tell) so use-cases like this are great for fleshing out the implementation.

It should be fairly straightforward to add support for this, so I'm hopeful I can get something out for this in a few days.

byronwasti commented 4 years ago

Hey, thanks for raising this issue. The latest release (0.8.0) adds support for this functionality. The library-based API has been modified a bit, so please reference the in-code docs: https://github.com/byronwasti/movine/blob/master/src/lib.rs#L29-L39 (or the README, although the in-code docs are tested)

Let me know if this doesn't solve your issue!