Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize copy denormalizations to properly support multiple-column …
…copy. * pyrseas/extend/__init__.py (DbExtension.__init__): Allow all attributes. * pyrseas/extend/audit.py (CfgAuditColumn.apply): Call add_func at the database rather than schema level. * pyrseas/extend/denorm.py (ExtDenorms): New helper class. (ExtCopyDenormColumn.add_trigger_func): Deal with both single or multi-item translation tables. (ExtCopyDenormColumn.apply): Refactor out column-level code to ExtDenorms. Create single and multi-item translation tables. (ExtDenormDict.from_map): Accept new input map structure and use new internal structures. (ExtDenormDict.link_current): Adjust loop to new internal structures. * pyrseas/extend/function.py (CfgFunctionSource, CfgFunctionSegment, CfgFunctionTemplate, CfgFunctionSourceDict): New classes to support more flexible transformations of function sources. (CfgFunction.apply): Replace source patterns using both single and multi-item tables. * pyrseas/extend/table.py (ExtTable.apply): Call denorms.apply instead of processing columns individually. (ExtClassDict.link_refs): Columns are now an attribute of an ExtDenorm. * pyrseas/extenddb.py (ExtendDatabase.__init__): Initialize funcsrcs. (ExtendDatabase.add_func): New method to add functions at database level. (ExtendDatabase._from_cfgmap): Process function templates and segments. * tests/extend/test_denorm.py (CopyDenormalizationTestCase.test_copy_column): Reorganize according to new input map. (CopyDenormalizationTestCase.test_copy_columns_cross_schema): New test to verify changed functionality.
- Loading branch information
Showing
7 changed files
with
391 additions
and
101 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
Oops, something went wrong.