-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
databasesJDBC related issuesJDBC related issuesdocumentationImprovements or additions to documentation (not KDocs)Improvements or additions to documentation (not KDocs)enhancementNew feature or requestNew feature or requestexamplesSomething related to the examplesSomething related to the examples
Milestone
Description
May we have such override?
public fun DataFrame.Companion.readSqlTable(
dataSource: DataSource,
): AnyFrame {
dataSource.connection.use { connection ->
return readSqlTable(connection, ...)
}
}
It looks like DataSource is a preferred API to use.
It looks like the recommended way to create SQL DB connection in production is using HikariCP, at least it's something LLM yieds for me:
fun dataSource(): HikariDataSource {
val cfg = HikariConfig().apply {
jdbcUrl = "jdbc:postgresql://localhost:5432/appdb?sslmode=disable"
username = "app"
password = "secret"
...
}
return HikariDataSource(cfg)
}
So, when we have the data source, we have javax.sql.DataSource , which is welcomed i.e. by exposed:
fun DataSource.listActive(): List<String> {
Database.connect(this)
return transaction {
...
}
}
It would be nice to be able to use this dataSource in any possible DB wrapper, it will allow this design to converge.
Metadata
Metadata
Assignees
Labels
databasesJDBC related issuesJDBC related issuesdocumentationImprovements or additions to documentation (not KDocs)Improvements or additions to documentation (not KDocs)enhancementNew feature or requestNew feature or requestexamplesSomething related to the examplesSomething related to the examples