Extensions

The extension module defines two classes, Extension and ExtensionDict, derived from DbObject and DbObjectDict, respectively.

Extension

Extension is derived from DbObject and represents a PostgreSQL extension.

class pyrseas.dbobject.extension.Extension(name, description, owner, schema, privileges=None, version=None)

An extension

Extension.create(obj, *args, **kwargs)

Return SQL statements to CREATE the extension

Returns:SQL statements

Extension Dictionary

ExtensionDict is derived from DbObjectDict. It is a dictionary that represents the collection of extensions in a database.

class pyrseas.dbobject.extension.ExtensionDict(dbconn=None)

The collection of extensions in a database

ExtensionDict.from_map(inexts, langtempls, newdb)

Initalize the dictionary of extensions by converting the input map

Parameters:
  • inexts – YAML map defining the extensions
  • langtempls – list of language templates
  • newdb – dictionary of input database
ExtensionDict.diff_map(inexts)

Generate SQL to transform existing extensions

Parameters:inexts – a YAML map defining the new extensions
Returns:list of SQL statements

Compares the existing extension definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the extensions accordingly.