Skip to content

LookupDb

Defined in: packages/permissions/src/types.ts:206

Minimal structural type for the read-only database handle passed to grant with lookup functions.

Defined here so the permissions package stays independent of @cfast/db. The runtime instance is provided by @cfast/db (an unsafe-mode db) and is structurally compatible with this interface, so authors can call db.query(table).findMany().run() inside a lookup without casting.

The query method is intentionally typed loosely (unknown arguments and results) to avoid pulling Drizzle generics into the permissions surface. Authors typically know exactly which table they are querying and cast the result inline.

query: (table) => object

Defined in: packages/permissions/src/types.ts:207

string | object

object

findFirst: (options?) => object

unknown

object

run: (params?) => Promise<unknown>

unknown

Promise<unknown>

findMany: (options?) => object

unknown

object

run: (params?) => Promise<unknown[]>

unknown

Promise<unknown[]>