Skip to content
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

feat!: Add support for r2dbc driver connections #2266

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

bog-walk
Copy link
Member

@bog-walk bog-walk commented Oct 7, 2024

Description

Summary of the change: Provide a concise summary of this PR. Describe the changes made in a single sentence or short paragraph.

Detailed description:

  • What: Detail what changes have been made in the PR.
  • Why: Explain the reasons behind the changes. Why were they necessary?
  • How: Describe how the changes were implemented, including any key aspects of the code modified or new features added.

Type of Change

Please mark the relevant options with an "X":

  • Bug fix
  • New feature
  • Documentation update

Updates/remove existing public API methods:

  • Is breaking change

Affected databases:

  • MariaDB
  • Mysql5
  • Mysql8
  • Oracle
  • Postgres
  • SqlServer
  • H2
  • SQLite

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

Related Issues

- Implement all API interfaces and abstract classes
- Extract base logic from Database to new DatabaseApi and implement r2dbc versi>
- Add dialect-specific metadata providers and example tests (Oracle and SQl Ser>
are mostly not implemented)
- Implement custom transaction manager, but need to decide on what to do with
transaction (existing blocks).
- Add SqlTypeProvider and PropertyProvider objects to be held by a MetadataProv>
instance representative of each supported database.
- Add missing KDocs.
- Add tests for all metadata queries.
- Add notes about restrictions related to Oracle, SQL Server, and PostgreSQL-NG
…ltApi

- Introduce ResultApi interface that wraps actual database result
- Introduce JdbcResult and R2dbcResult
- Since only getting object by index and/or type is supported by R2DBC, all uses
of ResultSet specific getType() functions in source code have been replaced by
getObject()
- The test getKeywords() passes locally but occasionally fails on TC build
… plain sql

- Set connection url as proprty of R2dbcDatabase so it can be accessed without
retrieving metadata
- Remove getUrl() from MetadataProvider and subclasses
- Introduce Transaction.execQuery() that returns a Flow based on a transformation
- Introduce Transaction.execQuery() that executes without transformation
- Add unit tests (commented out as conflict between driver dependencies)
…ls to jdbc module

- executeQuery(), executeBatch(), and executeMultiple() now suspend, as do many
internal or private functions
- Transaction.exec() variants should also suspend as they are used frequently, but
this is problematic for jdbc and trickling up
- Any use of exec() or Statement.execute() in vendor dialects has been moved to jdbc module
- Since Statement.execute() is used heavily in Queries.kt, creation of each statement
has been extracted to a common StatementBuilder object. That way execution can be
separated by introducing suspend variants of insert/update/delete etc.
- A decision needs to be made about query statements and SchemaUtils and all other
internal uses.
- Marked all potential breaking changes and places that may need suspend
@bog-walk bog-walk marked this pull request as draft October 7, 2024 04:40
@bog-walk bog-walk requested a review from e5l October 7, 2024 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant