Alembic IntegrationΒΆ

Alembic is supported through one of two mechanisms:

  1. Create your engine with the audit plugin enabled

    `plugins` kwarg

    from sqlalchemy import create_engine
    
    engine = create_engine(
        "postgresql+psycopg2://postgres:postgres@localhost:5432/postgres",
        plugins=['audit'],
    )
    

    Via the connection String

    from sqlalchemy import create_engine
    
    engine = create_engine(
        "postgresql+psycopg2://postgres:postgres@localhost:5432/postgres?plugin=audit"
    )
    
  2. Calling sqlalchemy_postgresql_audit.enable()