Skip to content

Commit

Permalink
Change the Vert.x SQL Client dependency to MySQL and refactor `expose…
Browse files Browse the repository at this point in the history
…dDatabaseConnectPostgresql` to `exposedDatabaseConnectMysql`
  • Loading branch information
ShreckYe committed Nov 20, 2024
1 parent ce50f6d commit d4ddc19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions mysql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies {
with(commonDependencies.vertx) { implementation(platformStackDepchain()) } // needed
implementation(cpnProject(project, ":core"))

runtimeOnly(commonDependencies.postgreSql())
implementation(commonDependencies.vertx.moduleWithoutVersion("pg-client"))
runtimeOnly(commonDependencies.postgreSql()) // TODO change to the MySQL JDBC dependency
implementation(commonDependencies.vertx.moduleWithoutVersion("mysql-client"))
implementation(commonDependencies.kotlinCommon.core()) // for `Untested`
implementation(commonDependencies.kotlinCommon.vertx()) // for `PgPoolOptions.setUpConventionally`
implementation(commonDependencies.kotlinCommon.vertx()) // for `PgPoolOptions.setUpConventionally` // TODO check if this is necessary for MySQL, and remove if not
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import java.sql.Connection
* @see exposedDatabaseConnect
*/
@ExperimentalEvscApi
fun ConnectionConfig.Socket.exposedDatabaseConnectPostgresql(
fun ConnectionConfig.Socket.exposedDatabaseConnectMysql(
setupConnection: (Connection) -> Unit = {},
databaseConfig: DatabaseConfig? = null,
manager: (Database) -> TransactionManager = { ThreadLocalTransactionManager(it) }
) =
exposedDatabaseConnect(
"postgresql", "org.postgresql.Driver", setupConnection, databaseConfig, manager
"mysql", "com.mysql.cj.jdbc.Driver", setupConnection, databaseConfig, manager
)

@ExperimentalEvscApi
@JvmName("exposedDatabaseConnectPostgresqlWithParameterConnectionConfig")
fun exposedDatabaseConnectPostgresql(
fun exposedDatabaseConnectMysql(
socketConnectionConfig: ConnectionConfig.Socket,
setupConnection: (Connection) -> Unit = {},
databaseConfig: DatabaseConfig? = null,
manager: (Database) -> TransactionManager = { ThreadLocalTransactionManager(it) }
) =
socketConnectionConfig.exposedDatabaseConnectPostgresql(setupConnection, databaseConfig, manager)
socketConnectionConfig.exposedDatabaseConnectMysql(setupConnection, databaseConfig, manager)

0 comments on commit d4ddc19

Please sign in to comment.