Improve sqlpp23-ddl2cpp custom types mapping#128
Conversation
- Extend --path-to-custom-types to support arbitrary C++ types. - Implicitly prefix unqualified C++ type names with ::sqlpp::. - Treat qualified C++ type names (containing ::) as custom types and use as-is. - Allow custom base types in mapping CSV even if they are not built-in sqlpp types. - Ensure side-effect-free parser initialization by copying built-in type lists. - Update unit tests and integration tests to cover new functionality. Co-authored-by: rbock <5185185+rbock@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Extend --path-to-custom-types to support arbitrary C++ types. - Implicitly prefix unqualified C++ type names with ::sqlpp::. - Treat qualified C++ type names (containing ::) as custom types and use as-is. - Allow custom base types in mapping CSV even if they are not built-in sqlpp types. - Fix compilation in integration tests by reordering includes and custom type definitions. - Update unit tests and integration tests to cover new functionality. Co-authored-by: rbock <5185185+rbock@users.noreply.github.com>
I have improved
scripts/sqlpp23-ddl2cppto better handle custom type mappings.Key changes:
--path-to-custom-typesCSV mapping now supports any C++ type as a "base type". If the base type is not a built-insqlpptype, the script creates a new parser for the associated SQL types.integral,my_type) are now implicitly prefixed with::sqlpp::in the generated code.boost::uuid,my_ns::my_type) are treated as custom types and used exactly as provided.cpp_typeannotations in the DDL, ensuring consistent behavior across all type override mechanisms.DdlParser.initializenow copies the built-in type lists before extending them, preventing side effects when the parser is re-initialized (which is common in unit tests).scripts/sqlpp23-ddl2cpp-unit-testsnow includes cases for qualified vs. unqualified types from both mappings and annotations.tests/scripts/have been updated with a newUUIDSQL type mapping tomy_ns::uuidto exercise the new functionality.These changes provide more flexibility for users to map SQL types to their own C++ types while maintaining a clean and consistent naming convention for standard
sqlpptypes.PR created automatically by Jules for task 1074235339693974878 started by @rbock