interface Options { orm?: { logger?: Logger; schema: DatabaseSchema }; rateLimit?: WorkerKVRateLimit.Options; jobs(): Job<Data<Parser<unknown>>>[]; onJobError(error: unknown, message: Message<unknown>): void; onQueue( batch: MessageBatch<unknown>, env: Environment, ctx: ExecutionContext, ): Promise<void>; onRequest( request: Request<unknown, CfProperties<unknown>>, env: Environment, ctx: ExecutionContext, ): Promise<Response>; onSchedule( event: ScheduledController, env: Environment, ctx: ExecutionContext, ): Promise<void>; onTaskError(error: unknown, task: Task): void; tasks(): Task[];} Properties
Methods
Optional
jobs
- jobs(): Job<Data<Parser<unknown>>>[]
Returns Job<Data<Parser<unknown>>>[]
Optional
onJobError
- onJobError(error: unknown, message: Message<unknown>): void
Parameters
- error: unknown
- message: Message<unknown>
Returns void
Optional
onQueue
- onQueue(
batch: MessageBatch<unknown>,
env: Environment,
ctx: ExecutionContext,
): Promise<void> Parameters
- batch: MessageBatch<unknown>
- env: Environment
- ctx: ExecutionContext
onRequest
- onRequest(
request: Request<unknown, CfProperties<unknown>>,
env: Environment,
ctx: ExecutionContext,
): Promise<Response> Parameters
- request: Request<unknown, CfProperties<unknown>>
- env: Environment
- ctx: ExecutionContext
Returns Promise<Response>
Optional
onSchedule
- onSchedule(
event: ScheduledController,
env: Environment,
ctx: ExecutionContext,
): Promise<void> Parameters
- event: ScheduledController
- env: Environment
- ctx: ExecutionContext
Optional
onTaskError
- onTaskError(error: unknown, task: Task): void
Returns void
The options for the ORM.