rivetkit 0.0.0-sqlite-sync-3-0-1-final.5663d2f → 0.0.0-sqlite-sync-3-0-6-final.cf8679c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client.d.ts +103 -27
- package/dist/browser/client.js +2 -2
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/{chunk-DGU2H5IJ.cjs → chunk-275ZGRSG.cjs} +3 -3
- package/dist/tsup/{chunk-DGU2H5IJ.cjs.map → chunk-275ZGRSG.cjs.map} +1 -1
- package/dist/tsup/{chunk-X567WA3N.cjs → chunk-E54YPM4V.cjs} +10 -10
- package/dist/tsup/{chunk-X567WA3N.cjs.map → chunk-E54YPM4V.cjs.map} +1 -1
- package/dist/tsup/{chunk-6UDO6UYM.cjs → chunk-I26AW6BG.cjs} +2 -2
- package/dist/tsup/{chunk-6UDO6UYM.cjs.map → chunk-I26AW6BG.cjs.map} +1 -1
- package/dist/tsup/{chunk-C2NON6V4.cjs → chunk-JHHUCWBC.cjs} +7 -7
- package/dist/tsup/{chunk-C2NON6V4.cjs.map → chunk-JHHUCWBC.cjs.map} +1 -1
- package/dist/tsup/{chunk-XLD6TRSE.cjs → chunk-LYXPQB6H.cjs} +3 -3
- package/dist/tsup/{chunk-XLD6TRSE.cjs.map → chunk-LYXPQB6H.cjs.map} +1 -1
- package/dist/tsup/{chunk-DU7V4SDK.js → chunk-M72ZKQ7R.js} +2 -2
- package/dist/tsup/{chunk-DU7V4SDK.js.map → chunk-M72ZKQ7R.js.map} +1 -1
- package/dist/tsup/{chunk-3ZKCK6NL.js → chunk-ME74LHJM.js} +7 -7
- package/dist/tsup/chunk-ME74LHJM.js.map +1 -0
- package/dist/tsup/{chunk-UXDASKP6.js → chunk-PBIQPYE5.js} +12 -13
- package/dist/tsup/chunk-PBIQPYE5.js.map +1 -0
- package/dist/tsup/{chunk-TTMWSZZA.js → chunk-R4QCQBB4.js} +2 -2
- package/dist/tsup/{chunk-GAFMEUAL.js → chunk-RJ7WDGOJ.js} +3 -3
- package/dist/tsup/{chunk-YJ2X5STT.cjs → chunk-SJJWJU26.cjs} +145 -145
- package/dist/tsup/chunk-SJJWJU26.cjs.map +1 -0
- package/dist/tsup/{chunk-SEKTNJU6.js → chunk-SSMFNH4N.js} +4 -4
- package/dist/tsup/{chunk-EKERHPCE.cjs → chunk-TKCX6KNZ.cjs} +4 -4
- package/dist/tsup/{chunk-EKERHPCE.cjs.map → chunk-TKCX6KNZ.cjs.map} +1 -1
- package/dist/tsup/{chunk-G26OT2Q6.cjs → chunk-TVBQQXQE.cjs} +3 -3
- package/dist/tsup/{chunk-G26OT2Q6.cjs.map → chunk-TVBQQXQE.cjs.map} +1 -1
- package/dist/tsup/{chunk-YNAEH775.js → chunk-VXVJHTW6.js} +2 -2
- package/dist/tsup/{chunk-MT4SROQM.js → chunk-XATHAIZX.js} +2 -2
- package/dist/tsup/{chunk-T7DJZSPH.js → chunk-Y5TV6V5Z.js} +2 -2
- package/dist/tsup/{chunk-SSF2XC33.cjs → chunk-YWWDUC6D.cjs} +12 -13
- package/dist/tsup/chunk-YWWDUC6D.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +3 -3
- package/dist/tsup/client/mod.d.ts +3 -3
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-RMLak20L.d.cts → config-5K0rzjv1.d.cts} +57 -25
- package/dist/tsup/{config-BfG1qpYz.d.ts → config-Df5jOcde.d.cts} +50 -8
- package/dist/tsup/{config-BfG1qpYz.d.cts → config-Df5jOcde.d.ts} +50 -8
- package/dist/tsup/{config-CASGH-5t.d.ts → config-DsAjIyfZ.d.ts} +57 -25
- package/dist/tsup/{context-C1tMYvV-.d.ts → context-B19Rx5Zg.d.cts} +5 -2
- package/dist/tsup/{context-CxNE2KvK.d.cts → context-BEh8x4jn.d.ts} +5 -2
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.d.cts +1 -1
- package/dist/tsup/db/drizzle.d.ts +1 -1
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.d.cts +2 -2
- package/dist/tsup/db/mod.d.ts +2 -2
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +255 -135
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +6 -4
- package/dist/tsup/mod.d.ts +6 -4
- package/dist/tsup/mod.js +152 -32
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +2 -2
- package/dist/tsup/test/mod.d.ts +2 -2
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/unstable/migrations.d.cts +1 -1
- package/dist/tsup/unstable/migrations.d.ts +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +13 -10
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +8 -5
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +9 -9
- package/src/actor/config.ts +41 -29
- package/src/actor/contexts/index.ts +2 -0
- package/src/actor/definition.ts +33 -1
- package/src/actor/schema.ts +4 -0
- package/src/client/actor-common.ts +4 -0
- package/src/client/actor-conn.ts +2 -0
- package/src/client/actor-handle.ts +2 -0
- package/src/client/config.ts +1 -1
- package/src/client/queue.ts +2 -0
- package/src/common/database/config.ts +50 -7
- package/src/db/mod.ts +1 -0
- package/src/registry/index.ts +142 -1
- package/src/registry/napi-runtime.ts +15 -4
- package/src/registry/native.ts +4 -11
- package/src/registry/runtime.ts +6 -8
- package/src/registry/wasm-runtime.ts +0 -14
- package/src/workflow/context.ts +3 -0
- package/dist/tsup/chunk-3ZKCK6NL.js.map +0 -1
- package/dist/tsup/chunk-SSF2XC33.cjs.map +0 -1
- package/dist/tsup/chunk-UXDASKP6.js.map +0 -1
- package/dist/tsup/chunk-YJ2X5STT.cjs.map +0 -1
- package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +0 -848
- /package/dist/tsup/{chunk-TTMWSZZA.js.map → chunk-R4QCQBB4.js.map} +0 -0
- /package/dist/tsup/{chunk-GAFMEUAL.js.map → chunk-RJ7WDGOJ.js.map} +0 -0
- /package/dist/tsup/{chunk-SEKTNJU6.js.map → chunk-SSMFNH4N.js.map} +0 -0
- /package/dist/tsup/{chunk-YNAEH775.js.map → chunk-VXVJHTW6.js.map} +0 -0
- /package/dist/tsup/{chunk-MT4SROQM.js.map → chunk-XATHAIZX.js.map} +0 -0
- /package/dist/tsup/{chunk-T7DJZSPH.js.map → chunk-Y5TV6V5Z.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import { A as AnyDatabaseProvider, a as SqliteProfilingOptions, f as SqliteNativeMetrics, I as InferDatabaseClient } from './config-
|
|
2
|
+
import { A as AnyDatabaseProvider, a as SqliteProfilingOptions, f as SqliteNativeMetrics, I as InferDatabaseClient } from './config-Df5jOcde.cjs';
|
|
3
3
|
import * as _rivetkit_rivetkit_wasm from '@rivetkit/rivetkit-wasm';
|
|
4
4
|
import { z as z$1 } from 'zod';
|
|
5
5
|
import { Logger } from 'pino';
|
|
@@ -420,6 +420,7 @@ interface EventTypeToken<T, TContext = any> {
|
|
|
420
420
|
interface QueueTypeToken<TMessage, TComplete = never, TContext = any> {
|
|
421
421
|
readonly _queueMessage?: TMessage;
|
|
422
422
|
readonly _queueComplete?: TComplete;
|
|
423
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
423
424
|
readonly canPublish?: SchemaHook<TContext>;
|
|
424
425
|
readonly message?: PrimitiveSchema;
|
|
425
426
|
readonly complete?: PrimitiveSchema;
|
|
@@ -431,11 +432,13 @@ interface EventOptions<TContext = any> {
|
|
|
431
432
|
schema?: PrimitiveSchema;
|
|
432
433
|
}
|
|
433
434
|
interface QueueOptions<TContext = any> {
|
|
435
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
434
436
|
canPublish?: SchemaHook<TContext>;
|
|
435
437
|
message?: PrimitiveSchema;
|
|
436
438
|
complete?: PrimitiveSchema;
|
|
437
439
|
}
|
|
438
440
|
declare function event<T, TContext = any>(options?: EventOptions<TContext>): EventTypeToken<T, TContext>;
|
|
441
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
439
442
|
declare function queue<TMessage, TComplete = never, TContext = any>(options?: QueueOptions<TContext>): QueueTypeToken<TMessage, TComplete, TContext>;
|
|
440
443
|
type PrimitiveSchema = StandardSchemaV1 | EventTypeToken<unknown, any>;
|
|
441
444
|
interface EventSchemaDefinition<TContext = any> {
|
|
@@ -445,6 +448,7 @@ interface EventSchemaDefinition<TContext = any> {
|
|
|
445
448
|
interface QueueSchemaDefinition<TContext = any> {
|
|
446
449
|
message: PrimitiveSchema;
|
|
447
450
|
complete?: PrimitiveSchema;
|
|
451
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
448
452
|
canPublish?: SchemaHook<TContext>;
|
|
449
453
|
}
|
|
450
454
|
type EventSchema<TContext = any> = PrimitiveSchema | EventSchemaDefinition<TContext>;
|
|
@@ -786,9 +790,6 @@ type RuntimeSqlBindParam = ({
|
|
|
786
790
|
blobValue: RuntimeBytes;
|
|
787
791
|
};
|
|
788
792
|
type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
|
|
789
|
-
interface RuntimeActorRuntimeSocketEndpointInfo {
|
|
790
|
-
path: string;
|
|
791
|
-
}
|
|
792
793
|
interface RuntimeSqlQueryResult {
|
|
793
794
|
columns: string[];
|
|
794
795
|
rows: unknown[][];
|
|
@@ -819,7 +820,6 @@ interface RuntimeActorConfig {
|
|
|
819
820
|
sqliteDeferredCommits?: boolean;
|
|
820
821
|
sqliteProfiling?: SqliteProfilingOptions;
|
|
821
822
|
tracing?: RuntimeActorTracingConfig;
|
|
822
|
-
enableActorRuntimeSocket?: boolean;
|
|
823
823
|
hasState?: boolean;
|
|
824
824
|
canHibernateWebsocket?: boolean;
|
|
825
825
|
stateSaveIntervalMs?: number;
|
|
@@ -954,6 +954,8 @@ interface CoreRuntime {
|
|
|
954
954
|
shutdownRegistry(registry: RegistryHandle): Promise<void>;
|
|
955
955
|
shutdownTelemetry?(): Promise<void>;
|
|
956
956
|
registryActorStopThresholdMs?(registry: RegistryHandle): Promise<number | undefined>;
|
|
957
|
+
registryActiveActorCount?(registry: RegistryHandle): number;
|
|
958
|
+
onRegistryActiveActorCountChange?(registry: RegistryHandle, callback: (count: number) => void, cancelToken: CancellationTokenHandle): void;
|
|
957
959
|
handleServerlessRequest(registry: RegistryHandle, req: RuntimeServerlessRequest, onStreamEvent: RuntimeServerlessStreamCallback, cancelToken: CancellationTokenHandle, config: RuntimeServeConfig): Promise<RuntimeServerlessResponseHead>;
|
|
958
960
|
serveListener(registry: RegistryHandle, listener: RuntimeListenerConfig, config: RuntimeServeConfig): Promise<void>;
|
|
959
961
|
serveApplicationListener(registry: RegistryHandle, listener: RuntimeApplicationListenerConfig, config: RuntimeServeConfig): Promise<void>;
|
|
@@ -1073,7 +1075,6 @@ interface CoreRuntime {
|
|
|
1073
1075
|
actorSqlWhenDurable(ctx: ActorContextHandle, ticket: number): Promise<void>;
|
|
1074
1076
|
actorSqlAbortGeneration(ctx: ActorContextHandle, reason: string): void;
|
|
1075
1077
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
1076
|
-
actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
|
|
1077
1078
|
actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
|
|
1078
1079
|
actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
|
|
1079
1080
|
actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
|
|
@@ -1230,6 +1231,24 @@ declare class Registry<A extends RegistryActors> {
|
|
|
1230
1231
|
* ```
|
|
1231
1232
|
*/
|
|
1232
1233
|
start(): void;
|
|
1234
|
+
/**
|
|
1235
|
+
* Returns the number of actors hosted by this process's envoy, which is zero
|
|
1236
|
+
* while it is not serving. Requires the native runtime.
|
|
1237
|
+
*/
|
|
1238
|
+
activeActorCount(): number;
|
|
1239
|
+
/**
|
|
1240
|
+
* Calls `callback` with the number of actors hosted by this process's envoy
|
|
1241
|
+
* and again whenever it changes. Rapid changes may coalesce.
|
|
1242
|
+
* Returns a function that unsubscribes. Requires the native runtime.
|
|
1243
|
+
*
|
|
1244
|
+
* @example
|
|
1245
|
+
* ```ts
|
|
1246
|
+
* const unsubscribe = registry.onActiveActorCountChange((count) => {
|
|
1247
|
+
* setTaskProtection(count > 0);
|
|
1248
|
+
* });
|
|
1249
|
+
* ```
|
|
1250
|
+
*/
|
|
1251
|
+
onActiveActorCountChange(callback: (count: number) => void): () => void;
|
|
1233
1252
|
}
|
|
1234
1253
|
declare function setup<A extends RegistryActors>(input: RegistryConfigInput<A>): Registry<A>;
|
|
1235
1254
|
|
|
@@ -1280,9 +1299,13 @@ type ActorWebSocketOptions = ActorGatewayOptions;
|
|
|
1280
1299
|
*/
|
|
1281
1300
|
type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : ActorActionMap<ActionsOf<AD>>;
|
|
1282
1301
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
1302
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1283
1303
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options: QueueSendWaitOptions): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
|
|
1304
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1284
1305
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1306
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1285
1307
|
(name: keyof TQueues extends never ? string : never, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1308
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1286
1309
|
(name: keyof TQueues extends never ? string : never, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1287
1310
|
};
|
|
1288
1311
|
type ActorEventSubscribe<TEvents extends EventSchemaConfig> = {
|
|
@@ -1366,7 +1389,9 @@ declare class ActorConnRaw {
|
|
|
1366
1389
|
* @protected
|
|
1367
1390
|
*/
|
|
1368
1391
|
constructor(client: ClientRaw, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, currentActorInvocation?: CurrentActorInvocation);
|
|
1392
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1369
1393
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1394
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1370
1395
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1371
1396
|
/**
|
|
1372
1397
|
* Call a raw action connection. See {@link ActorConn} for type-safe action calls.
|
|
@@ -1523,7 +1548,9 @@ declare class ActorHandleRaw {
|
|
|
1523
1548
|
* @protected
|
|
1524
1549
|
*/
|
|
1525
1550
|
constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan, retryBudget?: RetryBudget);
|
|
1551
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1526
1552
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1553
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1527
1554
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1528
1555
|
/**
|
|
1529
1556
|
* Call a raw action. This method sends an HTTP request to invoke the named action.
|
|
@@ -1877,10 +1904,7 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
|
|
|
1877
1904
|
limit?: number;
|
|
1878
1905
|
};
|
|
1879
1906
|
type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
|
|
1880
|
-
/**
|
|
1881
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
1882
|
-
* or actor state instead.
|
|
1883
|
-
*/
|
|
1907
|
+
/** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
|
|
1884
1908
|
interface ActorKv {
|
|
1885
1909
|
get<T extends ActorKvValueType = "text">(key: Uint8Array | string, options?: ActorKvValueOptions<T>): Promise<ActorKvValueTypeMap[T] | null>;
|
|
1886
1910
|
put<T extends ActorKvValueType = "text">(key: Uint8Array | string, value: Uint8Array | string | ArrayBuffer, options?: ActorKvValueOptions<T>): Promise<void>;
|
|
@@ -2025,6 +2049,7 @@ interface QueueIterOptions<TName extends string = string, TCompletable extends b
|
|
|
2025
2049
|
signal?: AbortSignal;
|
|
2026
2050
|
completable?: TCompletable;
|
|
2027
2051
|
}
|
|
2052
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
2028
2053
|
interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
2029
2054
|
send<TName extends QueueFilterName<TQueues>>(name: TName, body: QueueMessageForName<TQueues, TName>["body"]): Promise<any>;
|
|
2030
2055
|
next<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextOptions<TName, TCompletable>): Promise<any>;
|
|
@@ -2046,6 +2071,7 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
|
2046
2071
|
interface Conn<_TState = unknown, TConnParams = unknown, TConnState = unknown, _TVars = unknown, _TInput = unknown, _TDatabase extends AnyDatabaseProvider = AnyDatabaseProvider, _TEvents extends EventSchemaConfig = Record<never, never>, _TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
2047
2072
|
id: string;
|
|
2048
2073
|
params: TConnParams;
|
|
2074
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2049
2075
|
state: TConnState;
|
|
2050
2076
|
isHibernatable: boolean;
|
|
2051
2077
|
send(name: string, ...args: any[]): void;
|
|
@@ -2057,16 +2083,15 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2057
2083
|
[ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
|
|
2058
2084
|
/** Returns the raw unwrapped state without the write-through proxy. */
|
|
2059
2085
|
[RAW_STATE_SYMBOL](): TState;
|
|
2086
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2060
2087
|
state: TState;
|
|
2061
2088
|
vars: TVars;
|
|
2062
|
-
/**
|
|
2063
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
2064
|
-
* or actor state instead.
|
|
2065
|
-
*/
|
|
2089
|
+
/** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
|
|
2066
2090
|
readonly kv: ActorKv;
|
|
2067
2091
|
readonly db: InferDatabaseClient<TDatabase>;
|
|
2068
2092
|
readonly schedule: ActorSchedule;
|
|
2069
2093
|
readonly cron: ActorCron;
|
|
2094
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
2070
2095
|
readonly queue: ActorQueue<TQueues>;
|
|
2071
2096
|
/** @experimental */
|
|
2072
2097
|
readonly run: ActorRun;
|
|
@@ -2074,25 +2099,22 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2074
2099
|
readonly name: string;
|
|
2075
2100
|
readonly key: string[];
|
|
2076
2101
|
readonly region: string;
|
|
2077
|
-
/** Provisions the experimental Actor Runtime Socket for this actor generation. */
|
|
2078
|
-
actorRuntimeSocket(): Promise<{
|
|
2079
|
-
path: string;
|
|
2080
|
-
}>;
|
|
2081
2102
|
readonly conns: Map<string, Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>;
|
|
2082
2103
|
readonly log: ActorLogger;
|
|
2083
2104
|
readonly abortSignal: AbortSignal;
|
|
2084
2105
|
readonly aborted: boolean;
|
|
2085
2106
|
readonly request?: Request;
|
|
2086
|
-
/** @deprecated
|
|
2107
|
+
/** @deprecated `preventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op that always returns `false`. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
2087
2108
|
readonly preventSleep: boolean;
|
|
2088
2109
|
broadcast(name: string, ...args: any[]): void;
|
|
2110
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2089
2111
|
saveState(opts?: {
|
|
2090
2112
|
immediate?: boolean;
|
|
2091
2113
|
maxWait?: number;
|
|
2092
2114
|
}): Promise<void>;
|
|
2093
2115
|
keepAwake<T>(promise: Promise<T>): Promise<T>;
|
|
2094
2116
|
waitUntil(promise: Promise<unknown>): void;
|
|
2095
|
-
/** @deprecated
|
|
2117
|
+
/** @deprecated `setPreventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
2096
2118
|
setPreventSleep(preventSleep: boolean): void;
|
|
2097
2119
|
sleep(): void;
|
|
2098
2120
|
destroy(): void;
|
|
@@ -2144,6 +2166,7 @@ type ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase ext
|
|
|
2144
2166
|
type BeforeActionResponseContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2145
2167
|
type BeforeConnectContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2146
2168
|
type ConnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2169
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2147
2170
|
type CreateConnStateContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2148
2171
|
type CreateContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, unknown, TInput, TDatabase, TEvents, TQueues>;
|
|
2149
2172
|
type CreateVarsContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = CreateContext<TState, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2152,6 +2175,7 @@ type DisconnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2152
2175
|
type RequestContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2153
2176
|
type RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2154
2177
|
type SleepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2178
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2155
2179
|
type StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2156
2180
|
type WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2157
2181
|
type MigrateContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2335,7 +2359,6 @@ declare function disposeRunInspector(run: ((...args: any[]) => any) | AnyRunConf
|
|
|
2335
2359
|
declare const GlobalActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
|
|
2336
2360
|
name: z.ZodOptional<z.ZodString>;
|
|
2337
2361
|
icon: z.ZodOptional<z.ZodString>;
|
|
2338
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2339
2362
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2340
2363
|
}, z.core.$strict>>;
|
|
2341
2364
|
type GlobalActorOptions = z.infer<typeof GlobalActorOptionsSchema>;
|
|
@@ -2366,7 +2389,6 @@ type InstanceActorOptionsInput = z.input<typeof InstanceActorOptionsSchema>;
|
|
|
2366
2389
|
declare const ActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
|
|
2367
2390
|
name: z.ZodOptional<z.ZodString>;
|
|
2368
2391
|
icon: z.ZodOptional<z.ZodString>;
|
|
2369
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2370
2392
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2371
2393
|
createVarsTimeout: z.ZodDefault<z.ZodNumber>;
|
|
2372
2394
|
createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2435,7 +2457,6 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2435
2457
|
options: z.ZodPrefault<z.ZodObject<{
|
|
2436
2458
|
name: z.ZodOptional<z.ZodString>;
|
|
2437
2459
|
icon: z.ZodOptional<z.ZodString>;
|
|
2438
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2439
2460
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2440
2461
|
createVarsTimeout: z.ZodDefault<z.ZodNumber>;
|
|
2441
2462
|
createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2479,13 +2500,17 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2479
2500
|
}, z.core.$strict>>;
|
|
2480
2501
|
}, z.core.$strict>;
|
|
2481
2502
|
type CreateState<TState, _TConnParams, _TConnState, _TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2503
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2482
2504
|
state: TState;
|
|
2483
2505
|
} | {
|
|
2506
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2484
2507
|
createState: (c: CreateContext<TState, TInput, TDatabase, TEvents, TQueues>, input: TInput) => TState | Promise<TState>;
|
|
2485
2508
|
} | Record<never, never>;
|
|
2486
2509
|
type CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2510
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2487
2511
|
connState: TConnState;
|
|
2488
2512
|
} | {
|
|
2513
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2489
2514
|
createConnState: (c: CreateConnStateContext<TState, TVars, TInput, TDatabase, TEvents, TQueues>, params: TConnParams) => TConnState | Promise<TConnState>;
|
|
2490
2515
|
} | Record<never, never>;
|
|
2491
2516
|
/**
|
|
@@ -2576,6 +2601,12 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2576
2601
|
*
|
|
2577
2602
|
* Can be either a function or a RunConfig object with optional name/icon metadata.
|
|
2578
2603
|
*
|
|
2604
|
+
* Passing a plain function was deprecated in 3.0 and will be removed in a
|
|
2605
|
+
* future version; it logs a warning at startup. Start background work from
|
|
2606
|
+
* `onWake` with `c.keepAwake` and track it in `c.vars` instead.
|
|
2607
|
+
* `run: workflow(...)` is not deprecated. See
|
|
2608
|
+
* https://rivet.dev/actors/docs/deprecated/run
|
|
2609
|
+
*
|
|
2579
2610
|
* @returns Void or a Promise.
|
|
2580
2611
|
*/
|
|
2581
2612
|
run?: ((c: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => void | Promise<void>) | RunConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2589,6 +2620,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2589
2620
|
* another onStateChange call, preventing infinite recursion.
|
|
2590
2621
|
*
|
|
2591
2622
|
* @param newState The updated state
|
|
2623
|
+
* @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state
|
|
2592
2624
|
*/
|
|
2593
2625
|
onStateChange?: (c: StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, newState: TState) => void;
|
|
2594
2626
|
/**
|
|
@@ -2681,6 +2713,8 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2681
2713
|
events?: TEvents;
|
|
2682
2714
|
/**
|
|
2683
2715
|
* Schema map for queue payloads sent by this actor.
|
|
2716
|
+
*
|
|
2717
|
+
* @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues
|
|
2684
2718
|
*/
|
|
2685
2719
|
queues?: TQueues;
|
|
2686
2720
|
}
|
|
@@ -2698,7 +2732,6 @@ declare function test<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2698
2732
|
declare const DocActorOptionsSchema: z.ZodObject<{
|
|
2699
2733
|
name: z.ZodOptional<z.ZodString>;
|
|
2700
2734
|
icon: z.ZodOptional<z.ZodString>;
|
|
2701
|
-
enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
|
|
2702
2735
|
createVarsTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2703
2736
|
createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2704
2737
|
onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2748,7 +2781,6 @@ declare const DocActorConfigSchema: z.ZodObject<{
|
|
|
2748
2781
|
options: z.ZodOptional<z.ZodObject<{
|
|
2749
2782
|
name: z.ZodOptional<z.ZodString>;
|
|
2750
2783
|
icon: z.ZodOptional<z.ZodString>;
|
|
2751
|
-
enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
|
|
2752
2784
|
createVarsTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2753
2785
|
createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2754
2786
|
onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
@@ -41,13 +41,16 @@ interface SqliteTransactionOptions {
|
|
|
41
41
|
* to change without notice.
|
|
42
42
|
*/
|
|
43
43
|
interface SqliteProfilingOptions {
|
|
44
|
-
/** Exact SQL
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
/** Exact SQL filter. Union with filterQueryFingerprints; both empty means all queries. */
|
|
45
|
+
filterQueries?: string[];
|
|
46
|
+
/** Fingerprint filter, including transaction fingerprints. Filters metrics, not diagnostic logs. */
|
|
47
|
+
filterQueryFingerprints?: string[];
|
|
48
|
+
/** Metric defaults apply even when omitted. Disabled metrics allocate no series. */
|
|
49
|
+
metrics?: SqliteProfilingMetricsOptions;
|
|
50
|
+
/** Duration buckets in seconds. Default [0.01, 0.1, 1]. Positive, finite, strictly increasing.
|
|
51
|
+
* All actors in a process enabling the duration histogram must use identical buckets. */
|
|
52
|
+
durationHistogramBucketsSeconds?: number[];
|
|
53
|
+
/** Maximum distinct statement fingerprints per process. Default: 512. */
|
|
51
54
|
maxTrackedStatementFingerprints?: number;
|
|
52
55
|
maxTrackedTransactionFingerprints?: number;
|
|
53
56
|
maxPrometheusSeries?: number;
|
|
@@ -59,6 +62,45 @@ interface SqliteProfilingOptions {
|
|
|
59
62
|
maxDiagnosticEventsPerMinute?: number;
|
|
60
63
|
diagnosticEventQueueCapacity?: number;
|
|
61
64
|
}
|
|
65
|
+
/** SQLite profiling metrics. Physical-request metrics and gauges have no query labels. */
|
|
66
|
+
interface SqliteProfilingMetricsOptions {
|
|
67
|
+
/** Execution count and cumulative seconds. Uses histogram count/sum when enabled, otherwise counters. Default: true. */
|
|
68
|
+
duration?: boolean;
|
|
69
|
+
/** Execution duration histogram. Only applies when duration is enabled. Default: true. */
|
|
70
|
+
durationHistogram?: boolean;
|
|
71
|
+
/** Outcome counters, including success and errors. Default: true. */
|
|
72
|
+
outcomes?: boolean;
|
|
73
|
+
/** Per-query timing phase histograms. Default: false. */
|
|
74
|
+
phaseDurationHistogram?: boolean;
|
|
75
|
+
/** Storage round trips per operation histogram. Default: false. */
|
|
76
|
+
getPagesRoundTripsHistogram?: boolean;
|
|
77
|
+
/** Statements per transaction histogram. Default: false. */
|
|
78
|
+
transactionStatementCountHistogram?: boolean;
|
|
79
|
+
/** Per-query pages returned from storage, including returned prefetch pages. Default: true. */
|
|
80
|
+
pagesFetched?: boolean;
|
|
81
|
+
/** Actor-level page counters by page kind (no query labels). Default: false. */
|
|
82
|
+
localPages?: boolean;
|
|
83
|
+
/** Actor-level byte counters by byte kind (no query labels). Default: false. */
|
|
84
|
+
localBytes?: boolean;
|
|
85
|
+
/** Actor-level physical storage request duration histogram. Default: false. */
|
|
86
|
+
getPagesDurationHistogram?: boolean;
|
|
87
|
+
/** Actor-level pages per storage request histograms, by page kind. Default: false. */
|
|
88
|
+
getPagesPagesHistogram?: boolean;
|
|
89
|
+
/** Actor-level storage response byte histogram. Default: false. */
|
|
90
|
+
getPagesResponseBytesHistogram?: boolean;
|
|
91
|
+
/** Actor-level missing response page counter. Default: false. */
|
|
92
|
+
getPagesMissingPages?: boolean;
|
|
93
|
+
/** Queued SQLite work, aggregated by actor name. Default: true. */
|
|
94
|
+
workerQueueDepth?: boolean;
|
|
95
|
+
/** Executing SQLite work, aggregated by actor name. Default: true. */
|
|
96
|
+
workerInflight?: boolean;
|
|
97
|
+
/** Transaction waiters, aggregated by actor name. Default: true. */
|
|
98
|
+
coordinatorQueueDepth?: boolean;
|
|
99
|
+
/** Counts observations exceeding fingerprint or series limits. Default: true. */
|
|
100
|
+
fingerprintOverflow?: boolean;
|
|
101
|
+
/** Counts diagnostic events dropped by rate limits or backpressure. Default: true. */
|
|
102
|
+
eventDropped?: boolean;
|
|
103
|
+
}
|
|
62
104
|
interface SqliteNativeMetrics {
|
|
63
105
|
requestBuildNs: number;
|
|
64
106
|
serializeNs: number;
|
|
@@ -205,4 +247,4 @@ type RawAccess = {
|
|
|
205
247
|
close: () => Promise<void>;
|
|
206
248
|
};
|
|
207
249
|
|
|
208
|
-
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f,
|
|
250
|
+
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f, SqliteProfilingMetricsOptions as g, SqliteQueryResult as h };
|
|
@@ -41,13 +41,16 @@ interface SqliteTransactionOptions {
|
|
|
41
41
|
* to change without notice.
|
|
42
42
|
*/
|
|
43
43
|
interface SqliteProfilingOptions {
|
|
44
|
-
/** Exact SQL
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
/** Exact SQL filter. Union with filterQueryFingerprints; both empty means all queries. */
|
|
45
|
+
filterQueries?: string[];
|
|
46
|
+
/** Fingerprint filter, including transaction fingerprints. Filters metrics, not diagnostic logs. */
|
|
47
|
+
filterQueryFingerprints?: string[];
|
|
48
|
+
/** Metric defaults apply even when omitted. Disabled metrics allocate no series. */
|
|
49
|
+
metrics?: SqliteProfilingMetricsOptions;
|
|
50
|
+
/** Duration buckets in seconds. Default [0.01, 0.1, 1]. Positive, finite, strictly increasing.
|
|
51
|
+
* All actors in a process enabling the duration histogram must use identical buckets. */
|
|
52
|
+
durationHistogramBucketsSeconds?: number[];
|
|
53
|
+
/** Maximum distinct statement fingerprints per process. Default: 512. */
|
|
51
54
|
maxTrackedStatementFingerprints?: number;
|
|
52
55
|
maxTrackedTransactionFingerprints?: number;
|
|
53
56
|
maxPrometheusSeries?: number;
|
|
@@ -59,6 +62,45 @@ interface SqliteProfilingOptions {
|
|
|
59
62
|
maxDiagnosticEventsPerMinute?: number;
|
|
60
63
|
diagnosticEventQueueCapacity?: number;
|
|
61
64
|
}
|
|
65
|
+
/** SQLite profiling metrics. Physical-request metrics and gauges have no query labels. */
|
|
66
|
+
interface SqliteProfilingMetricsOptions {
|
|
67
|
+
/** Execution count and cumulative seconds. Uses histogram count/sum when enabled, otherwise counters. Default: true. */
|
|
68
|
+
duration?: boolean;
|
|
69
|
+
/** Execution duration histogram. Only applies when duration is enabled. Default: true. */
|
|
70
|
+
durationHistogram?: boolean;
|
|
71
|
+
/** Outcome counters, including success and errors. Default: true. */
|
|
72
|
+
outcomes?: boolean;
|
|
73
|
+
/** Per-query timing phase histograms. Default: false. */
|
|
74
|
+
phaseDurationHistogram?: boolean;
|
|
75
|
+
/** Storage round trips per operation histogram. Default: false. */
|
|
76
|
+
getPagesRoundTripsHistogram?: boolean;
|
|
77
|
+
/** Statements per transaction histogram. Default: false. */
|
|
78
|
+
transactionStatementCountHistogram?: boolean;
|
|
79
|
+
/** Per-query pages returned from storage, including returned prefetch pages. Default: true. */
|
|
80
|
+
pagesFetched?: boolean;
|
|
81
|
+
/** Actor-level page counters by page kind (no query labels). Default: false. */
|
|
82
|
+
localPages?: boolean;
|
|
83
|
+
/** Actor-level byte counters by byte kind (no query labels). Default: false. */
|
|
84
|
+
localBytes?: boolean;
|
|
85
|
+
/** Actor-level physical storage request duration histogram. Default: false. */
|
|
86
|
+
getPagesDurationHistogram?: boolean;
|
|
87
|
+
/** Actor-level pages per storage request histograms, by page kind. Default: false. */
|
|
88
|
+
getPagesPagesHistogram?: boolean;
|
|
89
|
+
/** Actor-level storage response byte histogram. Default: false. */
|
|
90
|
+
getPagesResponseBytesHistogram?: boolean;
|
|
91
|
+
/** Actor-level missing response page counter. Default: false. */
|
|
92
|
+
getPagesMissingPages?: boolean;
|
|
93
|
+
/** Queued SQLite work, aggregated by actor name. Default: true. */
|
|
94
|
+
workerQueueDepth?: boolean;
|
|
95
|
+
/** Executing SQLite work, aggregated by actor name. Default: true. */
|
|
96
|
+
workerInflight?: boolean;
|
|
97
|
+
/** Transaction waiters, aggregated by actor name. Default: true. */
|
|
98
|
+
coordinatorQueueDepth?: boolean;
|
|
99
|
+
/** Counts observations exceeding fingerprint or series limits. Default: true. */
|
|
100
|
+
fingerprintOverflow?: boolean;
|
|
101
|
+
/** Counts diagnostic events dropped by rate limits or backpressure. Default: true. */
|
|
102
|
+
eventDropped?: boolean;
|
|
103
|
+
}
|
|
62
104
|
interface SqliteNativeMetrics {
|
|
63
105
|
requestBuildNs: number;
|
|
64
106
|
serializeNs: number;
|
|
@@ -205,4 +247,4 @@ type RawAccess = {
|
|
|
205
247
|
close: () => Promise<void>;
|
|
206
248
|
};
|
|
207
249
|
|
|
208
|
-
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f,
|
|
250
|
+
export type { AnyDatabaseProvider as A, DatabaseProvider as D, InferDatabaseClient as I, NativeDatabaseProvider as N, RawAccess as R, SqliteTransactionOptions as S, SqliteProfilingOptions as a, DatabaseProviderContext as b, RawDatabaseClient as c, SqliteBindings as d, SqliteDatabase as e, SqliteNativeMetrics as f, SqliteProfilingMetricsOptions as g, SqliteQueryResult as h };
|