The function module defines four classes: class Proc derived from DbSchemaObject, classes Function and Aggregate derived from Proc, and class ProcDict derived from DbObject.
Class Proc is derived from DbSchemaObject and represents a regular or aggregate function.
A procedure such as a FUNCTION or an AGGREGATE
Return the key to be used in external maps for this function
| Returns: | string |
|---|
Return a full identifier for a function object
| Returns: | string |
|---|
Function is derived from Proc and represents a PostgreSQL user-defined function.
A procedural language function
Convert a function to a YAML-suitable format
| Parameters: |
|
|---|---|
| Returns: | dictionary |
Return SQL statements to CREATE or REPLACE the function
| Parameters: | newsrc – new source for a changed function |
|---|---|
| Returns: | SQL statements |
Generate SQL to transform an existing function
| Parameters: | infunction – a YAML map defining the new function |
|---|---|
| Returns: | list of SQL statements |
Compares the function to an input function and generates SQL statements to transform it into the one represented by the input.
Aggregate is derived from Proc and represents a PostgreSQL user-defined aggregate function.
An aggregate function
Convert an agggregate to a YAML-suitable format
| Parameters: |
|
|---|---|
| Returns: | dictionary |
Return SQL statements to CREATE the aggregate
| Returns: | SQL statements |
|---|
ProcDict is derived from DbObjectDict. It is a dictionary that represents the collection of regular and aggregate functions in a database.
The collection of regular and aggregate functions in a database
Initalize the dictionary of functions by converting the input map
| Parameters: |
|
|---|
Generate SQL to transform existing functions
| Parameters: | infuncs – a YAML map defining the new functions |
|---|---|
| Returns: | list of SQL statements |
Compares the existing function definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the functions accordingly.