ibmdb / java_reactive_driver

IBM Db2 Java Reactive Driver based on R2DBC.
6 stars 1 forks source link

Way to provide current schema to DB2ConnectionConfiguration #8

Open adrinerandrade opened 1 year ago

adrinerandrade commented 1 year ago

Some companies distinguish their development environments by using different database schemas, with each deployment always using just one schema. The documentation provides an example of a SET SCHEMA update, but in such cases, it might be more convenient to specify the current schema directly in the connection, similar to how it's possible with JDBC, as shown in the example below:

jdbc:db2://<host>:<port>/<database>:currentSchema=<schema>;

If this is not currently possible, I would suggest adding this feature, perhaps with a method such as:

DB2ConnectionConfiguration config = DB2ConnectionConfiguration.builder()
                .database("testdb")
                .schema("schema")
                .host("localhost")
                .port(50000)
                .username("db2inst1")
                .password("db2inst1-pwd")
                .build();

If this capability already exists in the builder, I would recommend making it more explicit in the development documentation. At present, this is the only reference I've found related to schemas:

image

Thank you!