# Builder

class Builder(var sqlLogger: SqlLogger? = null, var useNestedTransactions: Boolean = false, var defaultFetchSize: Int? = null, var defaultIsolationLevel: Int = -1, var defaultMaxAttempts: Int = 3, var defaultMinRetryDelay: Long = 0, var defaultMaxRetryDelay: Long = 0, var defaultReadOnly: Boolean = false, var warnLongQueriesDuration: Long? = null, var maxEntitiesToStoreInCachePerEntity: Int = Int.MAX_VALUE, var keepLoadedReferencesOutOfTransaction: Boolean = false, var explicitDialect: DatabaseDialect? = null, var defaultSchema: Schema? = null, var logTooMuchResultSetsThreshold: Int = 0, var preserveKeywordCasing: Boolean = true)

## Constructors

Builder
Link copied to clipboard
constructor(sqlLogger: SqlLogger? = null, useNestedTransactions: Boolean = false, defaultFetchSize: Int? = null, defaultIsolationLevel: Int = -1, defaultMaxAttempts: Int = 3, defaultMinRetryDelay: Long = 0, defaultMaxRetryDelay: Long = 0, defaultReadOnly: Boolean = false, warnLongQueriesDuration: Long? = null, maxEntitiesToStoreInCachePerEntity: Int = Int.MAX_VALUE, keepLoadedReferencesOutOfTransaction: Boolean = false, explicitDialect: DatabaseDialect? = null, defaultSchema: Schema? = null, logTooMuchResultSetsThreshold: Int = 0, preserveKeywordCasing: Boolean = true)

## Properties

defaultFetchSize
Link copied to clipboard
var defaultFetchSize: Int?

How many records will be fetched at once by select queries

defaultIsolationLevel
Link copied to clipboard
var defaultIsolationLevel: Int

Default transaction isolation level. If not specified, the database-specific level will be used. This can be overridden on a per-transaction level by specifying the `transactionIsolation` parameter of the `transaction` function. Check Database.getDefaultIsolationLevel for the database defaults.

defaultMaxAttempts
Link copied to clipboard
var defaultMaxAttempts: Int

The maximum amount of attempts that will be made to perform any transaction block. If this value is set to 1 and an SQLException happens, the exception will be thrown without performing a retry. This can be overridden on a per-transaction level by specifying the `maxAttempts` property in a `transaction` block. Default amount of attempts is 3.

defaultMaxRepetitionDelay
Link copied to clipboard
var defaultMaxRepetitionDelay: Long
defaultMaxRetryDelay
Link copied to clipboard
var defaultMaxRetryDelay: Long

The maximum number of milliseconds to wait before retrying a transaction if an SQLException happens. This can be overridden on a per-transaction level by specifying the `maxRetryDelay` property in a `transaction` block. Default maximum delay is 0.

defaultMinRepetitionDelay
Link copied to clipboard
var defaultMinRepetitionDelay: Long
defaultMinRetryDelay
Link copied to clipboard
var defaultMinRetryDelay: Long

The minimum number of milliseconds to wait before retrying a transaction if an SQLException happens. This can be overridden on a per-transaction level by specifying the `minRetryDelay` property in a `transaction` block. Default minimum delay is 0.

defaultReadOnly
Link copied to clipboard
var defaultReadOnly: Boolean

Should all connections/transactions be executed in read-only mode by default or not. Default state is false.

defaultRepetitionAttempts
Link copied to clipboard
var defaultRepetitionAttempts: Int
defaultSchema
Link copied to clipboard
var defaultSchema: Schema?

Set the default schema for a database.

explicitDialect
Link copied to clipboard
var explicitDialect: DatabaseDialect?

Set the explicit dialect for a database. This can be useful when working with unsupported dialects which have the same behavior as the one that Exposed supports.

keepLoadedReferencesOutOfTransaction
Link copied to clipboard
var keepLoadedReferencesOutOfTransaction: Boolean

Turns on "mode" for Exposed DAO to store relations (after they were loaded) within the entity that will allow access to them outside the transaction. Useful when eager loading is used.

logTooMuchResultSetsThreshold
Link copied to clipboard
var logTooMuchResultSetsThreshold: Int

Log too much result sets opened in parallel. The error log will contain the stacktrace of the place in the code where a new result set occurs, and it exceeds the threshold. 0 value means no log needed.

maxEntitiesToStoreInCachePerEntity
Link copied to clipboard
var maxEntitiesToStoreInCachePerEntity: Int

Amount of entities to keep in an EntityCache per an Entity class. Applicable only when `exposed-dao` module is used. This can be overridden on a per-transaction basis via `EntityCache.maxEntitiesToStore`. All entities will be kept by default.

preserveKeywordCasing
Link copied to clipboard
var preserveKeywordCasing: Boolean

Toggle whether table and column identifiers that are also keywords should retain their case sensitivity. Keeping user-defined case sensitivity (value set to `true`) is the default setting.

sqlLogger
Link copied to clipboard
var sqlLogger: SqlLogger?

SQLLogger to be used to log all SQL statements. Slf4jSqlDebugLogger by default.

useNestedTransactions
Link copied to clipboard
var useNestedTransactions: Boolean

Turn on/off nested transactions support. Is disabled by default

warnLongQueriesDuration
Link copied to clipboard
var warnLongQueriesDuration: Long?

Threshold in milliseconds to log queries which exceed the threshold with WARN level. No tracing enabled by default. This can be set on a per-transaction level by setting Transaction.warnLongQueriesDuration field.