PrepareContext
PrepareContext<
R> =object
Defined in: packages/schema/src/prepare.ts:15
What .prepare() gets besides the values: the write it prepares, its caller and its transaction.
Type Parameters
Section titled “Type Parameters”R
Properties
Section titled “Properties”before?
Section titled “before?”
optionalbefore?:R
Defined in: packages/schema/src/prepare.ts:27
On update, the record as it is stored now.
operation
Section titled “operation”operation:
"create"|"update"
Defined in: packages/schema/src/prepare.ts:17
The write being prepared.
session
Section titled “session”session:
PrepareSession
Defined in: packages/schema/src/prepare.ts:21
The caller’s session as the server resolved it.
tenant?
Section titled “tenant?”
optionaltenant?:string|number
Defined in: packages/schema/src/prepare.ts:23
The tenant the write works in, for a resource with .tenant().
trx:
Kysely<any>
Defined in: packages/schema/src/prepare.ts:25
The write’s transaction: what the hook reads or writes here commits with the record, or not at all.
user:
AccessUser
Defined in: packages/schema/src/prepare.ts:19
The user who writes, with the roles they act with.