Package io.debezium.connector.postgresql
Class TypeRegistry.SqlTypeMapper
java.lang.Object
io.debezium.connector.postgresql.TypeRegistry.SqlTypeMapper
- Enclosing class:
- TypeRegistry
Allows to obtain the SQL type corresponding to PG types. This uses a custom statement instead of going through
PgDatabaseMetaData.getTypeInfo() as the latter causes N+1 SELECTs, making it very slow on installations
with many custom types.- Author:
- Gunnar Morling
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PostgresConnectionprivate static final StringBased on org.postgresql.jdbc.TypeInfoCache.getSQLType(String). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetSqlType(String typeName) getSqlTypes(PostgresConnection connection) Builds up a map of SQL (JDBC) types by PG type name; contains only values for non-core types.
-
Field Details
-
SQL_TYPE_DETAILS
Based on org.postgresql.jdbc.TypeInfoCache.getSQLType(String). To emulate the original statement's behavior (which works for single types only), PG's DISTINCT ON extension is used to just return the first entry should a type exist in multiple schemas.- See Also:
-
connection
-
preloadedSqlTypes
-
sqlTypesByPgTypeNames
-
-
Constructor Details
-
SqlTypeMapper
- Throws:
SQLException
-
-
Method Details
-
getSqlType
- Throws:
SQLException
-
getSqlTypes
Builds up a map of SQL (JDBC) types by PG type name; contains only values for non-core types.- Throws:
SQLException
-