The rule module defines two classes, Rule and RuleDict, derived from DbSchemaObject and DbObjectDict, respectively.
Rule is derived from DbSchemaObject and represents a PostgreSQL rewrite rule.
A rewrite rule definition
Return a full identifier for a rule object
Returns: | string |
---|
Convert rule to a YAML-suitable format
Returns: | dictionary |
---|
Return SQL statements to CREATE the rule
Returns: | SQL statements |
---|
RuleDict is derived from DbObjectDict. It is a dictionary that represents the collection of rewrite rules in a database.
The collection of rewrite rules in a database.
Initialize the dictionary of rules by examining the input map
Parameters: | inmap – the input YAML map defining the rules |
---|
Generate SQL to transform existing rules
Parameters: | input_map – a YAML map defining the new rules |
---|---|
Returns: | list of SQL statements |
Compares the existing rule definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the rules accordingly.