Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pydantic V1 to V2 #129

Closed
wants to merge 4 commits into from

Conversation

mohammadhasananisi
Copy link

@mohammadhasananisi mohammadhasananisi commented Nov 4, 2024

Hello, thank you for the libraries you made.
I wish both version 1 and version 2 could be supported

This pull request includes updates to the pydantic_sqlalchemy library to support the new version of Pydantic and some dependency updates in the project configuration. The key changes involve modifications to the configuration class and the creation of Pydantic models from SQLAlchemy models.

Updates to support Pydantic v2:

  • pydantic_sqlalchemy/main.py: Replaced BaseConfig with ConfigDict for Pydantic configuration and updated the OrmConfig class to use the new configuration format. ([pydantic_sqlalchemy/main.pyL3-R10](https://github.com/tiangolo/pydantic-sqlalchemy/pull/129/files#diff-e4f4ae85f18db30c044c31032df2f460a3e47f9fc07f50a7d731132fec871b58L3-R10))
  • pydantic_sqlalchemy/main.py: Updated the sqlalchemy_to_pydantic function to use the new model_config attribute from the updated OrmConfig class. ([pydantic_sqlalchemy/main.pyL36-R37](https://github.com/tiangolo/pydantic-sqlalchemy/pull/129/files#diff-e4f4ae85f18db30c044c31032df2f460a3e47f9fc07f50a7d731132fec871b58L36-R37))

Dependency updates:

  • pyproject.toml: Updated the Pydantic dependency to version >=2.0.0,<2.9.2. ([pyproject.tomlL17-R17](https://github.com/tiangolo/pydantic-sqlalchemy/pull/129/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711L17-R17))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant