njord-rs / njord

A versatile, feature-rich Rust ORM ⛵
https://njord.rs
BSD 3-Clause "New" or "Revised" License
409 stars 21 forks source link

Pull sqlite Into Own Package #140

Closed chaseWillden closed 1 month ago

chaseWillden commented 1 month ago

Currently sqlite is embedded in njord package.

For separation of concerns, this should be split out into it's own lib to allow for the other dbs to be implemented.

In short, in order to use this package, the user shouldn't be required to have a certain db

mjovanc commented 1 month ago

We don't need that though. We can just use CFG flag for the module itself in lib.rs and Cargo feature flags so it doesn't get included when adding njord as a dependency. If I understood you correctly? Currently we have feature flags for sqlite specifically.

As I visioned it, the user should be able to do this:

njord = { version = "<version>", features = ["sqlite"] }

Or:

njord = { version = "<version>", features = ["postgres"] }

If they don't want the default features they can do this:

njord = { version = "<version>", features = ["sqlite"], default-features = false }
chaseWillden commented 1 month ago

Oh sweet, I didn't know about this. Ok scratch that, I'll close this out