-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Objective: Refactor the existing SQL module files to improve the overall organization, readability, and maintainability of the project.
Details:
Consolidate Files
- Merge
sql_formatter.pyandsql_pretty_printer.pyinto a single file namedformatter.py. - Combine
sql_parser.pyandsql_splitter.pyintoparser.py. - Consolidate
sql_table_drop.py,sql_table_name_replacer.py, andsql_table_truncate.pyinto a new file namedtable_operations.py.
Project Structure
- Create a new package directory named
sqlaxe_tool. - Add an
__init__.pyfile in thesqlaxe_tooldirectory to make it a package. - Ensure that relative imports are correctly used within the modules.
- Rename
sqlaxe.pytomain.pyto follow standard conventions.
Ensure Imports
- Update the
__init__.pyfile to expose the main classes and functions for easier imports in main.py. - Verify that the
main.pyfile imports the necessary components fromsqlaxe_toolpackage correctly.
Additional Context
This refactoring aims to enhance the modularity and scalability of the project, making it easier to manage and extend as the project grows. The changes should be thoroughly tested to ensure no functionality is broken.
Acceptance Criteria:
- All SQL modules are consolidated as outlined.
- The
sqlaxe_toolpackage is correctly set up with relative imports. - The
main.pyfile successfully imports and utilizes the refactored modules. - All existing functionality works as expected after the refactoring.
Test Updates for SQL Module Refactor
-
Identify Existing Tests:
- Locate all existing test files for the current modules.
-
Update Imports in Test Files:
- Change imports in test files to reflect the new module structure.
-
Modify Test Cases:
- Ensure test cases are updated to call the correct functions and methods from the new modules.
Metadata
Metadata
Assignees
Labels
No labels