Types and Domains
The dbtype module defines six classes, DbType derived from DbSchemaObject, BaseType, Composite, Enum and Domain derived from DbType, and TypeDict derived from and DbObjectDict.
Database Type
Class DbType is derived from ~pyrseas.dbobject.DbSchemaObject and represents a SQL type or domain as defined in the PostgreSQL pg_type catalog. Note: Only enumerated types are implemented currently.
Base Type
BaseType is derived from ~pyrseas.dbobject.DbType and represents a PostgreSQL user-defined base type.
The map returned by to_map and expected as argument by diff_map has the following structure (not all fields need be present):
{'type t1': {'alignment': 'double', 'analyze': 'analyze_func', 'input': 'input_func', 'internallength': 'variable', 'output': 'output_func', 'receive': 'receive_func', 'send': 'send_func', 'storage': 'plain' 'typmod_in': 'typmod_in_func', 'typmod_out': 'typmod_out_func' } }
Composite
Composite is derived from ~pyrseas.dbobject.DbType and represents a standalone composite type.
Enum
Enum is derived from ~pyrseas.dbobject.DbType and represents an enumerated type.
Domain
Domain is derived from ~pyrseas.dbobject.DbType and represents a domain.
Type Dictionary
TypeDict is derived from ~pyrseas.dbobject.DbObjectDict. It is a dictionary that represents the collection of domains and enums in a database.