Skip to main content

trace your model field change log

Project description

sqlatracker

Inspired by django-field-history

GitHub Build Status codecov PyPI

Example

from sqlalchemy import BigInteger, Column
from sqlalchemy.ext.declarative import as_declarative
from sqlatracker.field_tracker import FieldTracker


@as_declarative()
class Base:
    id = Column(BigInteger, primary_key=True, autoincrement=True)


class Example(Base):
    example_field_1 = Column(BigInteger)
    example_field_2 = Column(BigInteger)


FieldTracker.listen_for(
    Example.example_field_1,
    Example.example_field_2,
)

Integrate with your metadata for alembic

from sqlatracker.field_tracker import FieldTracker
from sqlatracker.utils import merge_metadata

target_metadata = merge_metadata(your_metadata, FieldTracker.metadata)

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

sqlatracker-0.0.7.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

sqlatracker-0.0.7-py2.py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page