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.
Properties
Section titled “Properties”query()
Section titled “query()”query: (
table) =>object
Defined in: packages/permissions/src/types.ts:207
Parameters
Section titled “Parameters”string | object
Returns
Section titled “Returns”object
findFirst()
Section titled “findFirst()”findFirst: (
options?) =>object
Parameters
Section titled “Parameters”options?
Section titled “options?”unknown
Returns
Section titled “Returns”object
run: (
params?) =>Promise<unknown>
Parameters
Section titled “Parameters”params?
Section titled “params?”unknown
Returns
Section titled “Returns”Promise<unknown>
findMany()
Section titled “findMany()”findMany: (
options?) =>object
Parameters
Section titled “Parameters”options?
Section titled “options?”unknown
Returns
Section titled “Returns”object
run: (
params?) =>Promise<unknown[]>
Parameters
Section titled “Parameters”params?
Section titled “params?”unknown
Returns
Section titled “Returns”Promise<unknown[]>