Class MySqlDatabaseDialect
java.lang.Object
io.debezium.connector.jdbc.dialect.GeneralDatabaseDialect
io.debezium.connector.jdbc.dialect.mysql.MySqlDatabaseDialect
- All Implemented Interfaces:
DatabaseDialect
A
DatabaseDialect implementation for MySQL.- Author:
- Chris Cranford
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMySqlDatabaseDialect(JdbcSinkConnectorConfig config, org.hibernate.SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddColumnDefaultValue(SinkRecordDescriptor.FieldDescriptor field, StringBuilder columnSpec) Format a date and time.getFormattedTime(ZonedDateTime value) Format a time.Format a timestamp.Format a timestamp with time zone.intGets the maximum length of a VARCHAR field in a primary key column.getUpsertStatement(TableDescriptor table, SinkRecordDescriptor record) Construct aUPSERTstatement specific for this dialect.protected voidMethods inherited from class io.debezium.connector.jdbc.dialect.GeneralDatabaseDialect
bindValue, columnNameFromField, columnNameFromField, columnQueryBindingFromField, getAlterTableStatement, getByteArrayFormat, getColumnNamingStrategy, getConfig, getCreateTableStatement, getDatabaseVersion, getDefaultDecimalPrecision, getDefaultTimestampPrecision, getDeleteStatement, getFormattedBoolean, getFormattedDate, getFormattedDateTimeWithNanos, getFormattedTimeWithTimeZone, getIdentifierHelper, getInsertStatement, getMaxNVarcharLengthInKey, getMaxVarbinaryLength, getSchemaType, getTypeName, getTypeName, getTypeName, getUpdateStatement, getVersion, isIdentifierUppercaseWhenNotQuoted, isNegativeScaleAllowed, readTable, registerType, resolveMissingFields, tableExists, toIdentifier, toIdentifierMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.connector.jdbc.dialect.DatabaseDialect
getMaxTimePrecision, getMaxTimestampPrecision
-
Field Details
-
NO_DEFAULT_VALUE_TYPES
-
ISO_LOCAL_DATE_TIME_WITH_SPACE
-
-
Constructor Details
-
MySqlDatabaseDialect
private MySqlDatabaseDialect(JdbcSinkConnectorConfig config, org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
registerTypes
protected void registerTypes()- Overrides:
registerTypesin classGeneralDatabaseDialect
-
getMaxVarcharLengthInKey
public int getMaxVarcharLengthInKey()Description copied from interface:DatabaseDialectGets the maximum length of a VARCHAR field in a primary key column.- Specified by:
getMaxVarcharLengthInKeyin interfaceDatabaseDialect- Overrides:
getMaxVarcharLengthInKeyin classGeneralDatabaseDialect- Returns:
- maximum varchar field length when participating in the primary key
-
getFormattedTime
Description copied from interface:DatabaseDialectFormat a time.- Specified by:
getFormattedTimein interfaceDatabaseDialect- Overrides:
getFormattedTimein classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value
-
getFormattedDateTime
Description copied from interface:DatabaseDialectFormat a date and time.- Specified by:
getFormattedDateTimein interfaceDatabaseDialect- Overrides:
getFormattedDateTimein classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value
-
getFormattedTimestamp
Description copied from interface:DatabaseDialectFormat a timestamp.- Specified by:
getFormattedTimestampin interfaceDatabaseDialect- Overrides:
getFormattedTimestampin classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value
-
getFormattedTimestampWithTimeZone
Description copied from interface:DatabaseDialectFormat a timestamp with time zone.- Specified by:
getFormattedTimestampWithTimeZonein interfaceDatabaseDialect- Overrides:
getFormattedTimestampWithTimeZonein classGeneralDatabaseDialect- Parameters:
value- the value to be formatted, nevernull- Returns:
- the formatted string value.
-
getUpsertStatement
Description copied from interface:DatabaseDialectConstruct aUPSERTstatement specific for this dialect.- Specified by:
getUpsertStatementin interfaceDatabaseDialect- Overrides:
getUpsertStatementin classGeneralDatabaseDialect- Parameters:
table- the current relational table model, should not benullrecord- the current sink record being processed, should not benull- Returns:
- the upsert SQL statement to be executed, never
null
-
addColumnDefaultValue
protected void addColumnDefaultValue(SinkRecordDescriptor.FieldDescriptor field, StringBuilder columnSpec) - Overrides:
addColumnDefaultValuein classGeneralDatabaseDialect
-