connect

fun connect(dialect: SqlDialect = detectDialectImplementation(), logger: Logger = detectLoggerImplementation(), alwaysQuoteIdentifiers: Boolean = false, generateSqlInUpperCase: Boolean? = null, connector: () -> Connection): Database(source)

Connect to a database by a specific connector function.

Return

the new-created database object.

Parameters

dialect

the dialect, auto-detects an implementation by default using JDK ServiceLoader facility.

logger

logger used to output logs, auto-detects an implementation by default.

alwaysQuoteIdentifiers

whether we need to always quote SQL identifiers in the generated SQLs.

generateSqlInUpperCase

whether we need to output the generated SQLs in upper case.

connector

the connector function used to obtain SQL connections.


fun connect(dataSource: DataSource, dialect: SqlDialect = detectDialectImplementation(), logger: Logger = detectLoggerImplementation(), alwaysQuoteIdentifiers: Boolean = false, generateSqlInUpperCase: Boolean? = null): Database(source)

Connect to a database using a DataSource.

Return

the new-created database object.

Parameters

dataSource

the data source used to obtain SQL connections.

dialect

the dialect, auto-detects an implementation by default using JDK ServiceLoader facility.

logger

logger used to output logs, auto-detects an implementation by default.

alwaysQuoteIdentifiers

whether we need to always quote SQL identifiers in the generated SQLs.

generateSqlInUpperCase

whether we need to output the generated SQLs in upper case.


fun connect(url: String, driver: String? = null, user: String? = null, password: String? = null, dialect: SqlDialect = detectDialectImplementation(), logger: Logger = detectLoggerImplementation(), alwaysQuoteIdentifiers: Boolean = false, generateSqlInUpperCase: Boolean? = null): Database(source)

Connect to a database using the specific connection arguments.

Return

the new-created database object.

Parameters

url

the URL of the database to be connected.

driver

the full qualified name of the JDBC driver class.

user

the username of the database.

password

the password of the database.

dialect

the dialect, auto-detects an implementation by default using JDK ServiceLoader facility.

logger

logger used to output logs, auto-detects an implementation by default.

alwaysQuoteIdentifiers

whether we need to always quote SQL identifiers in the generated SQLs.

generateSqlInUpperCase

whether we need to output the generated SQLs in upper case.