# MysqlDialect

open class MysqlDialect : VendorDialect

MySQL dialect implementation.

#### Inheritors

MariaDBDialect

## Constructors

MysqlDialect
Link copied to clipboard
constructor()

## Types

Companion
Link copied to clipboard
object Companion : VendorDialect.DialectNameProvider

## Properties

allTablesNames
Link copied to clipboard
val allTablesNames: List<String>

Returns a list with the names of all the defined tables within default scheme.

dataTypeProvider
Link copied to clipboard
open override 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
open override 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
open override 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.

supportsCreateSchema
Link copied to clipboard
open val supportsCreateSchema: Boolean

Returns`true` if the dialect supports schema creation.

supportsCreateSequence
Link copied to clipboard
open override val supportsCreateSequence: Boolean = false

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
open override val supportsMultipleGeneratedKeys: Boolean = true

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 override val supportsOrderByNullsFirstLast: Boolean = false

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.

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 override val supportsSetDefaultReferenceOption: Boolean = false

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

supportsSubqueryUnions
Link copied to clipboard
open override val supportsSubqueryUnions: Boolean = true

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

supportsTernaryAffectedRowValues
Link copied to clipboard
open override val supportsTernaryAffectedRowValues: Boolean = true

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
open override 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.

allTablesNames
Link copied to clipboard
open override fun allTablesNames(): List<String>

Returns a list with the names of all the defined tables with schema prefixes if database supports it. This method always re-read data from DB. Using `allTablesNames` field is the preferred way.

catalog
Link copied to clipboard
open fun catalog(transaction: Transaction): String

Returns the catalog name of the connection of the specified transaction.

checkTableMapping
Link copied to clipboard
open fun checkTableMapping(table: Table): Boolean
columnConstraints
Link copied to clipboard
open override fun columnConstraints(vararg tables: Table): Map<Pair<Table, LinkedHashSet<Column<*>>>, List<ForeignKeyConstraint>>

Returns a map with the foreign key constraints of all the defined columns sets in each of the specified tables.

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
open override fun createIndex(index: Index): String

Uniqueness might be required for foreign key constraints.

createSchema
Link copied to clipboard
open override 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
open override 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 override 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`.

existingIndices
Link copied to clipboard
open override fun existingIndices(vararg tables: Table): Map<Table, List<Index>>

Returns a map with all the defined indices in each of the specified tables.

existingPrimaryKeys
Link copied to clipboard
open override fun existingPrimaryKeys(vararg tables: Table): Map<Table, PrimaryKeyMetadata?>

Returns a map with the primary key metadata in each of the specified tables.

filterCondition
Link copied to clipboard
fun filterCondition(index: Index): String?
getDatabase
Link copied to clipboard
open override fun getDatabase(): String

Returns the name of the current database.

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

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

isFractionDateTimeSupported
Link copied to clipboard
fun isFractionDateTimeSupported(): Boolean

Returns `true` if the MySQL JDBC connector version is greater than or equal to 5.6.

isTimeZoneOffsetSupported
Link copied to clipboard
fun isTimeZoneOffsetSupported(): Boolean

Returns `true` if a MySQL JDBC connector is being used and its version is greater than or equal to 8.0.

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
open override fun modifyColumn(column: Column<*>, columnDiff: ColumnDiff): List<String>

Returns the SQL statement that modifies the specified column.

resetCaches
Link copied to clipboard
open override fun resetCaches()

Clears any cached values.

resetSchemaCaches
Link copied to clipboard
open override fun resetSchemaCaches()

Clears any cached values including schema names.

resolveRefOptionFromJdbc
Link copied to clipboard
open fun resolveRefOptionFromJdbc(refOption: Int): ReferenceOption

Returns the corresponding ReferenceOption for the specified refOption from JDBC.

schemaExists
Link copied to clipboard
open override fun schemaExists(schema: Schema): Boolean

Checks if the specified schema exists.

sequenceExists
Link copied to clipboard
open override fun sequenceExists(sequence: Sequence): Boolean

Returns whether the specified sequence exists.

sequences
Link copied to clipboard
open override fun sequences(): List<String>

Returns a list of the names of all sequences in the database.

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

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

supportsSelectForUpdate
Link copied to clipboard
open override fun supportsSelectForUpdate(): Boolean

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

tableColumns
Link copied to clipboard
open override fun tableColumns(vararg tables: Table): Map<Table, List<ColumnMetadata>>

Returns a map with the column metadata of all the defined columns in each of the specified tables.

tableExists
Link copied to clipboard
open override fun tableExists(table: Table): Boolean

Checks if the specified table exists in the database.