-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing of parameters to reactive sql client connect options #25931
Conversation
@geoand / @Sanne I took a stab at this. I implemented it using a generic quarkus:
datasource:
username: myusername
password: mypassword
reactive:
url: postgresql://free-tier14.aws-us-east-1.cockroachlabs.cloud:26257/defaultdb
properties:
options: --cluster=heroes-db-2463
postgresql:
ssl-mode: require or quarkus.datasource.username=myusername
quarkus.datasource.password=mypassword
quarkus.datasource.reactive.url=postgresql://free-tier14.aws-us-east-1.cockroachlabs.cloud:26257/defaultdb
quarkus.datasource.reactive.properties.options=--cluster=heroes-db-2463
quarkus.datasource.reactive.postgresql.ssl-mode=require If you'd rather just have a specific config property for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @edeandrea
Just one suggestion, not mandatory.
* Additional properties for the client, which will be sent to server at the connection start. | ||
*/ | ||
@ConfigItem | ||
public Map<String, String> properties; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, for consistency, we could call this additionalProperties
:
Lines 135 to 139 in 15677f0
/** | |
* Other unspecified properties to be passed to the JDBC driver when creating new connections. | |
*/ | |
@ConfigItem | |
public Map<String, String> additionalJdbcProperties; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I can do that. I was staying consistent with the getProperties
/setProperties
/addProperty
naming conventions on io.vertx.sqlclient.SqlConnectOptions
rather than trying to match what the JDBC stuff calls it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
b21269e
to
16f20c9
Compare
This comment has been minimized.
This comment has been minimized.
...me/src/main/java/io/quarkus/reactive/datasource/runtime/DataSourceReactiveRuntimeConfig.java
Outdated
Show resolved
Hide resolved
d35ddbd
to
c93fd0a
Compare
@edeandrea Just by reading, the naming is a little confusing. Does cockroach support a We need to set the quarkus.datasource.username=myusername
quarkus.datasource.password=mypassword
quarkus.datasource.reactive.url=postgresql://host/db
quarkus.datasource.reactive.additional-properties.search_path=my_schema,public |
BTW the naming issues start with vertx. As you know the name of the class is |
@kdubb CockroachDB serverless DBaaS requires a connection parameter named With this change,
|
@edeandrea Perfect. Thanks this is exactly what we need. @gsmet This seems ready to go. Who do we ping to get this in for 2.10? I don't think I'm allowed to exercise my labeling powers to add this to the milestone lol |
As long as it's merged in the next few days, it will be part of @Sanne can you take a look at it? It looks good to me, but this is not my wheelhouse. |
@@ -145,4 +146,10 @@ public class DataSourceReactiveRuntimeConfig { | |||
*/ | |||
@ConfigItem | |||
public Optional<String> name; | |||
|
|||
/** | |||
* Other unspecified properties to be passed to the Reactive SQL Client when creating new connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this should be clarified: technically these options are passed directly to the PG database server each time a new connection is initiated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sanne What if we said something like this?
Other unspecified properties to be passed through the Reactive SQL Client directly to the database when new connections are initiated.
Not that this change is for all the reactive sql clients - not just the PG one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sounds good! thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Just pushed an update.
c93fd0a
to
276ec16
Compare
This comment has been minimized.
This comment has been minimized.
276ec16
to
dccb8d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
Allow passing of parameters to reactive sql client connect options
Fixes #25914