question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal to expose PgClient functionality through R2DBC API

See original GitHub issue

R2DBC is an initiative to establish a common SPI for relational database drivers embracing reactive programming properties: Event-oriented, non-blocking, and ideally stream-oriented access to databases. R2DBC is built entirely on Reactive Streams defining a minimal API surface to be implemented by drivers without the need to re-implement common client functionality in every driver.

From an R2DBC perspective there are a couple of interfaces that could be implemented by using the following components of PgClient:

  • ConnectionFactory -> PgClient and PgPool
  • Connection -> PgConnection
  • Statement -> Utility to build/prepare a statement, eventually calling PgConnection.query(…) or PgConnection.preparedQuery(…) methods
  • Result -> PgRowSet
  • Row -> (Pg) Row

What is the benefit of doing so?

Benefits:

  • Following an API that is well-suited for client developers without the need to entirely change how the client is supposed to work
  • Participating in a growing client-ecosystem (MyBatis, draft, JDBI, Spring) with clients providing a humane API. Application developers get a choice of which client they want to use for specific use-cases.
  • With the choice of clients, PgClient isn’t required to provide additional functionality such as object mapping or SQL generation. That’s up to the client.
  • Choice of plug and play for a growing eco-system of drivers beyond Postgres and MySQL (e.g. H2, Microsoft SQL Server) that can be used with vert.x.

Drawbacks:

  • https://xkcd.com/927/
  • Dependency on Reactive Streams (could be optional, still)
  • Additional complexity by maintaining two driver frontends

Related ticket: #245.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:28
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
mp911decommented, Apr 5, 2019

@vietj did you had a chance to have look at https://gist.github.com/mp911de/9ea13939e8fd9a6b4ef138419f085715 outlining the intended PR? If so, I could start working on a pull request. WDYT?

1reaction
lukasedercommented, Jun 19, 2022

Another set of potential users of this integration (all via jOOQ):

While it seems that Red Hat isn’t interested in moving forward with this (@vietj, why? Any background you can share on this decision? What would be needed to revert it?)

Is there any reason why @mp911de’s work couldn’t be published as one of these projects? https://r2dbc.io/drivers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proposal to expose PgClient functionality through R2DBC API
R2DBC is an initiative to establish a common SPI for relational database drivers embracing reactive programming properties: Event-oriented, ...
Read more >
Spring Data R2DBC - Reference Documentation
R2DBC is an API specification initiative that declares a reactive API to be implemented by driver vendors to access their relational databases.
Read more >
تويتر \ Alexander Ioffe (deusaquilus@) - Twitter
's sql-client and they're not interested in implementing the R2DBC spec. github.com. Proposal to expose PgClient functionality through R2DBC API · Issue ...
Read more >
R2DBC specification
Offer vendor-neutral access to standard features; 2.4. ... by the underlying database or expose functionality that is not declared by the ...
Read more >
Micronaut Data - GitHub Pages
Repositories with JPA Criteria API specification for Micronaut JDBC/R2DBC ... A root interface that features no methods but defines the entity type and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found