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.3.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.3-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unboil_sqlalchemy_types-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 5a287645a8734690b646adac7b1f28fb558ddf38e65fba03b27dbe5ab0b355f7
MD5 eacbcf9d795cc0d6f33a01274406472d
BLAKE2b-256 e27cd656ec12caaf53c537fc4c39834330e03049df69047cb6cd97de9aeb0260

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unboil_sqlalchemy_types-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c7183b848319a58a208d92cb2da2c1e9d213f8103a786f101f47a46fe7431533
MD5 0f91e1f9d13584068251840bb370ce12
BLAKE2b-256 8c6e8c7e1660aa592af6edb2eb3991b2b30169a1577f97240209d0063d942147

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