Traits for database connection

Hello,

Is there a set of traits (with in a crates or not) that allow me to do database operations what ever the database is ?

I like JDBC for JAVA that all database drivers implements. This is very easy to switch between databases because only the configuration will change.

I saw r2d2crates which seems to be good. But it is a generic implementation, not a set of traits for any database operations.

Please advise.

Regards

Corentin

No, there is no such thing for Rust as a standard. The closest native solution would be Diesel, which supports Mysql/Postgresql/SQLite. Beside that you can use native db drivers. There is also this: https://github.com/rawrasaur/rust-jdbc but I haven’t used it.

I am sketching out something like that as https://github.com/berlinrs/tbd.rs, but it’s still in a draft phase (see DRAFT_NOTES.md).