Skip to content

feature, SQL schema backend emitter with PostgreSQL MySQL SQLite3 dialect support #33

Description

@steven-varga

Add a SQL DDL backend to h5cpp-compiler that emits CREATE TABLE statements from annotated C++ structs. Support three dialects: PostgreSQL, MySQL, and SQLite3.

Scope

  • New backend flag: --sql-postgres, --sql-mysql, --sql-lite3
  • Unified output flag model: each backend gets a boolean flag; -o specifies the output file
  • Type map: C++ primitives → dialect-specific SQL types
  • Nested structs → JSON/JSONB columns (configurable)
  • Arrays → dialect-specific array/JSON types
  • Constraints: PRIMARY KEY, UNIQUE, NOT NULL, DEFAULT, FOREIGN KEY, CHECK, INDEX
  • Attributes: sql::table, sql::column, sql::dialect, sql::primary_key, sql::unique, sql::not_null, sql::default, sql::foreign_key, sql::check, sql::index, sql::type_override, sql::nested

Acceptance Criteria

  • SQL DDL emitter (consumer_sql.hpp)
  • Attribute rewriter whitelist (h5_attr_translator.hpp)
  • CLI flags integrated (h5cpp.cpp)
  • Test harness extension (run_fixture.cmake)
  • CMake fixtures list updated
  • 5+ fixtures with golden baselines
  • All tests passing
  • Taxonomy document written

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions