Package io.debezium.connector.jdbc.type
Interface Type
- All Known Implementing Classes:
AbstractBytesType,AbstractConnectMapType,AbstractConnectSchemaType,AbstractDateType,AbstractDebeziumTimestampType,AbstractDebeziumTimestampType,AbstractDebeziumTimeType,AbstractDebeziumTimeType,AbstractGeoType,AbstractTemporalType,AbstractTimestampType,AbstractTimeType,AbstractType,BitType,BitType,BitType,BooleanType,BytesType,BytesType,BytesType,BytesType,CaseInsensitiveTextType,CidrType,ConnectBooleanType,ConnectBytesType,ConnectDateType,ConnectDateType,ConnectDecimalType,ConnectFloat32Type,ConnectFloat64Type,ConnectInt16Type,ConnectInt32Type,ConnectInt64Type,ConnectInt8Type,ConnectMapToConnectStringType,ConnectStringType,ConnectTimestampType,ConnectTimestampType,ConnectTimeType,ConnectTimeType,ConnectTimeType,DateType,DateType,EnumType,EnumType,GeographyType,GeometryType,GeometryType,InetType,IntegerType,IntervalType,JsonType,JsonType,LtreeType,MacAddressType,MapToHstoreType,MapToJsonType,MediumIntType,MicroTimestampType,MicroTimestampType,MicroTimeType,MicroTimeType,MoneyType,NanoTimestampType,NanoTimestampType,NanoTimeType,NanoTimeType,NumberType,OidType,PointType,PointType,RangeType,SerialType,SetType,TimestampType,TimestampType,TimeType,TimeType,TimeWithTimezoneType,TinyIntType,UuidType,VariableScaleDecimalType,XmlType,XmlType,YearType,ZonedTimestampType,ZonedTimestampType,ZonedTimestampType,ZonedTimestampType,ZonedTimeType,ZonedTimeType,ZonedTimeType,ZonedTimeType,ZonedTimeType
public interface Type
A type represents a relational column type used for query abd parameter binding.
todo: this is heavily modeled after Hibernate's type system which perhaps could be used instead?
todo: is it possible to incorporate default value resolution into the type system?
- Author:
- Chris Cranford
-
Method Summary
Modifier and TypeMethodDescriptionBinds the value to the query.voidconfigure(JdbcSinkConnectorConfig config, DatabaseDialect dialect) Allows a type to perform initialization/configuration tasks based on user configs.getDefaultValueBinding(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, Object value) Resolve the default value clause value.getQueryBinding(ColumnDescriptor column, org.apache.kafka.connect.data.Schema schema, Object value) Return the SQL string to be used in DML statements for binding this type to SQL.String[]Returns the names that this type will be mapped as.getTypeName(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, boolean key) Return the SQL type name for this type.
-
Method Details
-
configure
Allows a type to perform initialization/configuration tasks based on user configs.- Parameters:
config- the JDBC sink connector's configuration, should not benulldialect- the database dialect, should not benull
-
getRegistrationKeys
String[] getRegistrationKeys()Returns the names that this type will be mapped as.For example, when creating a custom mapping for
io.debezium.data.Bits, a type could be registered using theLOGICAL_NAMEof the schema if the type is to be used when a schema name is identified; otherwise it could be registered as the raw column type when column type propagation is enabled. -
getTypeName
String getTypeName(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, boolean key) Return the SQL type name for this type.- Parameters:
dialect- dialect instance, nevernullschema- field schema, nevernullkey- whether the type resolution is for a key field- Returns:
- the resolved type to be used in DDL statements
-
getQueryBinding
String getQueryBinding(ColumnDescriptor column, org.apache.kafka.connect.data.Schema schema, Object value) Return the SQL string to be used in DML statements for binding this type to SQL.- Parameters:
column- column descriptor in the table relational model, nevernullschema- field schema, nevernullvalue- value to be bound, may benull- Returns:
- query parameter argument binding SQL fragment
-
getDefaultValueBinding
String getDefaultValueBinding(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, Object value) Resolve the default value clause value.- Parameters:
dialect- dialect instance, nevernullschema- field schema, nevernullvalue- the default value, should not benull- Returns:
- the formatted default value for the SQL statement as a string
-
bind
List<ValueBindDescriptor> bind(int index, org.apache.kafka.connect.data.Schema schema, Object value) Binds the value to the query.- Parameters:
index- parameter index to bindschema- field schema, nevernullvalue- value to be bound, may benull- Returns:
- the list of
ValueBindDescriptor
-