Skip to content

CHANGELOG

v0.17.4 (2025-03-15)

Bug Fixes

  • deps: Update Jinja2 to ^3.1.6 to resolve security vulnerabilities (#68, 7a263bc)

v0.17.3 (2025-03-07)

Bug Fixes

  • Update Jinja2 to ^3.1.6 to address security vulnerability (#67, add28df)

v0.17.2 (2025-02-21)

Bug Fixes

  • types: Generate correct types for ONE_TO_ONE relationships (#66, e889eb3)

  • fix: Debug logging * feat(marshalers): improve foreign key analysis and cross-schema handling

  • Add comprehensive test suite for add_foreign_key_info_to_table_details - Enhance debug logging with guidance for cross-schema references - Keep foreign keys even when target table is in another schema - Ensure proper relationship type detection for Pydantic model generation

This improves support for cross-schema relationships (e.g., public.users -> auth.users) while maintaining correct type generation in Pydantic models.

v0.17.1 (2025-02-21)

Bug Fixes

  • models: Correct foreign key relationship types and field names (#65, 368b557)

Generate appropriate types for relationship fields based on cardinality: - ONE_TO_ONE -> single instance (Type | None) - ONE_TO_MANY -> list of instances (list[Type] | None) - MANY_TO_MANY -> list of instances (list[Type] | None)

This fixes issues where: - All relationships were incorrectly generated as lists - Field names were incorrectly using 'ids' suffix - Multiple fields had naming collisions - Referenced table names were inconsistently included

refactor: consolidate tooling and improve logging - Replace isort with ruff for import sorting - Enhance CLI logging with proper configuration - Improve Makefile documentation and organization

v0.17.0 (2025-02-16)

Features

  • Differentiate between insert, update, and select models (#63, 372aaad)

  • refactor(pydantic): improve foreign key and relationship field generation

  • Keep original column names for foreign keys (e.g., author_id: User) - Use inflection library for proper pluralization in many relationships - Fix handling of tables with relationships but no foreign keys - Add comprehensive tests for pluralization cases

This change ensures more accurate model generation that better reflects the database schema while maintaining proper type hints based on relationship types (ONE_TO_ONE, ONE_TO_MANY, MANY_TO_MANY).

  • style: organize imports and format code

  • Sort and group imports according to PEP8 - Remove unused imports - Fix line spacing and indentation

  • fix(sqlalchemy): standardize newline formatting in model generation

  • Remove extra newline after tablename in write_docs method - Adjust newlines between sections in model output: - Single newline after tablename - Single newline between columns - Single newline before section headers - Double newline between classes - Update test assertions to match new formatting

  • test(cli): fix schema handling in CLI test cases

  • Add proper schema parameter to CLI command invocations - Fix mock table dictionary and jobs configuration - Improve test coverage for empty schema scenarios - Simplify test setup by removing redundant configurations

  • fix: line length error

  • fix(deps): correct supabase package name in pre-commit config

  • style: break long line in sqlalchemy writer

  • fix(writers): use RelationshipInfo objects for relationships

  • feat(models): add Insert and Update model variants

  • Add Insert and Update model variants for each table with appropriate field optionality - Add --no-crud-models flag to disable generation of Insert/Update models - Add smoke-test target to Makefile for quick testing

Changes: - Add is_identity and related properties to ColumnInfo for tracking auto-generated columns - Update SQL query to fetch identity_generation information - Enhance WriterClassType enum with INSERT and UPDATE types - Group field property comments in Insert models for better readability - Add ruff check --fix to remove unused imports in generated files

This change makes it easier to use the generated models in CRUD operations by: 1. Making auto-generated fields optional in Insert models 2. Making all fields optional in Update models 3. Adding clear documentation about field properties

  • feat(models): generate specialized Insert and Update Pydantic models

  • Add Insert models that make auto-generated fields optional (e.g., IDs, timestamps) - Add Update models that make all fields optional for partial updates - Add generate_crud_models flag to FileWriterFactory for controlling model generation - Improve docstrings to clarify model generation behavior

Resolves issue with Insert/Update model generation to match TypeScript behavior

  • docs: Update mkdocs with new example illustrating Insert and Update generators

v0.16.0 (2025-02-16)

Features

  • Foreign key fields should be single instances, not lists in generated Pydantic models (#62, 1484841)

  • refactor(pydantic): improve foreign key and relationship field generation

  • Keep original column names for foreign keys (e.g., author_id: User) - Use inflection library for proper pluralization in many relationships - Fix handling of tables with relationships but no foreign keys - Add comprehensive tests for pluralization cases

This change ensures more accurate model generation that better reflects the database schema while maintaining proper type hints based on relationship types (ONE_TO_ONE, ONE_TO_MANY, MANY_TO_MANY).

  • style: organize imports and format code

  • Sort and group imports according to PEP8 - Remove unused imports - Fix line spacing and indentation

  • fix(sqlalchemy): standardize newline formatting in model generation

  • Remove extra newline after tablename in write_docs method - Adjust newlines between sections in model output: - Single newline after tablename - Single newline between columns - Single newline before section headers - Double newline between classes - Update test assertions to match new formatting

  • test(cli): fix schema handling in CLI test cases

  • Add proper schema parameter to CLI command invocations - Fix mock table dictionary and jobs configuration - Improve test coverage for empty schema scenarios - Simplify test setup by removing redundant configurations

  • fix: line length error

  • fix(deps): correct supabase package name in pre-commit config

  • style: break long line in sqlalchemy writer

  • fix(writers): use RelationshipInfo objects for relationships

v0.15.6 (2025-01-28)

Refactoring

  • pydantic: Migrate from constr to Annotated[str, StringConstraints] (#59, 031a53e)

v0.15.5 (2025-01-27)

Bug Fixes

v0.15.4 (2025-01-27)

Chores

v0.15.3 (2025-01-16)


... and so on. For the full changelog, please see the releases page.