The index module defines two classes, Index and IndexDict, derived from DbSchemaObject and DbObjectDict, respectively.
Class Index is derived from DbSchemaObject and represents an index on a database table, other than a primary key or unique constraint index. Its keylist attributes are the schema name, the table name and the index name.
An Index has the following attributes: access_method, unique, and keycols.
A physical index definition, other than a primary key or unique constraint index.
Return comma-separated list of key column names and qualifiers
Returns: | string |
---|
Convert an index definition to a YAML-suitable format
Returns: | dictionary |
---|
Return a SQL statement to CREATE the index
Returns: | SQL statements |
---|
Generate SQL to transform an existing index
Parameters: | inindex – a YAML map defining the new index |
---|---|
Returns: | list of SQL statements |
Compares the index to an input index and generates SQL statements to transform it into the one represented by the input.
Class IndexDict is derived from DbObjectDict and represents the collection of indexes in a database.
The collection of indexes on tables in a database
Initialize the dictionary of indexes by converting the input map
Parameters: |
|
---|
Generate SQL to transform existing indexes
Parameters: | inindexes – a YAML map defining the new indexes |
---|---|
Returns: | list of SQL statements |
Compares the existing index definitions, as fetched from the catalogs, to the input map and generates SQL statements to transform the indexes accordingly.