Supabase-pydantic

Latest version: v0.17.4

Safety actively analyzes 723144 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 7

0.17.4

Bug Fixes

- **deps**: Update Jinja2 to ^3.1.6 to resolve security vulnerabilities
([68](https://github.com/kmbhm1/supabase-pydantic/pull/68),
[`7a263bc`](https://github.com/kmbhm1/supabase-pydantic/commit/7a263bc64e70b6579bdb4ab05279d484ee78006f))

0.17.3

Not secure
Bug Fixes

- Update Jinja2 to ^3.1.6 to address security vulnerability
([67](https://github.com/kmbhm1/supabase-pydantic/pull/67),
[`add28df`](https://github.com/kmbhm1/supabase-pydantic/commit/add28dfabd57e3a8c2d26e1eaf78a3b5740e9c84))

0.17.2

Not secure
Bug Fixes

- **types**: Generate correct types for ONE_TO_ONE relationships
([66](https://github.com/kmbhm1/supabase-pydantic/pull/66),
[`e889eb3`](https://github.com/kmbhm1/supabase-pydantic/commit/e889eb36cd2ed0b4c78f490c92db15c085defec1))

* 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.

0.17.1

Not secure
Bug Fixes

- **models**: Correct foreign key relationship types and field names
([65](https://github.com/kmbhm1/supabase-pydantic/pull/65),
[`368b557`](https://github.com/kmbhm1/supabase-pydantic/commit/368b557013363dc3b91485b7086872e09adecec4))

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

0.17.0

Not secure
Features

- Differentiate between insert, update, and select models
([63](https://github.com/kmbhm1/supabase-pydantic/pull/63),
[`372aaad`](https://github.com/kmbhm1/supabase-pydantic/commit/372aaad7c6cd2d736ee227347cf20ed8e08b6c91))

* 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

0.16.0

Not secure
Features

- Foreign key fields should be single instances, not lists in generated Pydantic models
([62](https://github.com/kmbhm1/supabase-pydantic/pull/62),
[`1484841`](https://github.com/kmbhm1/supabase-pydantic/commit/14848413ec23813c11ff719ac2aea1a3c947b191))

* 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

Page 1 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.