fun dbSetup(to: Destination, binderConfiguration: BinderConfiguration = DefaultBinderConfiguration.INSTANCE, configure: DbSetupBuilder.() -> Unit): DbSetup
Top-level function allowing to create a DbSetup by passing a destination and a lambda expression used to configure the operations that must be made.
Example usage:
val setup = dbSetup(to = DriverManagerDestination(url, user, password)) {
deleteAllFrom("user", "country")
insertInto("country") {
...
}
insertInto("user") {
...
}
sql(...)
}
to
- the destination of the DbSetupbinderConfiguration
- a custom binder configuration. The default one is used if not specifiedconfigure
- the function used to configure the DbSetupReturn
the created DbSetup
Author
JB Nizet
fun dbSetup(to: DataSource, binderConfiguration: BinderConfiguration = DefaultBinderConfiguration.INSTANCE, configure: DbSetupBuilder.() -> Unit): DbSetup
Top-level function allowing to create a DbSetup by passing a DataSource and a lambda expression used to configure the operations that must be made.
Example usage:
val setup = dbSetup(to = dataSource) {
deleteAllFrom("user", "country")
insertInto("country") {
...
}
insertInto("user") {
...
}
sql(...)
}
to
- the destination of the DbSetupbinderConfiguration
- a custom binder configuration. The default one is used if not specifiedconfigure
- the function used to configure the DbSetupReturn
the created DbSetup
Author
JB Nizet