Skip to content

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.

TSchema extends Record<string, unknown> = Record<string, never>

Grant[]

{ id: string; } | null

Db<TSchema>