# connect

fun connect(manager: (R2dbcDatabase) -> R2dbcTransactionManager = { TransactionManager(it) }, databaseConfig: R2dbcDatabaseConfig.Builder.() -> Unit = {}): R2dbcDatabase
fun connect(manager: (R2dbcDatabase) -> R2dbcTransactionManager = { TransactionManager(it) }, databaseConfig: R2dbcDatabaseConfig.Builder = R2dbcDatabaseConfig.Builder()): R2dbcDatabase

Creates an R2dbcDatabase instance.

Note: This function does not immediately instantiate an actual connection to a database, but instead provides the details necessary to do so whenever a connection is required by a transaction.

#### Parameters

manager

The TransactionManager responsible for new transactions that use this R2dbcDatabase instance.

databaseConfig

Builder of configuration parameters for this R2dbcDatabase instance.

#### Throws

IllegalStateException

If a corresponding database dialect cannot be resolved from values provided to databaseConfig.

fun connect(connectionFactory: ConnectionFactory, databaseConfig: R2dbcDatabaseConfig.Builder, manager: (R2dbcDatabase) -> R2dbcTransactionManager = { TransactionManager(it) }): R2dbcDatabase

Creates an R2dbcDatabase instance.

Note: This function does not immediately instantiate an actual connection to a database, but instead provides the details necessary to do so whenever a connection is required by a transaction.

#### Parameters

connectionFactory

The ConnectionFactory entry point for an R2DBC driver when getting a connection.

manager

The TransactionManager responsible for new transactions that use this R2dbcDatabase instance.

databaseConfig

Configuration parameters for this R2dbcDatabase instance. At minimum, a value for `explicitDialect` must be provided to prevent throwing an exception.

#### Throws

IllegalStateException

If a corresponding database dialect cannot be resolved from the connectionFactory or from values provided to databaseConfig.

fun connect(url: String, driver: String = getDriver(url), user: String = "", password: String = "", manager: (R2dbcDatabase) -> R2dbcTransactionManager = { TransactionManager(it) }, databaseConfig: R2dbcDatabaseConfig.Builder = R2dbcDatabaseConfig.Builder()): R2dbcDatabase

Creates an R2dbcDatabase instance.

Note: This function does not immediately instantiate an actual connection to a database, but instead provides the details necessary to do so whenever a connection is required by a transaction.

#### Parameters

url

The URL that represents the database when getting a connection.

driver

The R2DBC driver class. If not provided, the specified url will be used to find a match from the existing driver mappings.

user

The database user that owns the new connections.

password

The password specific for the database user.

databaseConfig

Configuration parameters for this R2dbcDatabase instance.

manager

The TransactionManager responsible for new transactions that use this R2dbcDatabase instance.

#### Throws

IllegalStateException

If a corresponding database dialect cannot be resolved from the provided url.

fun connect(databaseConfig: R2dbcDatabaseConfig, manager: (R2dbcDatabase) -> R2dbcTransactionManager = { TransactionManager(it) }): R2dbcDatabase

Creates an R2dbcDatabase instance.

Note: This function does not immediately instantiate an actual connection to a database, but instead provides the details necessary to do so whenever a connection is required by a transaction.

#### Parameters

databaseConfig

Configuration parameters for this R2dbcDatabase instance.

manager

The TransactionManager responsible for new transactions that use this R2dbcDatabase instance.

#### Throws

IllegalStateException

If a corresponding database dialect cannot be resolved from the provided databaseConfig.