Skip to content

Refactor: Consolidate SQL Modules for Improved Organization #11

@glnnlhmn

Description

@glnnlhmn

Objective: Refactor the existing SQL module files to improve the overall organization, readability, and maintainability of the project.

Details:

Consolidate Files

  • Merge sql_formatter.py and sql_pretty_printer.py into a single file named formatter.py.
  • Combine sql_parser.py and sql_splitter.py into parser.py.
  • Consolidate sql_table_drop.py, sql_table_name_replacer.py, and sql_table_truncate.py into a new file named table_operations.py.

Project Structure

  • Create a new package directory named sqlaxe_tool .
  • Add an __init__.py file in the sqlaxe_tool directory to make it a package.
  • Ensure that relative imports are correctly used within the modules.
  • Rename sqlaxe.py to main.py to follow standard conventions.

Ensure Imports

  • Update the __init__.py file to expose the main classes and functions for easier imports in main.py.
  • Verify that the main.py file imports the necessary components from sqlaxe_tool package 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_tool package is correctly set up with relative imports.
  • The main.py file successfully imports and utilizes the refactored modules.
  • All existing functionality works as expected after the refactoring.

Test Updates for SQL Module Refactor

  1. Identify Existing Tests:

    • Locate all existing test files for the current modules.
  2. Update Imports in Test Files:

    • Change imports in test files to reflect the new module structure.
  3. Modify Test Cases:

    • Ensure test cases are updated to call the correct functions and methods from the new modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions