AppDbFactory
AppDbFactory<
TSchema> = (grants,user) =>Db<TSchema>
Defined in: packages/db/src/create-db.ts:295
The per-request factory returned by createAppDb. Closes over the app-level config and accepts the request-scoped grants + user, returning a fresh permission-aware Db.
Stable type so callers (e.g. @cfast/admin’s createDbForAdmin,
@cfast/core’s dbPlugin, route loaders) can pass the factory around
without re-deriving its signature.
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends Record<string, unknown> = Record<string, never>
Parameters
Section titled “Parameters”grants
Section titled “grants”Grant[]
{ id: string; } | null
Returns
Section titled “Returns”Db<TSchema>