Seamlessly use Pydantic 2 models in a Postgres SQLAlchemy model
Project description
pydantic-sqlalchemy-type-decorator
Seamlessly use Pydantic 2 models in a Postgres SQLAlchemy model
Usage
Given some Pydantic model called MyCustomModel, you can specify your columns like:
from pydantic_sqlalchemy_deco.decorator import PydanticJSON
...
class MyTable(Base):
response: Mapped[MyCustomModel] = mapped_column(PydanticJSON(MyCustomModel))
BaseModel changes
If your BaseModel has custom serializers, you can specify this using the T parameter:
response: Mapped[MyCustomModel] = mapped_column(PydanticJSON[CoolerBaseModel](MyCustomModel))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_sqlalchemy_deco-0.0.1.tar.gz.
File metadata
- Download URL: pydantic_sqlalchemy_deco-0.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a3f06229ce7be4fb870b75b9b495915b8d468c1a2e62f976705bfcba49e76a7
|
|
| MD5 |
f9aa66670ef10355478173ce935e73e8
|
|
| BLAKE2b-256 |
6412c477c42a5de0efa4d1801103538828d126609a4d99c02545e989b4eccc67
|
Provenance
The following attestation bundles were made for pydantic_sqlalchemy_deco-0.0.1.tar.gz:
Publisher:
python-publish.yml on kevinhikaruevans/pydantic-sqlalchemy-type-decorator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_sqlalchemy_deco-0.0.1.tar.gz -
Subject digest:
8a3f06229ce7be4fb870b75b9b495915b8d468c1a2e62f976705bfcba49e76a7 - Sigstore transparency entry: 156459358
- Sigstore integration time:
-
Permalink:
kevinhikaruevans/pydantic-sqlalchemy-type-decorator@372ca7f09f6a76f50af6654840ab5e022763f097 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/kevinhikaruevans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@372ca7f09f6a76f50af6654840ab5e022763f097 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pydantic_sqlalchemy_deco-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pydantic_sqlalchemy_deco-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e00012c6672bab65542d15774a8e408999d9f4c5bc078ff596e75f442a96825d
|
|
| MD5 |
b0f43076d56d206aaebf974e6e24ddd1
|
|
| BLAKE2b-256 |
813c98f95d24adacbace03c41902e3c9d456bad2e2a6ef54d2c4c88e89d65252
|
Provenance
The following attestation bundles were made for pydantic_sqlalchemy_deco-0.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on kevinhikaruevans/pydantic-sqlalchemy-type-decorator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_sqlalchemy_deco-0.0.1-py3-none-any.whl -
Subject digest:
e00012c6672bab65542d15774a8e408999d9f4c5bc078ff596e75f442a96825d - Sigstore transparency entry: 156459361
- Sigstore integration time:
-
Permalink:
kevinhikaruevans/pydantic-sqlalchemy-type-decorator@372ca7f09f6a76f50af6654840ab5e022763f097 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/kevinhikaruevans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@372ca7f09f6a76f50af6654840ab5e022763f097 -
Trigger Event:
release
-
Statement type: