-
Notifications
You must be signed in to change notification settings - Fork 546
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
Any plans on adding support for r2dbc spec #477
Comments
@meshpaul Do you think the MySQL interface together with https://github.com/mirromutth/r2dbc-mysql could be used for this? |
term "next evolution" may be problematic: https://twitter.com/jodastephen/status/1176186251277471747 |
@smagellan That tweet was about the Asynchronous Database Access API (ADBA) project by Oracle, not R2DBC. Also note that Oracle just released the official (!) R2DBC (!!) Driver for Oracle Database and even made it available on Maven Central (!!!), so I wouldn't exactly assume that R2DBC isn't a good candidate for implementation in a database driver. 😉 |
@joschi Interesting, thank you |
Thanks everyone for sharing your thoughts on this. However, I'd not suggest to simply build an adapter to bridge async calls to the JDBC driver. There's a diagram in #570 illustrates the whole structure. Basically, in order to implement r2dbc driver, we need to:
I'm working on |
Has anyone tried mysql interface for https://github.com/mirromutth/r2dbc-mysql?
As I understand this is the same issue |
Now we have Update: look at benchmark results for implementation based on JDK 11 HttpClient, no doubt r2dbc can bring us better performance. |
Just confused, doesn't #914 solve this issue? Why is this issue not closed? |
Hi @linghengqian, it's because I haven't test the r2dbc driver yet. I just quickly went over the code, added a few feedback along with some quick fixes. Among all the issues I mentioned here, my biggest concerns are 1) lack of testing; 2) potential resource leaking(closing ClickHouseResponse etc.), and 3) exception handling. Actually I'm not quite sure about the last two, as I'm not familiar with r2dbc spec. Having said that, I think @rernas35 did great job creating the new module and I wouldn't mind to release what we have as part of v0.3.3 :) Now we have nightly build at here, can someone please give it a shot and comment here? Any pull request is greatly appreciated :) |
I tested the nightly build and I am running into two issues: Dialect and Package Version. Issue with DialectThe database configuration requires an
I am configuring the client using @Configuration
@EnableR2dbcRepositories(
basePackages = ["com.base.repository.clickhouse"],
databaseClientRef = "data"
)
class ClickhouseDBConfig(private val databaseCredentials: DatabaseCredentials) : AbstractR2dbcConfiguration() {
override fun connectionFactory(): ConnectionFactory {
return ConnectionFactories.get(databaseCredentials.CLICKHOUSE)
}
@Bean(name = ["data"])
fun client(): DatabaseClient {
val factory = connectionFactory()
return DatabaseClient
.builder()
.bindMarkers(getDialect(factory).bindMarkersFactory)
.connectionFactory(factory)
.build()
}
} I am able to solve this issue by overriding the override fun getDialect(connectionFactory: ConnectionFactory): R2dbcDialect {
return MySqlDialect() # TODO replace with custom dialect
} I am currently returning Version ConflictsThere seems to be a conflict between the Alternatively, if I force the Since I imagine a lot of users will be using the package |
@kyleloomis Why do we need to fall back to R2DBC SPI 0.9.1.RELEASE? This is unreasonable, because at spring-projects/spring-framework#28787, spring-r2dbc has been promoted to R2DBC 1.0.0-RELEASE and no one in the R2DBC community is maintaining R2DBC driver for R2DBC SPI 0.9.1.RELEASE. |
R2DBC 0.9.x was an intermediate release with the goal of providing a transition phase towards R2DBC 1.0. |
Then perhaps we use 0.8.0 until there is broader adoption. |
Thanks for the feedback @kyleloomis. Dialect is defined in Spring so it's not suitable to add it into r2dbc driver. As to version conflict, since r2dbc 0.9.1 is very close to 1.0.0, I created #1094 to support that. 0.8.x is probably too old and not worthy to support. <dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-r2dbc_0.9.1</artifactId>
<version>0.3.3-SNAPSHOT</version>
</dependency> |
The original driver supports HTTP. In todays cloud protocols should CH R2DBC should support as bare minimum HTTP protocol IMHO |
Thanks we will try |
And I also like gRPC as well approach will let you know |
Like JDBC driver, there are 3 classifiers you can choose: |
hello,I also met this problem, may I ask if there is a solution, or any other solution, thank you for any advice! |
Hello,
Any plans on adding support for r2dbc spec I think this is next evolution of DB connectivity
I think your driver already exposes some of these concepts.
Thank you.
The text was updated successfully, but these errors were encountered: