{"library":"sqlalchemy-easy-softdelete","title":"SQLAlchemy Easy SoftDelete","type":"library","description":"Provides a mixin and utilities to add soft-deletion (deleted_at column) to SQLAlchemy ORM models. Version 0.9.0 supports SQLAlchemy 2.x and requires Python >=3.10. Actively maintained.","language":"python","status":"active","last_verified":"Sat May 09","install":{"commands":["pip install sqlalchemy-easy-softdelete"],"cli":null},"imports":["from sqlalchemy_easy_softdelete.mixin import SoftDeleteMixin","from sqlalchemy_easy_softdelete.mixin import Base"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/flipbit03/sqlalchemy-easy-softdelete","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sqlalchemy-easy-softdelete/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"from sqlalchemy import create_engine, Column, Integer, String\nfrom sqlalchemy.orm import DeclarativeBase\nfrom sqlalchemy_easy_softdelete.mixin import SoftDeleteMixin\n\nengine = create_engine('sqlite:///:memory:')\n\nclass Base(DeclarativeBase):\n    pass\n\nclass User(SoftDeleteMixin, Base):\n    __tablename__ = 'users'\n    id = Column(Integer, primary_key=True)\n    name = Column(String)\n\nBase.metadata.create_all(engine)\n\nfrom sqlalchemy.orm import Session\nwith Session(engine) as session:\n    user = User(name='Alice')\n    session.add(user)\n    session.commit()\n    session.delete(user)  # This will soft-delete\n    session.commit()","lang":"python","description":"Defines a model with soft-delete support. The delete() method on the session performs a soft delete by setting deleted_at timestamp.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}