DatabaseConfig

data class DatabaseConfig(val jdbcUrl: String, val driverClassName: String? = null, val username: String = "", val password: String = "", val poolSize: Int = 10, val maxLifetime: Long = 30 * 60 * 1000, val minIdle: Int = 2, val connectionTimeout: Long, val schema: String? = null, val exposedConfig: DatabaseConfig? = null)(source)

Configuration data class for database connection settings. Provides all necessary parameters to create a database connection.

Constructors

Link copied to clipboard
constructor(jdbcUrl: String, driverClassName: String? = null, username: String = "", password: String = "", poolSize: Int = 10, maxLifetime: Long = 30 * 60 * 1000, minIdle: Int = 2, connectionTimeout: Long, schema: String? = null, exposedConfig: DatabaseConfig? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Connection timeout in milliseconds (default: 20 seconds)

Link copied to clipboard

The fully qualified name of the JDBC driver class

Link copied to clipboard
val exposedConfig: DatabaseConfig?

Optional Exposed DatabaseConfig for additional settings

Link copied to clipboard

The JDBC URL for the database (e.g., "jdbc:h2:mem:testdb")

Link copied to clipboard

Maximum lifetime of a connection in milliseconds (default: 30 minutes)

Link copied to clipboard

Minimum number of idle connections (default: 2)

Link copied to clipboard

Database password (default: empty for H2)

Link copied to clipboard

Connection pool size (default: 10)

Link copied to clipboard

Optional schema to use

Link copied to clipboard

Database username (default: empty for H2)

Functions

Link copied to clipboard

Auto-detect the driver class name based on the JDBC URL.