Augmenter Databases¶
The augmentdb
module defines the class AugmentDatabase
.
Augmenter Database¶
An AugmentDatabase
is derived from
Database
. It contains two “dictionary”
objects.
One is the Dicts
container from its parent class. The db
Dicts object, defines the database schemas, including their tables and
other objects, by querying the system catalogs.
The second container is an AugDicts
object. The adb
AugDicts object specifies the schemas to be augmented and the
augmenter configuration objects. The latter objects may be supplied
either by other Augmenter modules or from the augmenter
configuration tree on the aug_map supplied to the apply()
method.
-
class
pyrseas.augmentdb.
AugmentDatabase
(config)¶ A database that is to be augmented
-
AugmentDatabase.
apply
(aug_map)¶ Apply augmentations to an existing database
Parameters: aug_map – a YAML map defining the desired augmentations Merges an existing database definition, as fetched from the catalogs, with an input YAML defining augmentations on various objects and an optional configuration map or the predefined configuration.
-
AugmentDatabase.
from_augmap
(aug_map)¶ Populate the augment objects from the input augment map
Parameters: aug_map – a YAML map defining the desired augmentations The adb holder is populated by various DbAugmentDict-derived classes by traversing the YAML augmentation map. The objects in the dictionary are then linked to related objects, e.g., tables are linked to the schemas they belong.