Skip to main content

Module tenant_postgres_store

Module tenant_postgres_store 

Source
Expand description

Tenant-scoped PostgreSQL-backed TaskStore implementation.

Adds a tenant_id column to the tasks table for full tenant isolation at the database level. Uses TenantContext to scope all operations.

Requires the postgres feature flag.

§Schema

CREATE TABLE IF NOT EXISTS tenant_tasks (
    tenant_id  TEXT NOT NULL DEFAULT '',
    id         TEXT NOT NULL,
    context_id TEXT NOT NULL,
    state      TEXT NOT NULL,
    data       JSONB NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    PRIMARY KEY (tenant_id, id)
);

Structs§

TenantAwarePostgresTaskStore
Tenant-scoped PostgreSQL-backed TaskStore.