GoogleCloudPlatform / cloud-sql-jdbc-socket-factory

A collection of Java libraries for connecting securely to Cloud SQL
Apache License 2.0
229 stars 119 forks source link

Support jasync-r2dbc-mysql driver #1263

Open davin111 opened 1 year ago

davin111 commented 1 year ago

Feature Description

Currently for r2dbc mysql, the dev.miku should be used. However, because the repository have not been maintained for quite long time and the driver is not compatible with the version 1 of r2dbc.spi (and so spring boot 3), Spring Boot removed it from its release and r2dbc.io also acknowledged it. Users of r2dbc mysql have moved to jasync-r2dbc-mysql or r2dbc-mariadb, etc. I saw the issue #990, but I think supporting jasync-r2dbc-mysql is also valuable. Could you consider it?

Sample code

No response

Alternatives Considered

No response

Additional Details

No response

enocom commented 1 year ago

@davin111 Does https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/pull/1264 address any of the concerns here?

enocom commented 1 year ago

We can treat this issue as a feature request for jasync-r2dbc-mysql.

1264 unblocked Spring Boot 3 support meanwhile.

mscheong01 commented 1 year ago

Based on my understanding, in order to use jasync-r2dbc-mysql or any other r2dbc driver, this library would need to acquire the ConnectionFactoryProvider through java spi rather than directly using that of a specific driver. However, since this library seems to rely on r2dbc-mysql's ssl tunneling functionalities, which are not supported by r2dbc-spi, it seems impossible to implement at the moment.

One potential solution could be to support certain drivers by checking for their existence one-by-one, as demonstrated in this example. However, this would only allow us to support drivers with ssl tunneling functionality.

Please note that I may be mistaken about certain aspects, so please feel free to correct me if necessary.

enocom commented 1 year ago

If Spring Boot 3 is the driving concern, I think we've fixed that with #1264.

Are there other reasons to support jasync-r2dbc-mysql (or postgres)?