The cast module defines two classes, Cast and CastDict, derived from DbObject and DbObjectDict, respectively.
Cast is derived from DbObject and represents a PostgreSQL cast.
A cast
Return the key to be used in external maps for this cast
| Returns: | string |
|---|
Return a full identifier for a cast object
| Returns: | string |
|---|
Convert a cast to a YAML-suitable format
| Returns: | dictionary |
|---|
Return SQL statements to CREATE the cast
| Returns: | SQL statements |
|---|
Generate SQL to transform an existing object
| Parameters: |
|
|---|---|
| Returns: | list of SQL statements |
Compares the object to an input object and generates SQL statements to transform it into the one represented by the input. This base implementation simply deals with owners and comments.
CastDict is derived from DbObjectDict. It is a dictionary that represents the collection of casts in a database.
The collection of casts in a database
Initalize the dictionary of casts by converting the input map
| Parameters: |
|
|---|
Generate SQL to transform existing casts
| Parameters: | incasts – a YAML map defining the new casts |
|---|---|
| Returns: | list of SQL statements |
Compares the existing cast definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the casts accordingly.