-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Labels
Milestone
Description
Sometimes we need to connect to multiple databases within the same application. Currently with Jdbc
module we can do like this:
{
use(new Jdbc("db.main"));
use(new Jdbc("db.audit"));
get("/db", req -> {
DataSource maindb = require(DataSource.class);
DataSource auditdb = require("db.audit", DataSource.class);
// ...
});
}
But with ebean module, we cannot name the EbeanServer bean on the same way. Currently Jooby just parses the url to 'guess' a database name, that makes it difficult to inject the ebeanserver via name. Why not we just use the Ebeanby's name as the datasource name?