How to select a specific Postgres schema with reactive datasource in Quarkus

Viewed 101

Today with the below configuration it is connecting to the default schema of a db , how to configure to connect to a specific schema. enter image description here

references :

https://quarkus.io/guides/reactive-sql-clients#postgresql-2

Any leads will be really helpful.
2 Answers

UPDATE: you can actually use search_path as connection uri property.

I haven't tested it, but I would try this:

quarkus.datasource.reactive.additional-properties=search_path=user1

search_path is the property used by Postgres to define the schema. The syntax of the configuration is how Smallrye Config reads parameters as map.

Adding search_path to the connection uri will fetch results from specific schema.

Below configuration worked.

postgresql://localhost:5432/sampledb?search_path=user1

Below is the class that parse the db configuration

io.vertx.pgclient.impl.PgConnectionUriParser

Thank You David for the leads.

Reference : https://vertx.io/docs/vertx-pg-client/java/#_connection_uri

Related