tokio-rs / rdbc

Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Apache License 2.0
566 stars 25 forks source link

Add ability to dynamically load an RDBC driver #9

Open andygrove opened 4 years ago

andygrove commented 4 years ago

Currently, it is necessary to statically link to all possible RDBC driver implementations that need to be used at runtime but one of the main benefits of ODBC/JDBC is that new drivers can be loaded at runtime, so we need a similar mechanism here.

KenSuenobu commented 4 years ago

Would this be a subclass, or would this be something like libdl that implements dynamic loading of shared libs? I'm not sure if this is supported in Rust, but it's a possible solution. I would think that if the drivers are lightweight enough, they can all be compiled into a single runtime?

andygrove commented 4 years ago

It would need to be dynamic loading of shared libs so that a user can use any driver with a product without having to have a version of the product that is compiled against the driver they want to use.

95th commented 4 years ago

Does anyone really load JDBC drivers at runtime in practice? I always thought that was an obscure thing to do.

andygrove commented 4 years ago

Actually, this is very common in desktop products where the user can add new JDBC drivers through the user interface without the need to restart the application.

95th commented 4 years ago

I see... Like crystal reports