Companion

object Companion

Functions

Link copied to clipboard
fun connect(getNewConnection: () -> Connection, databaseConfig: DatabaseConfig? = null, manager: (Database) -> TransactionManager = { ThreadLocalTransactionManager(it) }): Database
fun connect(datasource: DataSource, setupConnection: (Connection) -> Unit = {}, databaseConfig: DatabaseConfig? = null, manager: (Database) -> TransactionManager = { ThreadLocalTransactionManager(it) }): Database
fun connect(url: String, driver: String = getDriver(url), user: String = "", password: String = "", setupConnection: (Connection) -> Unit = {}, databaseConfig: DatabaseConfig? = null, manager: (Database) -> TransactionManager = { ThreadLocalTransactionManager(it) }): Database

Creates a Database instance.

Link copied to clipboard
fun connectPool(datasource: ConnectionPoolDataSource, setupConnection: (Connection) -> Unit = {}, databaseConfig: DatabaseConfig? = null, manager: (Database) -> TransactionManager = { ThreadLocalTransactionManager(it) }): Database

JDBC driver implementations of ConnectionPoolDataSource are not actual connection pools, but rather a means of obtaining the physical connections to then be used in a connection pool. It is a known issue, with no plans to be fixed, that SQLiteConnectionPoolDataSource, for example, creates a new connection each time instead of retrieving a pooled connection. Other implementations, like PGConnectionPoolDataSource, suggest that a DataSource or a dedicated third-party connection pool library should be used instead.

Link copied to clipboard

Returns the stored default transaction isolation level for a specific database.

Link copied to clipboard

Returns the database name used internally for the provided connection url.

Link copied to clipboard
fun registerDialect(prefix: String, dialect: () -> DatabaseDialect)

Registers a new DatabaseDialect with the identifier prefix.

Link copied to clipboard
fun registerJdbcDriver(prefix: String, driverClassName: String, dialect: String)

Registers a new JDBC driver, using the specified driverClassName, with the identifier prefix.