Skip to main content

A library to expand SQLAlchemy types.

Project description

unboil-sqlalchemy-types

Installation

pip install unboil-sqlalchemy-types

Usage Example

from pydantic import BaseModel
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from unboil_sqlalchemy_types import PydanticJSON


class Base(DeclarativeBase):
    pass

class Profile(BaseModel):
    age: int
    bio: str

Meta = str | int | dict

class User(Base):
    __tablename__ = 'users'
    id: Mapped[int] = mapped_column(primary_key=True)
    profile: Mapped[Profile] = mapped_column(PydanticJSON(Profile))
    meta: Mapped[Meta] = mapped_column(PydanticJSON(Meta))

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

unboil_sqlalchemy_types-0.1.5.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unboil_sqlalchemy_types-0.1.5-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file unboil_sqlalchemy_types-0.1.5.tar.gz.

File metadata

  • Download URL: unboil_sqlalchemy_types-0.1.5.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for unboil_sqlalchemy_types-0.1.5.tar.gz
Algorithm Hash digest
SHA256 cd211d2ad2be03460c81a00a863f9d52b9fdbc64b9799c3b20f87b8c01f4d3b9
MD5 a6ba4e9c0b542644cf2cb3753528c54a
BLAKE2b-256 2f7425d96d6784dd1b2970c79ab0ea231171453a8609b4d5c2f108f907593f1c

See more details on using hashes here.

File details

Details for the file unboil_sqlalchemy_types-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for unboil_sqlalchemy_types-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5802c748e944c6c35f703b502a971f53354764cb0bc68601488166d9b1cf6b01
MD5 fc6e5157897d66f94aaa36311261b350
BLAKE2b-256 1a6b7d4299c7b2c97b60af9d54f888e8ec8786a87cb048a6609bbc898f6ac061

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page