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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for unboil_sqlalchemy_types-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a19e2fe254cc14ab06bbfa5e2128ee6f59e3eb7fa3061f1f08f24b9535575bba
MD5 1b1d4917e6f1e5c638e5a71bd1cedd88
BLAKE2b-256 8d72d688a28b8eede897df32fbb8795041dd8a3d4ffc2c62bfb94788c3f98451

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unboil_sqlalchemy_types-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 94a04af6bf271deafe16d8cb9cd31ecfbeee8d1648c330d3617e98456eb10311
MD5 f78b14bb24f26fa89a94f5b03a34ad24
BLAKE2b-256 c8d76c7aeaae9804fe305b6d402ec035f21f640309aa2dd7bb240de8925ed0fa

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