rivetkit 0.0.0-sqlite-query-metrics-v3.1dff84f → 0.0.0-sqlite-sync-3-0-1-final.5663d2f
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 +48 -49
- package/dist/browser/client.js +1 -1
- 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-QQIFRR3B.js → chunk-3ZKCK6NL.js} +3 -3
- package/dist/tsup/{chunk-Y4QLVCCS.cjs → chunk-6UDO6UYM.cjs} +2 -2
- package/dist/tsup/{chunk-Y4QLVCCS.cjs.map → chunk-6UDO6UYM.cjs.map} +1 -1
- package/dist/tsup/{chunk-CWN7N5AF.cjs → chunk-C2NON6V4.cjs} +7 -7
- package/dist/tsup/{chunk-CWN7N5AF.cjs.map → chunk-C2NON6V4.cjs.map} +1 -1
- package/dist/tsup/{chunk-HXJ5U2ZI.cjs → chunk-DGU2H5IJ.cjs} +3 -3
- package/dist/tsup/{chunk-HXJ5U2ZI.cjs.map → chunk-DGU2H5IJ.cjs.map} +1 -1
- package/dist/tsup/{chunk-NNCL4IBC.js → chunk-DU7V4SDK.js} +2 -2
- package/dist/tsup/{chunk-NNCL4IBC.js.map → chunk-DU7V4SDK.js.map} +1 -1
- package/dist/tsup/{chunk-Y5CFDGPA.cjs → chunk-EKERHPCE.cjs} +4 -4
- package/dist/tsup/{chunk-Y5CFDGPA.cjs.map → chunk-EKERHPCE.cjs.map} +1 -1
- package/dist/tsup/{chunk-JJUSO7GJ.cjs → chunk-G26OT2Q6.cjs} +3 -3
- package/dist/tsup/{chunk-JJUSO7GJ.cjs.map → chunk-G26OT2Q6.cjs.map} +1 -1
- package/dist/tsup/{chunk-SW33HMM5.js → chunk-GAFMEUAL.js} +3 -3
- package/dist/tsup/{chunk-FT6VRK4C.js → chunk-MT4SROQM.js} +2 -2
- package/dist/tsup/{chunk-HRKFVQPS.js → chunk-SEKTNJU6.js} +4 -4
- package/dist/tsup/{chunk-D7DWNYEO.js → chunk-T7DJZSPH.js} +2 -2
- package/dist/tsup/{chunk-2CTZU7GL.js → chunk-TTMWSZZA.js} +2 -2
- package/dist/tsup/{chunk-HFGXV2CC.cjs → chunk-X567WA3N.cjs} +10 -10
- package/dist/tsup/{chunk-HFGXV2CC.cjs.map → chunk-X567WA3N.cjs.map} +1 -1
- package/dist/tsup/{chunk-22S5RCCJ.cjs → chunk-XLD6TRSE.cjs} +3 -3
- package/dist/tsup/{chunk-22S5RCCJ.cjs.map → chunk-XLD6TRSE.cjs.map} +1 -1
- package/dist/tsup/{chunk-NG5CUXMM.cjs → chunk-YJ2X5STT.cjs} +143 -143
- package/dist/tsup/{chunk-NG5CUXMM.cjs.map → chunk-YJ2X5STT.cjs.map} +1 -1
- package/dist/tsup/{chunk-F5PWAGS7.js → chunk-YNAEH775.js} +2 -2
- 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-CBTr4IhE.d.cts → config-BfG1qpYz.d.cts} +34 -50
- package/dist/tsup/{config-CBTr4IhE.d.ts → config-BfG1qpYz.d.ts} +34 -50
- package/dist/tsup/{config-BiiS5T5M.d.ts → config-CASGH-5t.d.ts} +16 -1
- package/dist/tsup/{config-BnMhcPHl.d.cts → config-RMLak20L.d.cts} +16 -1
- package/dist/tsup/{context-iMxXq_Lt.d.ts → context-C1tMYvV-.d.ts} +2 -2
- package/dist/tsup/{context-DVE8XMm1.d.cts → context-CxNE2KvK.d.cts} +2 -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.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- 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.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/mod.cjs +380 -121
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +300 -41
- 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 +7 -7
- 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 +4 -4
- package/package.json +9 -9
- package/src/common/database/config.ts +46 -50
- package/src/common/database/native-database.ts +230 -21
- package/src/db/mod.ts +0 -1
- package/src/registry/napi-runtime.ts +78 -0
- package/src/registry/native.ts +57 -17
- package/src/registry/runtime.ts +52 -0
- package/src/registry/wasm-runtime.ts +88 -0
- /package/dist/tsup/{chunk-QQIFRR3B.js.map → chunk-3ZKCK6NL.js.map} +0 -0
- /package/dist/tsup/{chunk-SW33HMM5.js.map → chunk-GAFMEUAL.js.map} +0 -0
- /package/dist/tsup/{chunk-FT6VRK4C.js.map → chunk-MT4SROQM.js.map} +0 -0
- /package/dist/tsup/{chunk-HRKFVQPS.js.map → chunk-SEKTNJU6.js.map} +0 -0
- /package/dist/tsup/{chunk-D7DWNYEO.js.map → chunk-T7DJZSPH.js.map} +0 -0
- /package/dist/tsup/{chunk-2CTZU7GL.js.map → chunk-TTMWSZZA.js.map} +0 -0
- /package/dist/tsup/{chunk-F5PWAGS7.js.map → chunk-YNAEH775.js.map} +0 -0
package/dist/tsup/mod.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-RMLak20L.cjs';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-RMLak20L.cjs';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-C6b0aYUM.cjs';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
|
-
import { A as AnyDatabaseProvider } from './config-
|
|
6
|
+
import { A as AnyDatabaseProvider } from './config-BfG1qpYz.cjs';
|
|
7
7
|
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-3rsE0JvI.cjs';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-CxNE2KvK.cjs';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
package/dist/tsup/mod.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-CASGH-5t.js';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-CASGH-5t.js';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-C1O-SklO.js';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
|
-
import { A as AnyDatabaseProvider } from './config-
|
|
6
|
+
import { A as AnyDatabaseProvider } from './config-BfG1qpYz.js';
|
|
7
7
|
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-3rsE0JvI.js';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-C1tMYvV-.js';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
package/dist/tsup/mod.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeWorkflowHistoryTransport
|
|
3
|
+
} from "./chunk-T7DJZSPH.js";
|
|
1
4
|
import {
|
|
2
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
3
6
|
ActorConfigSchema,
|
|
@@ -15,9 +18,6 @@ import {
|
|
|
15
18
|
getRunMetadata,
|
|
16
19
|
hasRunInspectorConfig
|
|
17
20
|
} from "./chunk-UXDASKP6.js";
|
|
18
|
-
import {
|
|
19
|
-
decodeWorkflowHistoryTransport
|
|
20
|
-
} from "./chunk-D7DWNYEO.js";
|
|
21
21
|
import {
|
|
22
22
|
ALLOWED_PUBLIC_HEADERS,
|
|
23
23
|
ENGINE_HOST,
|
|
@@ -35,17 +35,17 @@ import {
|
|
|
35
35
|
runWithActorInvocationSpan,
|
|
36
36
|
tryParseEndpoint,
|
|
37
37
|
updateRunnerConfig
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-3ZKCK6NL.js";
|
|
39
39
|
import {
|
|
40
40
|
makePrefixedKey,
|
|
41
41
|
removePrefixFromKey
|
|
42
42
|
} from "./chunk-A2CF6PFH.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-YNAEH775.js";
|
|
44
44
|
import {
|
|
45
45
|
bindNativeStateTransactionContext,
|
|
46
46
|
db,
|
|
47
47
|
registerNativeStateTransactionOpener
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-MT4SROQM.js";
|
|
49
49
|
import "./chunk-JTHHCZCZ.js";
|
|
50
50
|
import {
|
|
51
51
|
LogLevelSchema,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
parsePortEnv,
|
|
81
81
|
stringifyError,
|
|
82
82
|
toUint8Array
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-DU7V4SDK.js";
|
|
84
84
|
import {
|
|
85
85
|
INTERNAL_ERROR_CODE,
|
|
86
86
|
RivetError,
|
|
@@ -956,6 +956,10 @@ var DocRegistryConfigSchema = z3.object({
|
|
|
956
956
|
import { VirtualWebSocket as VirtualWebSocket2 } from "@rivetkit/virtual-websocket";
|
|
957
957
|
|
|
958
958
|
// src/common/database/native-database.ts
|
|
959
|
+
function isSynchronousTransaction(transaction) {
|
|
960
|
+
const candidate = transaction;
|
|
961
|
+
return typeof candidate.commitSync === "function" && typeof candidate.rollbackSync === "function";
|
|
962
|
+
}
|
|
959
963
|
function shouldAttachNativeKvError(message) {
|
|
960
964
|
return /i\/o error|unable to open database file/i.test(message);
|
|
961
965
|
}
|
|
@@ -976,13 +980,16 @@ function toNativeBinding(arg) {
|
|
|
976
980
|
if (arg === null || arg === void 0) {
|
|
977
981
|
return { kind: "null" };
|
|
978
982
|
}
|
|
979
|
-
if (typeof arg === "bigint") {
|
|
980
|
-
|
|
983
|
+
if (typeof arg === "bigint" || typeof arg === "number" && Number.isInteger(arg)) {
|
|
984
|
+
const value = Number(arg);
|
|
985
|
+
if (!Number.isSafeInteger(value)) {
|
|
986
|
+
throw new RangeError(
|
|
987
|
+
"SQLite integer bindings must be within the JavaScript safe integer range."
|
|
988
|
+
);
|
|
989
|
+
}
|
|
990
|
+
return { kind: "int", intValue: value };
|
|
981
991
|
}
|
|
982
992
|
if (typeof arg === "number") {
|
|
983
|
-
if (Number.isInteger(arg)) {
|
|
984
|
-
return { kind: "int", intValue: arg };
|
|
985
|
-
}
|
|
986
993
|
return { kind: "float", floatValue: arg };
|
|
987
994
|
}
|
|
988
995
|
if (typeof arg === "string") {
|
|
@@ -999,9 +1006,10 @@ function toNativeBinding(arg) {
|
|
|
999
1006
|
function extractNamedSqliteParameters(sql) {
|
|
1000
1007
|
const orderedNames = [];
|
|
1001
1008
|
const seen = /* @__PURE__ */ new Set();
|
|
1002
|
-
const pattern = /([:@$][A-Za-z_][
|
|
1009
|
+
const pattern = /'(?:''|[^'])*'|"(?:""|[^"])*"|`(?:``|[^`])*`|\[[^\]]*\]|--[^\n]*|\/\*[\s\S]*?(?:\*\/|$)|([:@$][\w$\u0080-\u{10FFFF}]+(?:::[\w$\u0080-\u{10FFFF}]+)*(?:\([^)]*\))?)|[A-Za-z_\u0080-\u{10FFFF}][\w$\u0080-\u{10FFFF}]*/gu;
|
|
1003
1010
|
for (const match of sql.matchAll(pattern)) {
|
|
1004
1011
|
const name = match[1];
|
|
1012
|
+
if (!name) continue;
|
|
1005
1013
|
if (seen.has(name)) {
|
|
1006
1014
|
continue;
|
|
1007
1015
|
}
|
|
@@ -1120,20 +1128,44 @@ function wrapJsNativeDatabase(database) {
|
|
|
1120
1128
|
let terminalPromise;
|
|
1121
1129
|
let lastInsertRowId = null;
|
|
1122
1130
|
const executeNative = async (sql, params) => {
|
|
1123
|
-
const lastInsertRowIdColumn = lastInsertRowIdColumnName(sql);
|
|
1124
|
-
if (lastInsertRowIdColumn) {
|
|
1125
|
-
return {
|
|
1126
|
-
columns: [lastInsertRowIdColumn],
|
|
1127
|
-
rows: [[lastInsertRowId ?? 0]],
|
|
1128
|
-
changes: 0,
|
|
1129
|
-
lastInsertRowId
|
|
1130
|
-
};
|
|
1131
|
-
}
|
|
1132
1131
|
const release = gate.enter();
|
|
1133
1132
|
try {
|
|
1133
|
+
const lastInsertRowIdColumn = lastInsertRowIdColumnName(sql);
|
|
1134
|
+
if (lastInsertRowIdColumn) {
|
|
1135
|
+
return {
|
|
1136
|
+
columns: [lastInsertRowIdColumn],
|
|
1137
|
+
rows: [[lastInsertRowId ?? 0]],
|
|
1138
|
+
changes: 0,
|
|
1139
|
+
lastInsertRowId
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1134
1142
|
const nativeParams = toNativeBindings(sql, params);
|
|
1135
1143
|
const result = await database.execute(sql, nativeParams);
|
|
1136
|
-
if (result.lastInsertRowId
|
|
1144
|
+
if (result.lastInsertRowId != null) {
|
|
1145
|
+
lastInsertRowId = result.lastInsertRowId;
|
|
1146
|
+
}
|
|
1147
|
+
return result;
|
|
1148
|
+
} catch (error) {
|
|
1149
|
+
enrichNativeDatabaseError(database, error);
|
|
1150
|
+
} finally {
|
|
1151
|
+
release();
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
const executeNativeSync = (sql, params) => {
|
|
1155
|
+
const release = gate.enter();
|
|
1156
|
+
try {
|
|
1157
|
+
const nativeParams = toNativeBindings(sql, params);
|
|
1158
|
+
const result = database.executeSync(sql, nativeParams);
|
|
1159
|
+
const rowIdColumn = lastInsertRowIdColumnName(sql);
|
|
1160
|
+
if (rowIdColumn) {
|
|
1161
|
+
return {
|
|
1162
|
+
columns: [rowIdColumn],
|
|
1163
|
+
rows: [[lastInsertRowId ?? 0]],
|
|
1164
|
+
changes: 0,
|
|
1165
|
+
lastInsertRowId
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
if (result.lastInsertRowId != null) {
|
|
1137
1169
|
lastInsertRowId = result.lastInsertRowId;
|
|
1138
1170
|
}
|
|
1139
1171
|
return result;
|
|
@@ -1161,9 +1193,28 @@ function wrapJsNativeDatabase(database) {
|
|
|
1161
1193
|
callback(row, result.columns);
|
|
1162
1194
|
}
|
|
1163
1195
|
},
|
|
1196
|
+
execSync(sql, callback) {
|
|
1197
|
+
const release = gate.enter();
|
|
1198
|
+
let result;
|
|
1199
|
+
try {
|
|
1200
|
+
result = database.execSync(sql);
|
|
1201
|
+
} catch (error) {
|
|
1202
|
+
enrichNativeDatabaseError(database, error);
|
|
1203
|
+
} finally {
|
|
1204
|
+
release();
|
|
1205
|
+
}
|
|
1206
|
+
if (callback) {
|
|
1207
|
+
for (const row of result.rows) {
|
|
1208
|
+
callback(row, result.columns);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
},
|
|
1164
1212
|
async execute(sql, params) {
|
|
1165
1213
|
return await executeNative(sql, params);
|
|
1166
1214
|
},
|
|
1215
|
+
executeSync(sql, params) {
|
|
1216
|
+
return executeNativeSync(sql, params);
|
|
1217
|
+
},
|
|
1167
1218
|
async executeBatch(statements) {
|
|
1168
1219
|
const nativeStatements = statements.map(toNativeBatchStatement);
|
|
1169
1220
|
const release = gate.enter();
|
|
@@ -1185,7 +1236,7 @@ function wrapJsNativeDatabase(database) {
|
|
|
1185
1236
|
return transactionResults;
|
|
1186
1237
|
})();
|
|
1187
1238
|
for (const result of results) {
|
|
1188
|
-
if (result.lastInsertRowId
|
|
1239
|
+
if (result.lastInsertRowId != null) {
|
|
1189
1240
|
lastInsertRowId = result.lastInsertRowId;
|
|
1190
1241
|
}
|
|
1191
1242
|
}
|
|
@@ -1213,7 +1264,23 @@ function wrapJsNativeDatabase(database) {
|
|
|
1213
1264
|
release();
|
|
1214
1265
|
}
|
|
1215
1266
|
return wrapTransaction(database, transaction, gate, (result) => {
|
|
1216
|
-
if (result.lastInsertRowId
|
|
1267
|
+
if (result.lastInsertRowId != null) {
|
|
1268
|
+
lastInsertRowId = result.lastInsertRowId;
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
},
|
|
1272
|
+
beginTransactionSync(timeoutMs, name) {
|
|
1273
|
+
const release = gate.enter();
|
|
1274
|
+
let transaction;
|
|
1275
|
+
try {
|
|
1276
|
+
transaction = database.beginTransactionSync(timeoutMs, name);
|
|
1277
|
+
} catch (error) {
|
|
1278
|
+
enrichNativeDatabaseError(database, error);
|
|
1279
|
+
} finally {
|
|
1280
|
+
release();
|
|
1281
|
+
}
|
|
1282
|
+
return wrapTransaction(database, transaction, gate, (result) => {
|
|
1283
|
+
if (result.lastInsertRowId != null) {
|
|
1217
1284
|
lastInsertRowId = result.lastInsertRowId;
|
|
1218
1285
|
}
|
|
1219
1286
|
});
|
|
@@ -1235,7 +1302,7 @@ function wrapJsNativeDatabase(database) {
|
|
|
1235
1302
|
release();
|
|
1236
1303
|
}
|
|
1237
1304
|
return wrapTransaction(database, transaction, gate, (result) => {
|
|
1238
|
-
if (result.lastInsertRowId
|
|
1305
|
+
if (result.lastInsertRowId != null) {
|
|
1239
1306
|
lastInsertRowId = result.lastInsertRowId;
|
|
1240
1307
|
}
|
|
1241
1308
|
});
|
|
@@ -1251,6 +1318,25 @@ function wrapJsNativeDatabase(database) {
|
|
|
1251
1318
|
var _a;
|
|
1252
1319
|
return normalizeNativeMetrics((_a = database.metrics) == null ? void 0 : _a.call(database));
|
|
1253
1320
|
},
|
|
1321
|
+
async open() {
|
|
1322
|
+
const release = gate.enter();
|
|
1323
|
+
try {
|
|
1324
|
+
await database.open();
|
|
1325
|
+
} catch (error) {
|
|
1326
|
+
enrichNativeDatabaseError(database, error);
|
|
1327
|
+
} finally {
|
|
1328
|
+
release();
|
|
1329
|
+
}
|
|
1330
|
+
},
|
|
1331
|
+
commitTicket() {
|
|
1332
|
+
return database.commitTicket();
|
|
1333
|
+
},
|
|
1334
|
+
async whenDurable(ticket) {
|
|
1335
|
+
await database.whenDurable(ticket);
|
|
1336
|
+
},
|
|
1337
|
+
abortGeneration(reason) {
|
|
1338
|
+
database.abortGeneration(reason);
|
|
1339
|
+
},
|
|
1254
1340
|
async close() {
|
|
1255
1341
|
terminalPromise ??= gate.close(() => database.close());
|
|
1256
1342
|
await terminalPromise;
|
|
@@ -1262,7 +1348,7 @@ function wrapJsNativeDatabase(database) {
|
|
|
1262
1348
|
};
|
|
1263
1349
|
}
|
|
1264
1350
|
function wrapTransaction(database, transaction, gate, onExecute) {
|
|
1265
|
-
|
|
1351
|
+
const wrapped = {
|
|
1266
1352
|
async exec(sql, callback) {
|
|
1267
1353
|
const release = gate.enter();
|
|
1268
1354
|
let result;
|
|
@@ -1313,6 +1399,61 @@ function wrapTransaction(database, transaction, gate, onExecute) {
|
|
|
1313
1399
|
}
|
|
1314
1400
|
}
|
|
1315
1401
|
};
|
|
1402
|
+
if (isSynchronousTransaction(transaction)) {
|
|
1403
|
+
return Object.assign(wrapped, {
|
|
1404
|
+
execSync(sql, callback) {
|
|
1405
|
+
const release = gate.enter();
|
|
1406
|
+
let result;
|
|
1407
|
+
try {
|
|
1408
|
+
result = transaction.execSync(sql);
|
|
1409
|
+
} catch (error) {
|
|
1410
|
+
enrichNativeDatabaseError(database, error);
|
|
1411
|
+
} finally {
|
|
1412
|
+
release();
|
|
1413
|
+
}
|
|
1414
|
+
if (callback) {
|
|
1415
|
+
for (const row of result.rows)
|
|
1416
|
+
callback(row, result.columns);
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1419
|
+
executeSync(sql, params) {
|
|
1420
|
+
const release = gate.enter();
|
|
1421
|
+
try {
|
|
1422
|
+
const result = transaction.executeSync(
|
|
1423
|
+
sql,
|
|
1424
|
+
toNativeBindings(sql, params)
|
|
1425
|
+
);
|
|
1426
|
+
onExecute(result);
|
|
1427
|
+
return result;
|
|
1428
|
+
} catch (error) {
|
|
1429
|
+
enrichNativeDatabaseError(database, error);
|
|
1430
|
+
} finally {
|
|
1431
|
+
release();
|
|
1432
|
+
}
|
|
1433
|
+
},
|
|
1434
|
+
commitSync() {
|
|
1435
|
+
const release = gate.enter();
|
|
1436
|
+
try {
|
|
1437
|
+
transaction.commitSync();
|
|
1438
|
+
} catch (error) {
|
|
1439
|
+
enrichNativeDatabaseError(database, error);
|
|
1440
|
+
} finally {
|
|
1441
|
+
release();
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
rollbackSync() {
|
|
1445
|
+
const release = gate.enter();
|
|
1446
|
+
try {
|
|
1447
|
+
transaction.rollbackSync();
|
|
1448
|
+
} catch (error) {
|
|
1449
|
+
enrichNativeDatabaseError(database, error);
|
|
1450
|
+
} finally {
|
|
1451
|
+
release();
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
return wrapped;
|
|
1316
1457
|
}
|
|
1317
1458
|
function lastInsertRowIdColumnName(sql) {
|
|
1318
1459
|
const match = sql.match(
|
|
@@ -1897,6 +2038,9 @@ var NapiCoreRuntime = class {
|
|
|
1897
2038
|
async actorSqlExec(ctx, sql) {
|
|
1898
2039
|
return await this.#actorSql(ctx).exec(sql);
|
|
1899
2040
|
}
|
|
2041
|
+
actorSqlExecSync(ctx, sql) {
|
|
2042
|
+
return this.#actorSql(ctx).execSync(sql);
|
|
2043
|
+
}
|
|
1900
2044
|
async actorSqlExecute(ctx, sql, params) {
|
|
1901
2045
|
const result = await this.#actorSql(ctx).execute(
|
|
1902
2046
|
sql,
|
|
@@ -1904,6 +2048,13 @@ var NapiCoreRuntime = class {
|
|
|
1904
2048
|
);
|
|
1905
2049
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
1906
2050
|
}
|
|
2051
|
+
actorSqlExecuteSync(ctx, sql, params) {
|
|
2052
|
+
const result = this.#actorSql(ctx).executeSync(
|
|
2053
|
+
sql,
|
|
2054
|
+
toNapiSqlBindParams(params)
|
|
2055
|
+
);
|
|
2056
|
+
return normalizeRuntimeSqlExecuteResult(result);
|
|
2057
|
+
}
|
|
1907
2058
|
async actorSqlExecuteBatch(ctx, statements) {
|
|
1908
2059
|
const results = await this.#actorSql(ctx).executeBatch(
|
|
1909
2060
|
statements.map(toNapiSqlBatchStatement)
|
|
@@ -1916,9 +2067,18 @@ var NapiCoreRuntime = class {
|
|
|
1916
2067
|
name
|
|
1917
2068
|
);
|
|
1918
2069
|
}
|
|
2070
|
+
actorSqlBeginTransactionSync(ctx, timeoutMs, name) {
|
|
2071
|
+
return this.#actorSql(ctx).beginTransactionSync(
|
|
2072
|
+
timeoutMs,
|
|
2073
|
+
name
|
|
2074
|
+
);
|
|
2075
|
+
}
|
|
1919
2076
|
async actorSqlTransactionExec(transaction, sql) {
|
|
1920
2077
|
return await asNativeSqlTransaction(transaction).exec(sql);
|
|
1921
2078
|
}
|
|
2079
|
+
actorSqlTransactionExecSync(transaction, sql) {
|
|
2080
|
+
return asNativeSqlTransaction(transaction).execSync(sql);
|
|
2081
|
+
}
|
|
1922
2082
|
async actorSqlTransactionExecute(transaction, sql, params) {
|
|
1923
2083
|
const result = await asNativeSqlTransaction(transaction).execute(
|
|
1924
2084
|
sql,
|
|
@@ -1926,12 +2086,25 @@ var NapiCoreRuntime = class {
|
|
|
1926
2086
|
);
|
|
1927
2087
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
1928
2088
|
}
|
|
2089
|
+
actorSqlTransactionExecuteSync(transaction, sql, params) {
|
|
2090
|
+
const result = asNativeSqlTransaction(transaction).executeSync(
|
|
2091
|
+
sql,
|
|
2092
|
+
toNapiSqlBindParams(params)
|
|
2093
|
+
);
|
|
2094
|
+
return normalizeRuntimeSqlExecuteResult(result);
|
|
2095
|
+
}
|
|
1929
2096
|
async actorSqlTransactionCommit(transaction) {
|
|
1930
2097
|
await asNativeSqlTransaction(transaction).commit();
|
|
1931
2098
|
}
|
|
2099
|
+
actorSqlTransactionCommitSync(transaction) {
|
|
2100
|
+
asNativeSqlTransaction(transaction).commitSync();
|
|
2101
|
+
}
|
|
1932
2102
|
async actorSqlTransactionRollback(transaction) {
|
|
1933
2103
|
await asNativeSqlTransaction(transaction).rollback();
|
|
1934
2104
|
}
|
|
2105
|
+
actorSqlTransactionRollbackSync(transaction) {
|
|
2106
|
+
asNativeSqlTransaction(transaction).rollbackSync();
|
|
2107
|
+
}
|
|
1935
2108
|
async actorBeginStateTransaction(ctx, timeoutMs) {
|
|
1936
2109
|
return await this.#actorContextForOperation(ctx).beginStateTransaction(
|
|
1937
2110
|
timeoutMs
|
|
@@ -1969,6 +2142,18 @@ var NapiCoreRuntime = class {
|
|
|
1969
2142
|
var _a, _b;
|
|
1970
2143
|
return ((_b = (_a = this.#actorSql(ctx)).takeLastKvError) == null ? void 0 : _b.call(_a)) ?? null;
|
|
1971
2144
|
}
|
|
2145
|
+
async actorSqlOpen(ctx) {
|
|
2146
|
+
await this.#actorSql(ctx).open();
|
|
2147
|
+
}
|
|
2148
|
+
actorSqlCommitTicket(ctx) {
|
|
2149
|
+
return this.#actorSql(ctx).commitTicket();
|
|
2150
|
+
}
|
|
2151
|
+
actorSqlAbortGeneration(ctx, reason) {
|
|
2152
|
+
this.#actorSql(ctx).abortGeneration(reason);
|
|
2153
|
+
}
|
|
2154
|
+
async actorSqlWhenDurable(ctx, ticket) {
|
|
2155
|
+
await this.#actorSql(ctx).whenDurable(ticket);
|
|
2156
|
+
}
|
|
1972
2157
|
async actorSqlClose(ctx) {
|
|
1973
2158
|
const nativeCtx = asNativeActorContext(ctx);
|
|
1974
2159
|
if (!this.#sqlOpened.delete(nativeCtx)) {
|
|
@@ -2552,6 +2737,17 @@ function optionalWasmNumber(value) {
|
|
|
2552
2737
|
function wasmNumber(value) {
|
|
2553
2738
|
return typeof value === "bigint" ? Number(value) : value;
|
|
2554
2739
|
}
|
|
2740
|
+
function synchronousSqliteUnavailable() {
|
|
2741
|
+
throw new RivetError(
|
|
2742
|
+
"sqlite",
|
|
2743
|
+
"sync_unsupported",
|
|
2744
|
+
"Synchronous SQLite is unavailable because the actor runs on the wasm runtime.",
|
|
2745
|
+
{
|
|
2746
|
+
public: true,
|
|
2747
|
+
metadata: { runtime: "wasm" }
|
|
2748
|
+
}
|
|
2749
|
+
);
|
|
2750
|
+
}
|
|
2555
2751
|
function normalizeKvEntry(entry) {
|
|
2556
2752
|
return {
|
|
2557
2753
|
key: toBytes(entry.key),
|
|
@@ -2703,6 +2899,14 @@ var WasmCoreRuntime = class {
|
|
|
2703
2899
|
);
|
|
2704
2900
|
}
|
|
2705
2901
|
createActorFactory(callbacks, config) {
|
|
2902
|
+
if (config == null ? void 0 : config.sqliteDeferredCommits) {
|
|
2903
|
+
throw new RivetError(
|
|
2904
|
+
"sqlite",
|
|
2905
|
+
"deferred_commits_unsupported",
|
|
2906
|
+
"SQLite deferred commits require local native SQLite, but the wasm runtime uses remote SQLite.",
|
|
2907
|
+
{ metadata: { runtime: "wasm" } }
|
|
2908
|
+
);
|
|
2909
|
+
}
|
|
2706
2910
|
return callWasmSync(
|
|
2707
2911
|
() => asActorFactoryHandle2(
|
|
2708
2912
|
new this.#constructors.ActorFactory(callbacks, config)
|
|
@@ -2979,12 +3183,18 @@ var WasmCoreRuntime = class {
|
|
|
2979
3183
|
async actorSqlExec(ctx, sql) {
|
|
2980
3184
|
return await callWasm(() => this.#actorSql(ctx).exec(sql));
|
|
2981
3185
|
}
|
|
3186
|
+
actorSqlExecSync(_ctx, _sql) {
|
|
3187
|
+
return synchronousSqliteUnavailable();
|
|
3188
|
+
}
|
|
2982
3189
|
async actorSqlExecute(ctx, sql, params) {
|
|
2983
3190
|
const result = await callWasm(
|
|
2984
3191
|
() => this.#actorSql(ctx).execute(sql, params)
|
|
2985
3192
|
);
|
|
2986
3193
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
2987
3194
|
}
|
|
3195
|
+
actorSqlExecuteSync(_ctx, _sql, _params) {
|
|
3196
|
+
return synchronousSqliteUnavailable();
|
|
3197
|
+
}
|
|
2988
3198
|
async actorSqlExecuteBatch(ctx, statements) {
|
|
2989
3199
|
const results = await callWasm(
|
|
2990
3200
|
() => this.#actorSql(ctx).executeBatch(statements)
|
|
@@ -2996,27 +3206,42 @@ var WasmCoreRuntime = class {
|
|
|
2996
3206
|
() => this.#actorSql(ctx).beginTransaction(timeoutMs, name)
|
|
2997
3207
|
);
|
|
2998
3208
|
}
|
|
3209
|
+
actorSqlBeginTransactionSync(_ctx, _timeoutMs, _name) {
|
|
3210
|
+
return synchronousSqliteUnavailable();
|
|
3211
|
+
}
|
|
2999
3212
|
async actorSqlTransactionExec(transaction, sql) {
|
|
3000
3213
|
return await callWasm(
|
|
3001
3214
|
() => transaction.exec(sql)
|
|
3002
3215
|
);
|
|
3003
3216
|
}
|
|
3217
|
+
actorSqlTransactionExecSync(_transaction, _sql) {
|
|
3218
|
+
return synchronousSqliteUnavailable();
|
|
3219
|
+
}
|
|
3004
3220
|
async actorSqlTransactionExecute(transaction, sql, params) {
|
|
3005
3221
|
const result = await callWasm(
|
|
3006
3222
|
() => transaction.execute(sql, params)
|
|
3007
3223
|
);
|
|
3008
3224
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
3009
3225
|
}
|
|
3226
|
+
actorSqlTransactionExecuteSync(_transaction, _sql, _params) {
|
|
3227
|
+
return synchronousSqliteUnavailable();
|
|
3228
|
+
}
|
|
3010
3229
|
async actorSqlTransactionCommit(transaction) {
|
|
3011
3230
|
await callWasm(
|
|
3012
3231
|
() => transaction.commit()
|
|
3013
3232
|
);
|
|
3014
3233
|
}
|
|
3234
|
+
actorSqlTransactionCommitSync(_transaction) {
|
|
3235
|
+
synchronousSqliteUnavailable();
|
|
3236
|
+
}
|
|
3015
3237
|
async actorSqlTransactionRollback(transaction) {
|
|
3016
3238
|
await callWasm(
|
|
3017
3239
|
() => transaction.rollback()
|
|
3018
3240
|
);
|
|
3019
3241
|
}
|
|
3242
|
+
actorSqlTransactionRollbackSync(_transaction) {
|
|
3243
|
+
synchronousSqliteUnavailable();
|
|
3244
|
+
}
|
|
3020
3245
|
async actorBeginStateTransaction(ctx, timeoutMs) {
|
|
3021
3246
|
return await callWasm(
|
|
3022
3247
|
() => asWasmActorContext(ctx).beginStateTransaction(timeoutMs)
|
|
@@ -3052,6 +3277,17 @@ var WasmCoreRuntime = class {
|
|
|
3052
3277
|
var _a, _b;
|
|
3053
3278
|
return ((_b = (_a = this.#actorSql(ctx)).takeLastKvError) == null ? void 0 : _b.call(_a)) ?? null;
|
|
3054
3279
|
}
|
|
3280
|
+
async actorSqlOpen(_ctx) {
|
|
3281
|
+
}
|
|
3282
|
+
actorSqlCommitTicket(_ctx) {
|
|
3283
|
+
return synchronousSqliteUnavailable();
|
|
3284
|
+
}
|
|
3285
|
+
actorSqlAbortGeneration(_ctx, _reason) {
|
|
3286
|
+
synchronousSqliteUnavailable();
|
|
3287
|
+
}
|
|
3288
|
+
async actorSqlWhenDurable(_ctx, _ticket) {
|
|
3289
|
+
synchronousSqliteUnavailable();
|
|
3290
|
+
}
|
|
3055
3291
|
async actorSqlClose(ctx) {
|
|
3056
3292
|
const wasmCtx = asWasmActorContext(ctx);
|
|
3057
3293
|
const database = this.#sql.get(wasmCtx);
|
|
@@ -3708,15 +3944,29 @@ async function closeNativeDatabaseClient(runtime, ctx) {
|
|
|
3708
3944
|
await entry.client.close();
|
|
3709
3945
|
}
|
|
3710
3946
|
}
|
|
3947
|
+
function createNativeSqlTransaction(runtime, transaction) {
|
|
3948
|
+
return {
|
|
3949
|
+
exec: (sql) => runtime.actorSqlTransactionExec(transaction, sql),
|
|
3950
|
+
execSync: (sql) => runtime.actorSqlTransactionExecSync(transaction, sql),
|
|
3951
|
+
execute: (sql, params) => runtime.actorSqlTransactionExecute(transaction, sql, params),
|
|
3952
|
+
executeSync: (sql, params) => runtime.actorSqlTransactionExecuteSync(transaction, sql, params),
|
|
3953
|
+
commit: () => runtime.actorSqlTransactionCommit(transaction),
|
|
3954
|
+
commitSync: () => runtime.actorSqlTransactionCommitSync(transaction),
|
|
3955
|
+
rollback: () => runtime.actorSqlTransactionRollback(transaction),
|
|
3956
|
+
rollbackSync: () => runtime.actorSqlTransactionRollbackSync(transaction)
|
|
3957
|
+
};
|
|
3958
|
+
}
|
|
3711
3959
|
function getOrCreateNativeSqlDatabase(runtime, ctx) {
|
|
3712
3960
|
const runtimeState = getNativeRuntimeState(runtime, ctx);
|
|
3713
3961
|
const cachedDatabase = runtimeState.sql;
|
|
3714
3962
|
if (cachedDatabase) {
|
|
3715
3963
|
return cachedDatabase;
|
|
3716
3964
|
}
|
|
3717
|
-
const
|
|
3965
|
+
const bindings = {
|
|
3718
3966
|
exec: (sql) => runtime.actorSqlExec(ctx, sql),
|
|
3967
|
+
execSync: (sql) => runtime.actorSqlExecSync(ctx, sql),
|
|
3719
3968
|
execute: (sql, params) => runtime.actorSqlExecute(ctx, sql, params),
|
|
3969
|
+
executeSync: (sql, params) => runtime.actorSqlExecuteSync(ctx, sql, params),
|
|
3720
3970
|
executeBatch: (statements) => runtime.actorSqlExecuteBatch(ctx, statements),
|
|
3721
3971
|
beginTransaction: async (timeoutMs, name) => {
|
|
3722
3972
|
const transaction = await runtime.actorSqlBeginTransaction(
|
|
@@ -3724,16 +3974,15 @@ function getOrCreateNativeSqlDatabase(runtime, ctx) {
|
|
|
3724
3974
|
timeoutMs,
|
|
3725
3975
|
name
|
|
3726
3976
|
);
|
|
3727
|
-
return
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
};
|
|
3977
|
+
return createNativeSqlTransaction(runtime, transaction);
|
|
3978
|
+
},
|
|
3979
|
+
beginTransactionSync: (timeoutMs, name) => {
|
|
3980
|
+
const transaction = runtime.actorSqlBeginTransactionSync(
|
|
3981
|
+
ctx,
|
|
3982
|
+
timeoutMs,
|
|
3983
|
+
name
|
|
3984
|
+
);
|
|
3985
|
+
return createNativeSqlTransaction(runtime, transaction);
|
|
3737
3986
|
},
|
|
3738
3987
|
beginStateTransaction: async (timeoutMs, context) => {
|
|
3739
3988
|
const scope = context;
|
|
@@ -3771,8 +4020,13 @@ function getOrCreateNativeSqlDatabase(runtime, ctx) {
|
|
|
3771
4020
|
run: (sql, params) => runtime.actorSqlRun(ctx, sql, params),
|
|
3772
4021
|
metrics: () => runtime.actorSqlMetrics(ctx),
|
|
3773
4022
|
takeLastKvError: () => runtime.actorSqlTakeLastKvError(ctx),
|
|
4023
|
+
open: () => runtime.actorSqlOpen(ctx),
|
|
4024
|
+
commitTicket: () => runtime.actorSqlCommitTicket(ctx),
|
|
4025
|
+
whenDurable: (ticket) => runtime.actorSqlWhenDurable(ctx, ticket),
|
|
4026
|
+
abortGeneration: (reason) => runtime.actorSqlAbortGeneration(ctx, reason),
|
|
3774
4027
|
close: () => runtime.actorSqlClose(ctx)
|
|
3775
|
-
}
|
|
4028
|
+
};
|
|
4029
|
+
const database = wrapJsNativeDatabase(bindings);
|
|
3776
4030
|
runtimeState.sql = database;
|
|
3777
4031
|
return database;
|
|
3778
4032
|
}
|
|
@@ -5518,10 +5772,12 @@ var ActorContextHandleAdapter = class {
|
|
|
5518
5772
|
{
|
|
5519
5773
|
open: async (requestedActorId) => {
|
|
5520
5774
|
void requestedActorId;
|
|
5521
|
-
|
|
5775
|
+
const database = getOrCreateNativeSqlDatabase(
|
|
5522
5776
|
this.#runtime,
|
|
5523
5777
|
this.#ctx
|
|
5524
5778
|
);
|
|
5779
|
+
await database.open();
|
|
5780
|
+
return database;
|
|
5525
5781
|
}
|
|
5526
5782
|
},
|
|
5527
5783
|
async (timeoutMs, context) => await getOrCreateNativeSqlDatabase(
|
|
@@ -6124,18 +6380,21 @@ function buildActorTracingConfig(actions, tracing) {
|
|
|
6124
6380
|
actions: flattenActionTraceSamplers(actions, tracing.actions)
|
|
6125
6381
|
};
|
|
6126
6382
|
}
|
|
6383
|
+
var SQLITE_DEFERRED_COMMITS = /* @__PURE__ */ Symbol.for("rivetkit.sqlite.deferredCommits");
|
|
6127
6384
|
function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
6128
|
-
var _a;
|
|
6385
|
+
var _a, _b;
|
|
6129
6386
|
const config = definition.config;
|
|
6130
6387
|
const options = config.options ?? {};
|
|
6131
6388
|
const canHibernate = options.canHibernateWebSocket;
|
|
6132
6389
|
const usesRemoteSqlite = sqliteBackendForConfig(registryConfig) === "remote";
|
|
6133
6390
|
const sqliteProfiling = (_a = config.db) == null ? void 0 : _a.sqliteProfiling;
|
|
6391
|
+
const sqliteDeferredCommits = ((_b = config.db) == null ? void 0 : _b[SQLITE_DEFERRED_COMMITS]) === true;
|
|
6134
6392
|
return {
|
|
6135
6393
|
name: options.name,
|
|
6136
6394
|
icon: options.icon,
|
|
6137
6395
|
hasDatabase: true,
|
|
6138
6396
|
remoteSqlite: usesRemoteSqlite,
|
|
6397
|
+
sqliteDeferredCommits: sqliteDeferredCommits || void 0,
|
|
6139
6398
|
sqliteProfiling,
|
|
6140
6399
|
tracing: buildActorTracingConfig(
|
|
6141
6400
|
definition.config.actions,
|