Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

106 lines (71 sloc) 2.516 kb

Types and Domains

The :mod:`dbtype` module defines six classes, :class:`DbType` derived from :class:`DbSchemaObject`, :class:`BaseType`, :class:`Composite`, :class:`Enum` and :class:`Domain` derived from :class:`DbType`, and :class:`TypeDict` derived from and :class:`DbObjectDict`.

Database Type

Class :class:`DbType` is derived from :class:`~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

:class:`BaseType` is derived from :class:`~pyrseas.dbobject.DbType` and represents a PostgreSQL user-defined base type.

The map returned by :meth:`to_map` and expected as argument by :meth:`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

:class:`Composite` is derived from :class:`~pyrseas.dbobject.DbType` and represents a standalone composite type.

Enum

:class:`Enum` is derived from :class:`~pyrseas.dbobject.DbType` and represents an enumerated type.

Domain

:class:`Domain` is derived from :class:`~pyrseas.dbobject.DbType` and represents a domain.

Type Dictionary

:class:`TypeDict` is derived from :class:`~pyrseas.dbobject.DbObjectDict`. It is a dictionary that represents the collection of domains and enums in a database.

Jump to Line
Something went wrong with that request. Please try again.