# DatabaseDialect

interface DatabaseDialect

Common interface for all database dialects.

#### Inheritors

VendorDialect

## Types

Companion
Link copied to clipboard
object Companion

## Properties

dataTypeProvider
Link copied to clipboard
abstract val dataTypeProvider: DataTypeProvider

Data type provider of this dialect.

defaultReferenceOption
Link copied to clipboard
open val defaultReferenceOption: ReferenceOption

Returns the default reference option for the dialect.

functionProvider
Link copied to clipboard
abstract val functionProvider: FunctionProvider

Function provider of this dialect.

h2Mode
Link copied to clipboard
val DatabaseDialect.h2Mode: H2Dialect.H2CompatibilityMode?

The current H2 database compatibility mode or `null` if the current database is not H2.

likePatternSpecialChars
Link copied to clipboard
open val likePatternSpecialChars: Map<Char, Char?>

Returns a mapping of dialect-specific characters to be escaped when used alongside the LIKE operator.

name
Link copied to clipboard
abstract val name: String

Name of this dialect.

needsQuotesWhenSymbolsInNames
Link copied to clipboard
open val needsQuotesWhenSymbolsInNames: Boolean

Returns `true` if the dialect requires the use of quotes when using symbols in object names, `false` otherwise.

needsSequenceToAutoInc
Link copied to clipboard
open val needsSequenceToAutoInc: Boolean

Returns `true` if the dialect requires the use of a sequence to create an auto-increment column, `false` otherwise.

requiresAutoCommitOnCreateDrop
Link copied to clipboard
open val requiresAutoCommitOnCreateDrop: Boolean

Returns true if autoCommit should be enabled to create/drop a database.

sequenceMaxValue
Link copied to clipboard
open val sequenceMaxValue: Long

Returns the allowed maximum sequence value for a dialect, as a Long.

supportsAlterCheckConstraint
Link copied to clipboard
open val supportsAlterCheckConstraint: Boolean

Returns `true` if the dialect supports ALTER TABLE with either an add or drop check constraint clause.

supportsColumnTypeChange
Link copied to clipboard
open val supportsColumnTypeChange: Boolean

Returns whether Exposed currently supports column type change in migrations for this dialect.

supportsCreateSchema
Link copied to clipboard
open val supportsCreateSchema: Boolean

Returns`true` if the dialect supports schema creation.

supportsCreateSequence
Link copied to clipboard
open val supportsCreateSequence: Boolean

Returns `true` if the dialect supports the creation of sequences, `false` otherwise.

supportsDualTableConcept
Link copied to clipboard
open val supportsDualTableConcept: Boolean

Returns `true` if the dialect provides a special dummy DUAL table, accessible by all users.

supportsIfNotExists
Link copied to clipboard
open val supportsIfNotExists: Boolean

Returns `true` if the dialect supports the `IF EXISTS`/`IF NOT EXISTS` option when creating, altering or dropping objects, `false` otherwise.

supportsMultipleGeneratedKeys
Link copied to clipboard
abstract val supportsMultipleGeneratedKeys: Boolean

Returns `true` if the dialect supports returning multiple generated keys as a result of an insert operation, `false` otherwise.

supportsOnlyIdentifiersInGeneratedKeys
Link copied to clipboard
open val supportsOnlyIdentifiersInGeneratedKeys: Boolean

Returns `true` if the dialect supports only returning generated keys that are identity columns.

supportsOnUpdate
Link copied to clipboard
open val supportsOnUpdate: Boolean

Returns `true` if the dialect supports using the ON UPDATE clause with a foreign key constraint.

supportsOrderByNullsFirstLast
Link copied to clipboard
open val supportsOrderByNullsFirstLast: Boolean

Returns `true` if the dialect provides options to configure how nulls are sorted compared to non-null values.

supportsRestrictReferenceOption
Link copied to clipboard
open val supportsRestrictReferenceOption: Boolean

Returns `true` if the dialect supports the RESTRICT action as part of a foreign key constraint clause.

supportsSelectForUpdate
Link copied to clipboard
open val supportsSelectForUpdate: Boolean

Returns `true` if the dialect supports `SELECT FOR UPDATE` statements, `false` otherwise.

supportsSequenceAsGeneratedKeys
Link copied to clipboard
open val supportsSequenceAsGeneratedKeys: Boolean

Returns `true` if the dialect supports returning generated keys obtained from a sequence.

supportsSetDefaultReferenceOption
Link copied to clipboard
open val supportsSetDefaultReferenceOption: Boolean

Returns `true` if the dialect supports the SET DEFAULT action as part of a foreign key constraint clause.

supportsSubqueryUnions
Link copied to clipboard
open val supportsSubqueryUnions: Boolean

Returns `true` if the dialect supports subqueries within a UNION/EXCEPT/INTERSECT statement.

supportsTernaryAffectedRowValues
Link copied to clipboard
open val supportsTernaryAffectedRowValues: Boolean

Returns `true` if the dialect supports an upsert operation returning an affected-row value of 0, 1, or 2.

supportsWindowFrameGroupsMode
Link copied to clipboard
open val supportsWindowFrameGroupsMode: Boolean

Returns `true` if the dialect supports window function definitions with GROUPS mode in frame clause

## Functions

addPrimaryKey
Link copied to clipboard
abstract fun addPrimaryKey(table: Table, pkName: String?, vararg pkColumns: Column<*>): String

Returns the SQL statement that adds a primary key specified pkName to an existing table.

areEquivalentColumnTypes
Link copied to clipboard
open fun areEquivalentColumnTypes(columnMetadataSqlType: String, columnMetadataJdbcType: Int, columnType: String): Boolean

Returns whether the columnMetadataSqlType type and the columnType are equivalent.

createDatabase
Link copied to clipboard
open fun createDatabase(name: String): String

Returns the SQL statement that creates a database with the specified name.

createIndex
Link copied to clipboard
abstract fun createIndex(index: Index): String

Returns the SQL statement that creates the specified index.

createSchema
Link copied to clipboard
open fun createSchema(schema: Schema): String

Returns the SQL statement that creates the specified schema.

dropDatabase
Link copied to clipboard
open fun dropDatabase(name: String): String

Returns the SQL statement that drops the database with the specified name.

dropIndex
Link copied to clipboard
abstract fun dropIndex(tableName: String, indexName: String, isUnique: Boolean, isPartialOrFunctional: Boolean): String

Returns the SQL statement that drops the specified indexName from the specified tableName.

dropSchema
Link copied to clipboard
open fun dropSchema(schema: Schema, cascade: Boolean): String

Returns the SQL statement that drops the specified schema, as well as all its objects if cascade is `true`.

isAllowedAsColumnDefault
Link copied to clipboard
open fun isAllowedAsColumnDefault(e: Expression<*>): Boolean

Returns `true` if the specified e is allowed as a default column value in the dialect, `false` otherwise.

listDatabases
Link copied to clipboard
open fun listDatabases(): String

Returns the SQL query that retrieves a set of existing databases.

modifyColumn
Link copied to clipboard
abstract fun modifyColumn(column: Column<*>, columnDiff: ColumnDiff): List<String>

Returns the SQL statement that modifies the specified column.

open fun modifyColumn(originalColumnData: ColumnMetadata, column: Column<*>, columnDiff: ColumnDiff): List<String>

Returns the SQL statement that modifies the specified column, using the current originalColumnData state.

setColumnComment
Link copied to clipboard
open fun setColumnComment(column: Column<*>, comment: String?): List<String>

Returns SQL statements to set a comment on the specified column. Returns empty list if comments are not supported.

setSchema
Link copied to clipboard
open fun setSchema(schema: Schema): String

Returns the SQL statement that sets the current schema to the specified schema.