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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for skir_sqlalchemy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67f1c81ea488e665c8b7a7bc01256de71679fd0c0b231485fe53403ec11c7290
MD5 5dc04cc977f26e4adb1dce6cdcdd6d48
BLAKE2b-256 fe2153dd5d881f56a5e03046e41c3b0a22763b8c04e1bafdba640f9e57a0255d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for skir_sqlalchemy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e87c99854ac594bf69fa5fd1b024cb7eb801f0bcc6dfcf33b9a61bfe0c90293f
MD5 4fa852daea4414ae1d6ed50685852e0c
BLAKE2b-256 8c65c4e9865d923ef8579ba26e9972cce0cd488226d0e1f2e17ebeec5522000c

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