Traits for database connection


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.



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: but I haven’t used it.

I am sketching out something like that as, but it’s still in a draft phase (see