OperationsFn
OperationsFn<
TInput,TResult,TUser> = (db,input,ctx) =>Operation<TResult>
Defined in: packages/actions/src/types.ts:107
A function that builds a database Operation for an action.
Receives the Drizzle database, the parsed input, and the full
ActionContext. Returns an Operation (from @cfast/db) that
encapsulates both the query/mutation and its permission descriptors.
Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput
The expected input shape for this action.
TResult
Section titled “TResult”TResult
The return type of the operation.
TUser
The shape of the authenticated user object.
Parameters
Section titled “Parameters”TInput
ActionContext<TUser>
Returns
Section titled “Returns”Operation<TResult>
Example
Section titled “Example”const deletePostOps: OperationsFn<{ postId: string }, Response, AppUser> = (db, input, ctx) => compose( [db.delete(posts).where(eq(posts.id, input.postId))], async (runDelete) => { await runDelete({}); return redirect("/"); }, );