byronwasti / movine

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

using features to figure which type of database is using. #5

Closed Kilerd closed 4 years ago

Kilerd commented 4 years ago

hello, I notice that you add adaptors(Postgres and SQLite) in crates. it means you need to add both two database drivers as dependencies to apply migrations. but it would apparently bloat movine‘s compile time.

AFAIAC, it's possible to add one of them in the feature list. in most scenarios, people just need one database driver and migration tool in the project.

byronwasti commented 4 years ago

Hey, thanks for reaching out. I'm of the opinion that the binary Movine should include all database-driver support, just because I think that UX is much nicer. However, the library could likely be refactored to use features for the database-driver support, since embedding Movine in an application will likely have different requirements.

Let me know if you have any additional thoughts or questions about this reasoning.

Kilerd commented 4 years ago

it makes sense, then would it be better to separate lib and CLI tool as different crates?(I have no idea how to handle a mixed-thing, part of it is controlled by features). maybe the workspace is a good choice?

byronwasti commented 4 years ago

I don't know for sure, but I don't think I need to do anything special for the crate. Movine already builds as a binary and as a library separately as-is. Its really just reconfiguring the library to use the features, which I might be able to get to soon.