# Companion

object Companion

## Functions

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

Creates a Database instance.

getDefaultIsolationLevel
Link copied to clipboard
fun getDefaultIsolationLevel(db: Database): Int

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

getDialectName
Link copied to clipboard
fun getDialectName(url: String): String?

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

registerDialectMetadata
Link copied to clipboard
fun registerDialectMetadata(prefix: String, metadata: () -> DatabaseDialectMetadata)

Registers a new DatabaseDialectMetadata with the identifier prefix.

registerJdbcDriver
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.