Package io.debezium.connector.postgresql
Class TypeRegistry
java.lang.Object
io.debezium.connector.postgresql.TypeRegistry
A registry of types supported by a PostgreSQL instance. Allows lookup of the types according to
type name or OID.
- Author:
- Jiri Pechanec
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classAllows to obtain the SQL type corresponding to PG types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate intprivate intprivate final PostgresConnectionstatic final intprivate intprivate intprivate intprivate intprivate intprivate intprivate intprivate static final org.slf4j.Loggerprivate intprivate intprivate final Map<String, PostgresType> static final intprivate final Map<Integer, PostgresType> private static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate final TypeRegistry.SqlTypeMapperstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddType(PostgresType type) intintprivate PostgresType.Builderintintintintget(int oid) private static org.postgresql.core.TypeInfogetTypeInfo(PostgresConnection connection) intintintisbn()intisbnOid()private PostgresTypeloadType(PreparedStatement statement) intintltreeOid()static StringnormalizeTypeName(String typeName) Converts a type name in long (readable) format likebooleanto s standard data type name likebool.private voidprime()Prime theTypeRegistrywith all existing database typesprivate PostgresTyperesolveUnknownType(int lookupOid) private PostgresTyperesolveUnknownType(String name)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TYPE_NAME_GEOGRAPHY
- See Also:
-
TYPE_NAME_GEOMETRY
- See Also:
-
TYPE_NAME_CITEXT
- See Also:
-
TYPE_NAME_HSTORE
- See Also:
-
TYPE_NAME_LTREE
- See Also:
-
TYPE_NAME_ISBN
- See Also:
-
TYPE_NAME_HSTORE_ARRAY
- See Also:
-
TYPE_NAME_GEOGRAPHY_ARRAY
- See Also:
-
TYPE_NAME_GEOMETRY_ARRAY
- See Also:
-
TYPE_NAME_CITEXT_ARRAY
- See Also:
-
TYPE_NAME_LTREE_ARRAY
- See Also:
-
NO_TYPE_MODIFIER
public static final int NO_TYPE_MODIFIER- See Also:
-
UNKNOWN_LENGTH
public static final int UNKNOWN_LENGTH- See Also:
-
DOMAIN_TYPE
public static final int DOMAIN_TYPE- See Also:
-
CATEGORY_ARRAY
- See Also:
-
CATEGORY_ENUM
- See Also:
-
SQL_ENUM_VALUES
- See Also:
-
SQL_TYPES
- See Also:
-
SQL_NAME_LOOKUP
- See Also:
-
SQL_OID_LOOKUP
- See Also:
-
LONG_TYPE_NAMES
-
nameToType
-
oidToType
-
connection
-
sqlTypeMapper
-
geometryOid
private int geometryOid -
geographyOid
private int geographyOid -
citextOid
private int citextOid -
hstoreOid
private int hstoreOid -
ltreeOid
private int ltreeOid -
isbnOid
private int isbnOid -
hstoreArrayOid
private int hstoreArrayOid -
geometryArrayOid
private int geometryArrayOid -
geographyArrayOid
private int geographyArrayOid -
citextArrayOid
private int citextArrayOid -
ltreeArrayOid
private int ltreeArrayOid
-
-
Constructor Details
-
TypeRegistry
-
-
Method Details
-
getLongTypeNames
-
addType
-
get
- Parameters:
oid- - PostgreSQL OID- Returns:
- type associated with the given OID
-
get
- Parameters:
name- - PostgreSQL type name- Returns:
- type associated with the given type name
-
getRegisteredTypes
-
geometryOid
public int geometryOid()- Returns:
- OID for
GEOMETRYtype of this PostgreSQL instance
-
geographyOid
public int geographyOid()- Returns:
- OID for
GEOGRAPHYtype of this PostgreSQL instance
-
citextOid
public int citextOid()- Returns:
- OID for
CITEXTtype of this PostgreSQL instance
-
hstoreOid
public int hstoreOid()- Returns:
- OID for
HSTOREtype of this PostgreSQL instance
-
ltreeOid
public int ltreeOid()- Returns:
- OID for
LTREEtype of this PostgreSQL instance
-
isbnOid
public int isbnOid()- Returns:
- OID for
ISBNtype of this PostgreSQL instance
-
hstoreArrayOid
public int hstoreArrayOid()- Returns:
- OID for array of
HSTOREtype of this PostgreSQL instance
-
geometryArrayOid
public int geometryArrayOid()- Returns:
- OID for array of
GEOMETRYtype of this PostgreSQL instance
-
geographyArrayOid
public int geographyArrayOid()- Returns:
- OID for array of
GEOGRAPHYtype of this PostgreSQL instance
-
citextArrayOid
public int citextArrayOid()- Returns:
- OID for array of
CITEXTtype of this PostgreSQL instance
-
ltreeArrayOid
public int ltreeArrayOid()- Returns:
- OID for array of
LTREEtype of this PostgreSQL instance
-
normalizeTypeName
Converts a type name in long (readable) format likebooleanto s standard data type name likebool.- Parameters:
typeName- - a type name in long format- Returns:
- - the type name in standardized format
-
prime
Prime theTypeRegistrywith all existing database types- Throws:
SQLException
-
createTypeBuilderFromResultSet
- Throws:
SQLException
-
resolveUnknownType
-
resolveUnknownType
-
loadType
- Throws:
SQLException
-
isbn
public int isbn() -
getTypeInfo
private static org.postgresql.core.TypeInfo getTypeInfo(PostgresConnection connection) throws SQLException - Throws:
SQLException
-