Skip to main content

Super lightweight bridge for storing Skir-typed values in SQLAlchemy JSON columns.

Project description

skir-sqlalchemy

Super lightweight bridge between Skir serializers and SQLAlchemy JSON columns.

Install

pip install skir-sqlalchemy

DenseJson

DenseJson(serializer) stores values of type T in a SQLAlchemy JSON column using Skir's dense JSON format.

  • serializer: skir_client.Serializer[T]
  • keep_unrecognized_values: forwarded to serializer.from_json(...)

Example

from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from skir_alchemy import DenseJson
from geometry_skir import Point


class Base(DeclarativeBase):
    pass


class GeometryRow(Base):
    __tablename__ = "geometry"

    id: Mapped[int] = mapped_column(primary_key=True)
    point: Mapped[Point | None] = mapped_column(DenseJson(Point.serializer))

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

skir_sqlalchemy-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

skir_sqlalchemy-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file skir_sqlalchemy-0.1.0.tar.gz.

File metadata

  • Download URL: skir_sqlalchemy-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for skir_sqlalchemy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b32f1341b05adbc52e685f89163bf381b17a45ab98300e69e5180ebcd98fc135
MD5 8a9fe563114f034b3fed3724faf14895
BLAKE2b-256 c62e649dc696e3d902e2c5b6558ddffa08dcaca949987a0fef9873908040b61a

See more details on using hashes here.

File details

Details for the file skir_sqlalchemy-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for skir_sqlalchemy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12e797acc538a7b33b51913ce35b5e3c707c24bc78e211431da1f218465aa6cc
MD5 d47d6b8156253bd4ef2a255b78a13868
BLAKE2b-256 0b283c4c33b620881fff55f3da29e269a4678c0fab0402af88a9465ad84b8b03

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