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

Depend on snapshots, adapt to the new Exposed DSL, split modules, and completely overhaul the client creation APIs #14

Merged
merged 60 commits into from
Nov 29, 2024

Conversation

ShreckYe
Copy link
Member

No description provided.

Resolve #8

Some functions' signatures are changed so binary compatibility is not maintained. The project version is bumped BTW.
…pper" prefixes

Resolve #6

Two "delete" functions were mistakenly added in this file and its `com.huanshankeji.exposedvertxsqlclient.sql.mapping` package, and are now moved out into `com.huanshankeji.exposedvertxsqlclient.sql`. A TODO is removed with its content moved into README.md.
…nd benchmark code into the module "integrated"

IntelliJ IDEA Code Analysis shows there are 5 errors.
…gConnection` for different DBs, replacing them with `Pool` and `Connection`

A new `withTypedTransaction` function is added and `withPgTransaction` is moved into the `postgresql` package.
Major changes:

1. move some code to finer-grained subpackages
1. initially overhaul the APIs related to the creation of Vert.x SQL clients and `DatabaseClient`s

   The `create...andSetRole` functions are removed, and their functionalities are merged into the `create...` functions.

1. add TODOs as guidance for the remaining work
@ShreckYe ShreckYe self-assigned this Nov 18, 2024
1. move code related to `PostgreSQL` into the `postgreql` package
1. refactor the Vert.x `SqlClient` and Exposed `Database` creation APIs to be more configurable and straightforward
1. extract some common functions for JDBC, Exposed, and Vert.x
1. move the example code into the `main` source set
1. remove the extra `DatabaseClient` creation APIs `create*DatabaseClient`
1. adopt `EvscConfig` as the single-source-of-truth client config
1. add some more TODOs
1. update the example code README.md correspondingly
@ShreckYe ShreckYe changed the title Develop dependent on snapshots Depend on snapshots, adapt to the new Exposed DSL, split modules, and completely overhaul the client creation APIs Nov 19, 2024
…users usually don't call them directly and by doing this we don't forget to pass arguments in a caller
…ed" module

```text
Execution failed for task ':exposed-vertx-sql-client-integrated:compileBenchmarksKotlin'.
> Could not resolve all files for configuration ':exposed-vertx-sql-client-integrated:benchmarksCompileClasspath'.
   > Could not resolve all dependencies for configuration ':exposed-vertx-sql-client-integrated:benchmarksCompileClasspath'.
      > Could not find io.vertx:vertx-sql-client:.
        Required by:
            project :exposed-vertx-sql-client-integrated > project :exposed-vertx-sql-client-core
```
Split modules, completely overhaul the client creation APIs, and decouple PostgreSQL, our SQL DSL APIs, and our mapper SQL DSL APIs
…d v0.56.0 to resolve some binary incompatibilities as found out in internal projects, and update README.md to remind people about the Exposed version
…y` because the following error occurs probably when calling `withTransaction` in an internal project:

```
Cannot acquire a connection on a pipelined pool
io.vertx.core.impl.NoStackTraceThrowable: Cannot acquire a connection on a pipelined pool
```
…nBlocking` as a comparison for `TransactionBenchmark`
…nd an Ubuntu PC with AMD Ryzen™ 3900X, add more warmup and measurement iterations because the results are unstable, and rerun

The benchmark results of both show that with `runBlocking`: no dispatcher argument > `Dispatchers.Default` > `newSingleThreadContext` > `Dispatchers.IO`. The Mac with a lower Geekbench multi-core score generally outperforms the Ubuntu PC, except for the one with `Dispatchers.IO`, which is interesting.
…update the example code with 3 different kinds of `SqlClient`s
Some conclusions:
1. Calling `runBlocking` without a `CoroutineContext` should be equivalent to calling it with `Dispatchers.Unconfined`, both of which run on the original single thread of the caller.
1. Awaiting empty `async`s is dependent on single-core performance.
1. Both `Dispatchers.Default` and `Dispatchers.IO` utilize all the cores for computation.
1. `await` is much heavier on `Dispatchers.IO`.
1. `await` is lightest when calling `runBlocking` without a `CoroutineContext` or on `Dispatchers.Unconfined`.
@ShreckYe ShreckYe marked this pull request as ready for review November 29, 2024 14:34
@ShreckYe ShreckYe merged commit 2707fa1 into main Nov 29, 2024
2 checks passed
@ShreckYe ShreckYe deleted the dev-dependent-on-snapshots branch November 29, 2024 15:04
@ShreckYe ShreckYe restored the dev-dependent-on-snapshots branch November 29, 2024 15:08
@ShreckYe ShreckYe deleted the dev-dependent-on-snapshots branch November 29, 2024 15:10
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