Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pyrseas/dbobject/__init__.py (split_schema_table): New utility function split schema-qualified names. (DbSchemaObject.unqualify): Use new function. * pyrseas/dbobject/column.py (Column.to_map): Map inherited columns. (ColumnDict.query): Retrieve attinhcount as 'inherited'. * pyrseas/dbobject/constraint.py (ConstraintDict._from_catalog): Recall code by call to split_schema_table. * pyrseas/dbobject/table.py (Sequence.get_owner): Replace code by call to split_schema_table. (Table.to_map): Map inherited tables. (Table.create): Add INHERITS clause and deal with inherited columns. (ClassDict.inhquery): New query from pg_inherits. (ClassDict._from_catalog): Fetch inheritance info. (ClassDict.from_map): Map 'inherits' info. (ClassDict.link_refs): Add links for descendant tables. (ClassDict.diff_map): Deal with inherited tables, both for create and drop. * tests/dbobject/test_table.py: Add tests for inherited tables. * tests/dbobject/utils.py (PostgresDb.clear): Use IF EXISTS for dropping tables.
- Loading branch information
Showing
6 changed files
with
144 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters