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.4.tar.gz (22.5 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.4-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unboil_sqlalchemy_types-0.1.4.tar.gz
  • Upload date:
  • Size: 22.5 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.4.tar.gz
Algorithm Hash digest
SHA256 1c0eeadf56db1dce5c4cbe3559e34b59e3399cbbfeeb5f77bfc79e5b1fe16606
MD5 77e7ca0dbf0c71aea0e3cc4a1856a5fb
BLAKE2b-256 97af26e6f25d61e7b6865c142b6308df2cd9be759049a328030ba586e6241c85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unboil_sqlalchemy_types-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8c0898801dd4bbe2342d7450cc9f3ba887cfeef7856ef6dadc7479eb3d506384
MD5 bdb3c04349ec056bd2ff5d108bd1d018
BLAKE2b-256 1b943d5995848d25e99a843387bb0b157f07c5fb83b073fde9fe4c73b0cfd2d2

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