@suluk/drizzle - v0.1.6
    Preparing search index...

    Interface CrudHandlerOptions

    interface CrudHandlerOptions {
        ownerCol?: string;
        access?: AccessMode;
        policies?: Record<AccessMode, Policy>;
        db: (c: Context) => CrudDb;
        principal: (c: Context) => string | null;
        isAdmin: (c: Context) => boolean;
        redact?: (tableName: string, row: AnyRow, admin: boolean) => AnyRow;
        afterUpdate?: (
            tableName: string,
            c: Context,
            db: CrudDb,
            before: AnyRow,
            after: AnyRow,
        ) => Promise<void>;
        afterUpdateTables?: ReadonlySet<string>;
    }
    Index

    Properties

    ownerCol?: string
    access?: AccessMode
    policies?: Record<AccessMode, Policy>

    override the default mode→policy preset (passed through to @suluk/hono's policyFor).

    db: (c: Context) => CrudDb

    resolve the drizzle instance for a request (dev: () => db; worker: (c) => drizzle(c.env.DB)).

    principal: (c: Context) => string | null

    the verified caller id (token/session/x-user) — used for owner-scoping + the create owner-stamp.

    isAdmin: (c: Context) => boolean

    whether the caller is an admin (e.g. c.get("isAdmin") === true).

    redact?: (tableName: string, row: AnyRow, admin: boolean) => AnyRow

    strip private columns from a row for a non-admin reader (no-op by default).

    afterUpdate?: (
        tableName: string,
        c: Context,
        db: CrudDb,
        before: AnyRow,
        after: AnyRow,
    ) => Promise<void>

    post-update hook (e.g. back-in-stock on a restock); fires only for tables in afterUpdateTables.

    afterUpdateTables?: ReadonlySet<string>