Module Expr Str ImportFrom alias alias ImportFrom alias alias alias Assign NameStore Dict Str Str Str Str Str Str Str Str ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Str Str FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Str attr ListComp Call NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Str If Call NameLoad NameLoad Str body Assign NameStore BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr UnaryOpNot Call NameLoad NameLoad Str UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Return BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr Return ListLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMod Str TupleLoad Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareIn Str NameLoad body Delete SubscriptDel NameLoad Index Str If CompareIn Str NameLoad body Delete SubscriptDel NameLoad Index Str If NameLoad body Assign SubscriptStore NameLoad Index Str ListComp SubscriptLoad NameLoad Index BinOpSub NameLoad Num comprehension NameStore AttributeLoad NameLoad attr Delete SubscriptDel NameLoad Index Str Return Dict AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListLoad BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareEq SubscriptLoad NameLoad Index Str Str body Delete SubscriptDel NameLoad Index Str Delete SubscriptDel NameLoad Index Str Assign SubscriptStore NameLoad Index Str ListComp SubscriptLoad NameLoad Index BinOpSub NameLoad Num comprehension NameStore AttributeLoad NameLoad attr Delete SubscriptDel NameLoad Index Str Return Dict AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body If UnaryOpNot Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Delete SubscriptDel NameLoad Index Str Assign SubscriptStore NameLoad Index Str ListComp SubscriptLoad NameLoad Index BinOpSub NameLoad Num comprehension NameStore AttributeLoad NameLoad attr Delete SubscriptDel NameLoad Index Str Assign NameStore BoolOpOr BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListComp SubscriptLoad NameLoad Index BinOpSub NameLoad Num comprehension NameStore AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Dict Str Str SubscriptLoad NameLoad Index Str NameLoad If CompareIn Str NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr keyword NameLoad Delete SubscriptDel NameLoad Index Str Delete SubscriptDel NameLoad Index Str SubscriptDel NameLoad Index Str Return Dict AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str If Call NameLoad NameLoad Str body Assign NameStore BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Str If Call NameLoad NameLoad Str body Assign NameStore BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr If Call NameLoad NameLoad Str body AugAssignAdd NameStore BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr If Call NameLoad NameLoad Str NameLoad body AugAssignAdd NameStore Str If Call NameLoad NameLoad Str NameLoad body AugAssignAdd NameStore Str Return BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore BoolOpOr CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore ListLoad Str Str body Assign NameStore IfExp Call NameLoad NameLoad NameLoad Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign NameStore IfExp Call NameLoad NameLoad NameLoad Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad If CompareNotEq NameLoad NameLoad body Assign NameStore NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareEq SubscriptLoad NameLoad Index Str Str body Delete SubscriptDel NameLoad Index Str Delete SubscriptDel NameLoad Index Str Assign SubscriptStore NameLoad Index Str ListLoad Assign SubscriptStore NameLoad Index Str ListComp SubscriptLoad NameLoad Index BinOpSub NameLoad Num comprehension NameStore AttributeLoad NameLoad attr Delete SubscriptDel NameLoad Index Str Return Dict AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body If UnaryOpNot Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list Assign NameStore Dict Str Str Str Str Str Str Assign NameStore ListLoad Str Str Str Str ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Expr Str If CompareLt AttributeLoad AttributeLoad NameLoad attr attr Num body Assign AttributeStore NameLoad attr NameLoad For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Delete AttributeDel NameLoad attr If CompareNotEq NameLoad Str body Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body If CompareEq AttributeLoad NameLoad attr Str body Delete AttributeDel NameLoad attr orelse Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Delete AttributeDel NameLoad attr orelse Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index AttributeLoad NameLoad attr If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Str body Delete AttributeDel NameLoad attr orelse Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore ListComp SubscriptLoad Call NameLoad Call AttributeLoad NameLoad attr Index Num comprehension NameStore NameLoad Return ListComp BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num comprehension NameStore NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad body Expr Str If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str For NameStore NameLoad body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr TupleLoad BinOpMod Str NameLoad Raise If BoolOpAnd CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Num If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str If NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Index Num Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index NameLoad TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr TupleLoad BinOpMod Str NameLoad Raise For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr body If CompareIn NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str For NameStore NameLoad body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareNotIn Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareNotIn Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareNotIn Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr TupleLoad BinOpMod Str NameLoad Raise TryExcept body Assign NameStore SubscriptLoad NameLoad Index Str handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr TupleLoad BinOpMod Str NameLoad Raise TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr TupleLoad BinOpMod Str NameLoad Raise TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign NameStore BinOpAdd Str AttributeLoad NameLoad attr If BoolOpAnd NameLoad CompareIn NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr TupleLoad BinOpMod Str NameLoad Raise Assign NameStore AttributeLoad NameLoad attr If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str For NameStore NameLoad body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr TupleLoad BinOpMod Str NameLoad Raise For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr body If CompareIn NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore TupleLoad Num Num body For TupleStore NameStore NameStore NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad If Call NameLoad NameLoad Str NameLoad body Continue If Call NameLoad NameLoad NameLoad body If CompareEq NameLoad Num body Continue orelse If CompareEq NameLoad Num body Continue If BoolOpAnd CompareNotIn TupleLoad NameLoad NameLoad NameLoad NameLoad UnaryOpNot Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad If Call NameLoad NameLoad Str NameLoad body Continue If Call NameLoad NameLoad Str body Continue If Call NameLoad NameLoad NameLoad body If CompareEq NameLoad Num body Continue orelse If CompareEq NameLoad Num body Continue If CompareNotIn TupleLoad NameLoad NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list
N/A N/A 
    pyrseas.constraint
    ~~~~~~~~~~~~~~~~~~

    This module defines six classes: Constraint derived from
    DbSchemaObject, CheckConstraint, PrimaryKey, ForeignKey and
    UniqueConstraint derived from Constraint, and ConstraintDict
    derived from DbObjectDict.
 pyrseas.dbobject DbObjectDict DbSchemaObject pyrseas.dbobject quote_id split_schema_obj commentable N/A ACTIONS N/A r c n d restrict cascade set null set default Constraint N/A DbSchemaObject N/A N/A A constraint definition, such as a primary key, foreign key or
       unique constraint N/A keylist N/A schema table name key_columns N/A N/A self N/A N/A N/A Return comma-separated list of key column names

        :return: string
         N/A N/A N/A ,  join N/A N/A quote_id col N/A col N/A self col_names N/A add N/A N/A self N/A N/A N/A Return string to add the constraint via ALTER TABLE

        :return: SQL statement

        Works as is for primary keys and unique constraints but has
        to be overridden for check constraints and foreign keys.
         N/A stmts N/A N/A tblspc N/A N/A hasattr self tablespace N/A N/A tblspc N/A  USING INDEX TABLESPACE %s N/A self tablespace N/A N/A N/A stmts append N/A ALTER TABLE %s ADD CONSTRAINT %s %s (%s)%s N/A N/A N/A N/A self _table qualname N/A quote_id N/A self name N/A self objtype N/A N/A self key_columns tblspc N/A N/A N/A hasattr self cluster N/A self cluster N/A N/A N/A N/A stmts append N/A CLUSTER %s USING %s N/A N/A N/A N/A self _table qualname N/A quote_id N/A self name N/A stmts N/A commentable drop N/A N/A self N/A N/A N/A Return string to drop the constraint via ALTER TABLE

        :return: SQL statement
         N/A N/A N/A N/A hasattr self dropped N/A N/A self dropped N/A N/A N/A self dropped True N/A N/A ALTER TABLE %s DROP CONSTRAINT %s N/A N/A N/A N/A self _table qualname N/A quote_id N/A self name N/A N/A N/A comment N/A N/A self N/A N/A N/A Return SQL statement to create COMMENT on constraint

        :return: SQL statement
         N/A N/A COMMENT ON CONSTRAINT %s ON %s IS %s N/A N/A quote_id N/A self name N/A N/A N/A self _table qualname N/A N/A self _comment_text N/A N/A CheckConstraint N/A Constraint N/A N/A A check constraint definition N/A objtype CHECK to_map N/A N/A self dbcols N/A N/A N/A Convert a check constraint definition to a YAML-suitable format

        :param dbcols: dictionary of dbobject columns
        :return: dictionary
         N/A dct N/A N/A self _base_map N/A N/A _table dct N/A N/A N/A dct N/A _table N/A N/A target dct N/A N/A N/A dct N/A target N/A dbcols N/A N/A N/A dct N/A columns N/A N/A dbcols N/A N/A k 1 N/A k N/A self col_idx N/A N/A dct N/A col_idx N/A N/A N/A self name dct N/A add N/A N/A self N/A N/A N/A Return string to add the CHECK constraint via ALTER TABLE

        :return: SQL statement
         N/A N/A N/A ALTER TABLE %s ADD CONSTRAINT %s %s (%s) N/A N/A N/A N/A self _table qualname N/A quote_id N/A self name N/A self objtype N/A self expression N/A commentable diff_map N/A N/A self inchk N/A N/A N/A Generate SQL to transform an existing CHECK constraint

        :param inchk: a YAML map defining the new CHECK constraint
        :return: list of SQL statements

        Compares the CHECK constraint to an input constraint and generates
        SQL statements to transform it into the one represented by the
        input.
         N/A stmts N/A N/A N/A N/A stmts append N/A N/A self diff_description inchk N/A stmts N/A N/A PrimaryKey N/A Constraint N/A N/A A primary key constraint definition N/A objtype PRIMARY KEY to_map N/A N/A self dbcols N/A N/A N/A Convert a primary key definition to a YAML-suitable format

        :param dbcols: dictionary of dbobject columns
        :return: dictionary
         N/A dct N/A N/A self _base_map N/A N/A N/A dct N/A access_method btree N/A N/A N/A dct N/A access_method N/A N/A dct N/A _table N/A N/A dct N/A columns N/A N/A dbcols N/A N/A k 1 N/A k N/A self col_idx N/A N/A dct N/A col_idx N/A N/A N/A self name dct N/A diff_map N/A N/A self inpk N/A N/A N/A Generate SQL to transform an existing primary key

        :param inpk: a YAML map defining the new primary key
        :return: list of SQL statements

        Compares the primary key to an input primary key and generates
        SQL statements to transform it into the one represented by the
        input.
         N/A stmts N/A N/A N/A N/A self col_idx N/A inpk col_idx N/A N/A N/A N/A stmts append N/A N/A self drop N/A N/A N/A stmts append N/A N/A inpk add N/A N/A N/A hasattr inpk cluster N/A N/A N/A N/A hasattr self cluster N/A N/A N/A N/A stmts append N/A CLUSTER %s USING %s N/A N/A N/A N/A self _table qualname N/A quote_id N/A self name N/A N/A N/A hasattr self cluster N/A N/A N/A N/A stmts append N/A ALTER TABLE %s
    SET WITHOUT CLUSTER N/A N/A N/A self _table qualname N/A N/A N/A stmts append N/A N/A self diff_description inpk N/A stmts N/A N/A ForeignKey N/A Constraint N/A N/A A foreign key constraint definition N/A objtype FOREIGN KEY ref_columns N/A N/A self N/A N/A N/A Return comma-separated list of reference column names

        :return: string
         N/A N/A N/A ,  join N/A self ref_col_names N/A to_map N/A N/A self dbcols refcols N/A N/A N/A Convert a foreign key definition to a YAML-suitable format

        :param dbcols: dictionary of dbobject columns
        :return: dictionary
         N/A dct N/A N/A self _base_map N/A N/A dct N/A _table N/A N/A dct N/A columns N/A N/A dbcols N/A N/A k 1 N/A k N/A self col_idx N/A N/A dct N/A col_idx N/A refsch N/A N/A N/A hasattr self ref_schema N/A self ref_schema N/A self schema N/A ref_col_names N/A N/A refcols N/A N/A k 1 N/A k N/A self ref_col_idxs N/A N/A dct N/A references N/A table columns N/A dct N/A ref_table ref_col_names N/A N/A ref_schema dct N/A N/A N/A N/A N/A dct N/A references update schema refsch N/A N/A dct N/A ref_schema N/A N/A dct N/A ref_table N/A dct N/A ref_col_idxs N/A N/A N/A self name dct N/A add N/A N/A self N/A N/A N/A Return string to add the foreign key via ALTER TABLE

        :return: SQL statement
         N/A match N/A N/A hasattr self match N/A N/A match N/A  MATCH %s N/A N/A N/A self match upper N/A actions N/A N/A hasattr self on_update N/A N/A actions N/A  ON UPDATE %s N/A N/A N/A self on_update upper N/A N/A hasattr self on_delete N/A N/A actions N/A  ON DELETE %s N/A N/A N/A self on_delete upper N/A N/A getattr self deferrable False N/A N/A actions  DEFERRABLE N/A N/A getattr self deferred False N/A N/A actions  INITIALLY DEFERRED N/A N/A ALTER TABLE %s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s (%s)%s%s N/A N/A N/A N/A self _table qualname N/A quote_id N/A self name N/A N/A self key_columns N/A N/A N/A self references qualname N/A N/A self ref_columns match actions N/A commentable diff_map N/A N/A self infk N/A N/A N/A Generate SQL to transform an existing foreign key

        :param infk: a YAML map defining the new foreign key
        :return: list of SQL statements

        Compares the foreign key to an input foreign key and generates
        SQL statements to transform it into the one represented by the
        input.
         N/A stmts N/A N/A changed N/A N/A N/A self col_idx N/A infk col_idx N/A N/A self ref_col_idxs N/A infk ref_col_idxs N/A act N/A on_update on_delete N/A N/A s_act N/A N/A hasattr self act N/A N/A N/A getattr self act upper None N/A in_act N/A N/A hasattr infk act N/A N/A N/A getattr infk act upper None N/A N/A s_act in_act N/A N/A changed True N/A changed N/A N/A N/A N/A stmts append N/A N/A self drop N/A N/A N/A stmts append N/A N/A infk add N/A N/A N/A stmts append N/A N/A self diff_description infk N/A stmts N/A N/A UniqueConstraint N/A Constraint N/A N/A A unique constraint definition N/A objtype UNIQUE to_map N/A N/A self dbcols N/A N/A N/A Convert a unique constraint definition to a YAML-suitable format

        :param dbcols: dictionary of dbobject columns
        :return: dictionary
         N/A dct N/A N/A self _base_map N/A N/A N/A dct N/A access_method btree N/A N/A N/A dct N/A access_method N/A N/A dct N/A _table N/A N/A dct N/A columns N/A N/A N/A dct N/A columns N/A N/A dbcols N/A N/A k 1 N/A k N/A self col_idx N/A N/A dct N/A col_idx N/A N/A N/A self name dct N/A diff_map N/A N/A self inuc N/A N/A N/A Generate SQL to transform an existing unique constraint

        :param inuc: a YAML map defining the new unique constraint
        :return: list of SQL statements

        Compares the unique constraint to an input unique constraint
        and generates SQL statements to transform it into the one
        represented by the input.
         N/A stmts N/A N/A N/A N/A self col_idx N/A inuc col_idx N/A N/A N/A N/A stmts append N/A N/A self drop N/A N/A N/A stmts append N/A N/A inuc add N/A N/A N/A hasattr inuc cluster N/A N/A N/A N/A hasattr self cluster N/A N/A N/A N/A stmts append N/A CLUSTER %s USING %s N/A N/A N/A N/A self _table qualname N/A quote_id N/A self name N/A N/A N/A hasattr self cluster N/A N/A N/A N/A stmts append N/A ALTER TABLE %s
    SET WITHOUT CLUSTER N/A N/A N/A self _table qualname N/A N/A N/A stmts append N/A N/A self diff_description inuc N/A stmts N/A N/A N/A MATCHTYPES_PRE93 N/A f p u full partial simple N/A COMMON_ATTRS N/A access_method tablespace description cluster ConstraintDict N/A DbObjectDict N/A N/A The collection of table or column constraints in a database N/A cls Constraint N/A query SELECT nspname AS schema,
                  CASE WHEN contypid = 0 THEN conrelid::regclass::text
                       ELSE contypid::regtype::text END AS table,
                  conname AS name,
                  CASE WHEN contypid != 0 THEN 'd' ELSE '' END AS target,
                  contype AS type, conkey AS col_idx,
                  condeferrable AS deferrable, condeferred AS deferred,
                  confrelid::regclass AS ref_table, confkey AS ref_col_idxs,
                  consrc AS expression, confupdtype AS on_update,
                  confdeltype AS on_delete, confmatchtype AS match,
                  amname AS access_method, spcname AS tablespace,
                  indisclustered AS cluster, coninhcount > 0 AS inherited,
                  obj_description(c.oid, 'pg_constraint') AS description
           FROM pg_constraint c
                JOIN pg_namespace ON (connamespace = pg_namespace.oid)
                LEFT JOIN pg_class cl on (conname = relname)
                LEFT JOIN pg_index i ON (i.indexrelid = cl.oid)
                LEFT JOIN pg_tablespace t ON (cl.reltablespace = t.oid)
                LEFT JOIN pg_am on (relam = pg_am.oid)
           WHERE (nspname != 'pg_catalog' AND nspname != 'information_schema')
           ORDER BY schema, 2, name N/A match_types N/A f p s full partial simple _from_catalog N/A N/A self N/A N/A N/A Initialize the dictionary of constraints by querying the catalogs N/A N/A N/A N/A self dbconn version 90300 N/A N/A N/A self match_types MATCHTYPES_PRE93 N/A constr N/A N/A self fetch N/A N/A N/A N/A constr unqualify N/A N/A sch tbl cns N/A N/A constr key N/A N/A sch tbl N/A split_schema_obj N/A %s.%s N/A sch tbl N/A constr_type N/A constr type N/A N/A constr type N/A N/A constr_type f N/A N/A N/A constr ref_table N/A N/A constr on_update N/A N/A constr on_delete N/A N/A constr match N/A N/A constr_type c N/A N/A N/A self N/A N/A sch tbl cns N/A CheckConstraint N/A constr __dict__ N/A N/A N/A constr_type p N/A N/A N/A self N/A N/A sch tbl cns N/A PrimaryKey N/A constr __dict__ N/A N/A N/A constr_type f N/A N/A N/A N/A constr on_update a N/A N/A N/A constr on_update N/A N/A N/A constr on_update N/A ACTIONS N/A N/A constr on_update N/A N/A N/A constr on_delete a N/A N/A N/A constr on_delete N/A N/A N/A constr on_delete N/A ACTIONS N/A N/A constr on_delete N/A N/A N/A N/A self match_types N/A N/A constr match simple N/A N/A N/A constr match N/A N/A N/A constr match N/A N/A self match_types N/A N/A constr match N/A reftbl N/A constr ref_table N/A N/A N/A constr ref_schema N/A constr ref_table N/A split_schema_obj reftbl N/A N/A self N/A N/A sch tbl cns N/A ForeignKey N/A constr __dict__ N/A N/A N/A constr_type u N/A N/A N/A self N/A N/A sch tbl cns N/A UniqueConstraint N/A constr __dict__ N/A _get_col_idx N/A N/A cls col_map_list col_names N/A N/A N/A columns N/A N/A N/A list N/A N/A col keys N/A 0 N/A col col_map_list N/A N/A N/A N/A N/A columns index c 1 N/A c col_names N/A classmethod from_map N/A N/A self table inconstrs target rtables N/A None N/A N/A Initialize the dictionary of constraints by converting the input map

        :param table: table affected by the constraints
        :param inconstrs: YAML map defining the constraints
         N/A N/A check_constraints inconstrs N/A N/A chks N/A inconstrs N/A check_constraints N/A cns chks N/A N/A check N/A CheckConstraint table N/A table name schema N/A table schema name cns N/A val N/A chks N/A cns N/A N/A N/A N/A check expression N/A val N/A expression N/A N/A N/A KeyError N/A exc N/A N/A N/A exc args N/A N/A Constraint '%s' is missing expression cns N/A N/A N/A N/A N/A N/A check expression N/A 0 ( N/A N/A N/A check expression N/A -1 ) N/A N/A N/A check expression N/A N/A check expression N/A 1 -1 N/A N/A columns val N/A N/A N/A check col_names N/A val N/A columns N/A target N/A N/A N/A check target target N/A N/A description val N/A N/A N/A check description N/A val N/A description N/A N/A inherited val N/A N/A N/A check inherited N/A val N/A inherited N/A N/A self N/A N/A N/A table schema N/A table name cns check N/A N/A primary_key inconstrs N/A N/A cns N/A N/A list N/A N/A N/A inconstrs N/A primary_key keys N/A 0 N/A pkey N/A PrimaryKey table N/A table name schema N/A table schema name cns N/A val N/A N/A inconstrs N/A primary_key N/A cns N/A N/A N/A N/A pkey col_names N/A val N/A columns N/A N/A pkey col_idx N/A N/A self _get_col_idx N/A inconstrs N/A columns N/A pkey col_names N/A N/A N/A KeyError N/A exc N/A N/A N/A exc args N/A N/A Constraint '%s' is missing columns cns N/A N/A N/A attr value N/A list N/A N/A val items N/A N/A N/A attr COMMON_ATTRS N/A N/A N/A setattr pkey attr value N/A N/A self N/A N/A N/A table schema N/A table name cns pkey N/A N/A foreign_keys inconstrs N/A N/A fkeys N/A inconstrs N/A foreign_keys N/A cns fkeys N/A N/A fkey N/A ForeignKey table N/A table name schema N/A table schema name cns N/A val N/A fkeys N/A cns N/A N/A on_update val N/A N/A act N/A val N/A on_update N/A N/A N/A N/A act lower N/A list N/A N/A ACTIONS values N/A N/A N/A ValueError N/A Invalid action '%s' for constraint '%s' N/A act cns N/A N/A fkey on_update act N/A N/A on_delete val N/A N/A act N/A val N/A on_delete N/A N/A N/A N/A act lower N/A list N/A N/A ACTIONS values N/A N/A N/A ValueError N/A Invalid action '%s' for constraint '%s' N/A act cns N/A N/A fkey on_delete act N/A N/A deferrable val N/A N/A N/A fkey deferrable True N/A N/A deferred val N/A N/A N/A fkey deferred True N/A N/A match val N/A N/A mat N/A val N/A match N/A N/A N/A N/A mat lower N/A list N/A N/A N/A self match_types values N/A N/A N/A ValueError N/A Invalid match type '%s' for constraint '%s' N/A mat cns N/A N/A fkey match mat N/A N/A N/A N/A fkey col_names N/A val N/A columns N/A N/A fkey col_idx N/A N/A self _get_col_idx N/A inconstrs N/A columns N/A fkey col_names N/A N/A N/A KeyError N/A exc N/A N/A N/A exc args N/A N/A Constraint '%s' is missing columns cns N/A N/A N/A N/A refs N/A val N/A references N/A N/A N/A KeyError N/A exc N/A N/A N/A exc args N/A N/A Constraint '%s' missing references cns N/A N/A N/A N/A N/A fkey ref_table N/A refs N/A table N/A N/A N/A KeyError N/A exc N/A N/A N/A exc args N/A N/A Constraint '%s' missing table reference cns N/A N/A N/A N/A N/A fkey ref_col_names N/A refs N/A columns N/A rtable_key N/A table  N/A fkey ref_table N/A N/A rtables N/A rtable_key rtables N/A N/A ref_table N/A rtables N/A rtable_key N/A N/A fkey ref_col_idxs N/A N/A self _get_col_idx N/A ref_table N/A columns N/A fkey ref_col_names N/A N/A N/A KeyError N/A exc N/A N/A N/A exc args N/A N/A Constraint '%s' missing reference columns cns N/A N/A sch N/A table schema N/A N/A schema refs N/A N/A sch N/A refs N/A schema N/A N/A fkey ref_schema sch N/A N/A description val N/A N/A N/A fkey description N/A val N/A description N/A N/A self N/A N/A N/A table schema N/A table name cns fkey N/A N/A unique_constraints inconstrs N/A N/A uconstrs N/A inconstrs N/A unique_constraints N/A cns uconstrs N/A N/A unq N/A UniqueConstraint table N/A table name schema N/A table schema name cns N/A val N/A uconstrs N/A cns N/A N/A N/A N/A unq col_names N/A val N/A columns N/A N/A unq col_idx N/A N/A self _get_col_idx N/A inconstrs N/A columns N/A unq col_names N/A N/A N/A KeyError N/A exc N/A N/A N/A exc args N/A N/A Constraint '%s' is missing columns cns N/A N/A N/A attr value N/A list N/A N/A val items N/A N/A N/A attr COMMON_ATTRS N/A N/A N/A setattr unq attr value N/A N/A self N/A N/A N/A table schema N/A table name cns unq N/A diff_map N/A N/A self inconstrs N/A N/A N/A Generate SQL to transform existing constraints

        :param inconstrs: a YAML map defining the new constraints
        :return: list of SQL statements

        Compares the existing constraint definitions, as fetched from
        the catalogs, to the input map and generates SQL statements to
        transform the constraints accordingly.
         N/A stmts N/A N/A turn N/A 1 2 N/A N/A N/A sch tbl cns self N/A N/A constr N/A self N/A N/A sch tbl cns N/A N/A getattr constr inherited False N/A N/A N/A N/A isinstance constr ForeignKey N/A N/A N/A turn 1 N/A N/A N/A N/A N/A turn 2 N/A N/A N/A N/A N/A N/A sch tbl cns inconstrs N/A N/A hasattr constr target N/A N/A N/A N/A stmts append N/A N/A constr drop N/A N/A sch tbl cns inconstrs N/A N/A inconstr N/A inconstrs N/A N/A sch tbl cns N/A N/A getattr inconstr inherited False N/A N/A N/A N/A hasattr inconstr target N/A N/A N/A N/A isinstance inconstr ForeignKey N/A N/A N/A turn 1 N/A N/A N/A N/A N/A turn 2 N/A N/A N/A N/A N/A sch tbl cns self N/A N/A N/A N/A stmts append N/A N/A inconstr add N/A N/A N/A N/A stmts append N/A N/A N/A self N/A N/A sch tbl cns diff_map inconstr N/A stmts N/A N/A