Skip to content

Conversation

@christianparpart
Copy link
Member

@christianparpart christianparpart commented Jan 22, 2025

This pull request introduces several enhancements and refactors to the SQL schema handling, debugging configuration, and type definitions in the codebase. The key changes include adding a new debugging configuration for vimspector, refactoring schema-related functions to use SqlConnection for better encapsulation, introducing a utility function for mapping ODBC data types, and improving type safety in migration plans.

Debugging Enhancements:

  • .vimspector.json: Added a new debugging configuration for dbtool to enable launching and debugging the dbtool program with predefined arguments and settings.

Schema Handling Refactors:

  • src/Lightweight/SqlSchema.cpp: Refactored schema-related functions (ReadAllTables, AllTables, etc.) to use SqlConnection instead of raw database and schema strings for improved encapsulation and clarity. Added logging for SQL execution and ensured cursors are closed after use. [1] [2] [3]
  • src/Lightweight/SqlSchema.hpp: Updated function signatures to reflect the use of SqlConnection in schema-related functions. [1] [2]

Type Mapping Improvements:

  • src/Lightweight/SqlColumnTypeDefinitions.hpp: Introduced the MakeColumnTypeFromNative function to map ODBC data types to SqlColumnTypeDefinition in a concise and reusable way. This replaces the previous implementation that was scattered across multiple files.
  • src/Lightweight/SqlSchema.cpp: Replaced the old FromNativeDataType implementation with the new MakeColumnTypeFromNative utility for better maintainability and consistency.

Migration Plan Improvements:

Logging and Error Handling:

These changes improve the maintainability, debugging capabilities, and robustness of the codebase, particularly in handling SQL schema operations and type mappings.

Signed-off-by: Christian Parpart <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants