Skip to content

Conversation

@vietj
Copy link
Member

@vietj vietj commented Jun 30, 2025

Cleanup/decoupling of the SQL client.

  • Lot of decoupling
    • Remove public fields that were used here and there
    • Extract the Vert.x/Netty codec framework in its own module
  • Avoid exposing the pool implementation
  • Command SPI
  • Connection SPI
  • Various cleanups
    • unused things
    • things that should be in their own component

vietj added 2 commits June 30, 2025 12:01
Motivation:

The ConnectionFactory SPI currently provides an SqlConnection, most callers actually care about the actual Connection SPI and unwrap it then cast it.

Instead we can have the ConnectionFactory only care about providing Connection and let callers wrap it with an SqlConnection of their choice.

As consequence this simplifies the pool implementation as they operation on Connection.
@vietj vietj added this to the 5.1.0 milestone Jun 30, 2025
@vietj vietj self-assigned this Jun 30, 2025
vietj added 3 commits June 30, 2025 13:36
…mand.

Motivation:

Commands are currently sent to every socket based encoder (e.g. PgEncoder) that then turns it into a codec object that is then encoded.

There are two issues related to this:

1. the codec is actually the message to be sent and not the command
2. the command requires the handler to be executed and we want to make the command base handler private (so it can be removed later)

Then:

Most likely we will continue this refactor by renaming *Codec classes to *Message and make the Completable<R> handler part of the message, so we can remove it from CommandBase
@vietj vietj force-pushed the isolate-command-to-backend branch 2 times, most recently from 7be96d2 to c8d045b Compare July 1, 2025 06:14
Motivation:

In the quest of removing CommandBase#handler, we are replacing its usage by CommandMessage#handler.

Hopefully we will remove it also for the Oracle implementation.
@vietj vietj force-pushed the isolate-command-to-backend branch from c8d045b to 0aa4093 Compare July 1, 2025 06:44
vietj added 8 commits July 1, 2025 08:44
…y not needed, since that is a command response message for Netty based pipelines.
Motivation:

CommandResponse is actually not part of the SPI since its usage is confined to the socket/pipeline implementations, it is actually an inbound message decoded by the pipeline and processed by the socket connection base.
Motivation:

RowBase is abstract and does not implement a couple of methods from its contract, such implementation actually relies on a description field present in each of its subclasses. Instead we can have RowBase carry the description field and implement those methods, as consequence RowBase can be reused as such and does not need to be abstract.

RowDesc is simply abstract but is usable out of the box, just make it not abstract so it can be instantiated right away.
… not be exposed.

Expose lifecycle hooks in the generic driver instead.
Motivation:

The Driver interface does not need to declare connection pool related details such as the connection factory and the connection wrapper methods.

Those instead can be on the GenericDriver, so let's move them there.
…cific to PostgreSQL and instead use downcast.
@vietj vietj linked an issue Jul 1, 2025 that may be closed by this pull request
3 tasks
@vietj vietj force-pushed the isolate-command-to-backend branch from 3897559 to 03e17ec Compare July 1, 2025 12:53
@vietj vietj force-pushed the isolate-command-to-backend branch from 03e17ec to 813c276 Compare July 1, 2025 13:07
vietj added 2 commits July 1, 2025 15:45
Motivation:

The vertx-sql-client component defines among all the base framework for Vert.x/Netty based implementations (e.g. PG client).

This module intents to define the SQL client API as well as the SPI, there are implementations that do not use the Vert.x/Netty such as JDBC client or Oracle client.

This extracts the Vert.x/Netty part into its own io.vertx.sql.client.codec module ensuring strong decoupling between with io.vertx.sql.client module.

This new module intents to remain quite internal and is not an API usable from Vert.x by most users.
@vietj vietj force-pushed the isolate-command-to-backend branch from 9c7b3f6 to 4ac1990 Compare July 1, 2025 14:44
@vietj vietj changed the title Isolate command to backend Backend SPI Jul 1, 2025
@vietj vietj mentioned this pull request Jul 1, 2025
3 tasks
@vietj vietj merged commit 93b0633 into master Jul 1, 2025
18 checks passed
@vietj vietj deleted the isolate-command-to-backend branch July 1, 2025 16:15
@yrodiere
Copy link

yrodiere commented Jul 2, 2025

Well that was fast. Thank you @vietj!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend Service Provider Interface

3 participants