Skip to content

Conversation

@xnuinside
Copy link
Owner

  • New sqlalchemy_v2 generator with modern SQLAlchemy 2.0 syntax:
    • Uses DeclarativeBase instead of deprecated declarative_base()
    • Uses Mapped[T] type annotations for columns
    • Uses mapped_column() instead of Column()
    • Uses X | None union syntax for nullable columns
  • Support for all column types, foreign keys, indexes, and constraints
  • Added functional tests for SQLAlchemy v2 generation
  • Added integration tests for SQLAlchemy v2 (validates generated code runs)
  • Added integration tests for OpenAPI 3 generator
  • Updated CHANGELOG.md and README.md with SQLAlchemy v2 support
  • Removed unused files (SUGGESTIONS.md, one.ddl)

- New sqlalchemy_v2 generator with modern SQLAlchemy 2.0 syntax:
  - Uses DeclarativeBase instead of deprecated declarative_base()
  - Uses Mapped[T] type annotations for columns
  - Uses mapped_column() instead of Column()
  - Uses X | None union syntax for nullable columns
- Support for all column types, foreign keys, indexes, and constraints
- Added functional tests for SQLAlchemy v2 generation
- Added integration tests for SQLAlchemy v2 (validates generated code runs)
- Added integration tests for OpenAPI 3 generator
- Updated CHANGELOG.md and README.md with SQLAlchemy v2 support
- Removed unused files (SUGGESTIONS.md, one.ddl)
- dataclass: 4 tests for basic model, fields, defaults, multiple tables
- sqlalchemy (legacy): 4 tests for basic model, columns, FK, multiple tables
- sqlalchemy_core: 5 tests (skipped - generator has known bugs)
- sqlmodel: 4 tests (skipped - requires Pydantic>=2.0, conflicts with table-meta)
- gino: 4 tests (skipped - requires SQLAlchemy<1.4, conflicts with SQLAlchemy>=2.0)

Note: Some tests are skipped due to dependency conflicts:
- sqlmodel requires pydantic>=2.0, but table-meta requires pydantic<2.0
- gino requires sqlalchemy<1.4, but we use sqlalchemy>=2.0
- sqlalchemy_core generator has bugs (missing column names, broken type sizes)
- Separate tox environments for different dependency requirements:
  - py39-py313: unit and functional tests
  - integration-sqlalchemy: pydantic v1, sqlalchemy v2
  - integration-gino: pydantic v1, sqlalchemy v1.3 (gino requirement)

- Separate CI jobs for each integration test group

- SQLModel integration tests disabled due to unresolvable conflict:
  - sqlmodel requires pydantic>=2.0
  - table-meta requires pydantic<2.0
  - Tests will be skipped until table-meta adds pydantic 2.x support
Integration tests now use pre-generated code fixtures instead of
calling create_models() at runtime. This allows SQLModel tests to
run in an isolated environment with pydantic>=2.0 without conflicts.

Tests verify that the generated code (as users would commit to their repos)
works correctly with the target library.
- Fix sqlalchemy_core generator: add column names to output
- Fix sqlalchemy_core generator: include type name with size
- Fix sqlalchemy_core generator: correct positional/keyword arg order for ForeignKey
- Convert gino tests to pre-generated code fixtures (no omymodels dependency)
- Update tox.ini and CI workflow for isolated gino tests
- Remove flawed parametrized converter test (py-models-parser limitations)
- Update functional test expected values for sqlalchemy_core
@xnuinside xnuinside merged commit 7efa358 into main Jan 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants