module: pyrseas.dbobject.schema

The schema module defines two classes, Schema and SchemaDict, derived from DbObject and DbObjectDict, respectively.


Schema is derived from ~pyrseas.dbobject.DbObject and represents a database schema or Postgres namespace, i.e., a collection of tables and other objects. The 'public' schema is currently treated specially as in most contexts an unqualified object is assumed to be part of it, e.g., table "t" is usually shorthand for table "public.t." The 'pyrseas' schema, if present, is excluded as it is only intended for use by dbaugment or other Pyrseas internal purposes.

autoclass: Schema

automethod: Schema.extern_dir

automethod: Schema.to_map

automethod: Schema.create

automethod: Schema.drop

automethod: Schema.data_import

Schema Dictionary

SchemaDict is derived from ~pyrseas.dbobject.DbObjectDict. It is a dictionary that represents the collection of schemas in a database. Certain internal schemas (information_schema, pg_catalog, etc.) owned by the 'postgres' user are excluded.

autoclass: SchemaDict

Method from_map is called from Database ~pyrseas.database.Database.from_map to start a recursive interpretation of the input map. The inmap argument is the same as input to the ~pyrseas.database.Database.diff_map method of Database. The newdb argument is the holder of ~pyrseas.dbobject.DbObjectDict-derived dictionaries which is filled in as the recursive interpretation proceeds.

automethod: SchemaDict.from_map

automethod: SchemaDict.to_map

automethod: SchemaDict.data_import