@rivetkit/rivetkit-napi 0.0.0-sqlite-sync-3x-release.a00b07f → 0.0.0-sqlite-query-metrics-v2.f5d3605

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.
Files changed (3) hide show
  1. package/index.d.ts +26 -43
  2. package/index.js +1 -2
  3. package/package.json +8 -8
package/index.d.ts CHANGED
@@ -83,13 +83,36 @@ export interface JsInspectorTabEntry {
83
83
  /** Set to true for HideBuiltin entries. */
84
84
  hidden?: boolean
85
85
  }
86
+ export interface JsSqliteProfilingMetrics {
87
+ duration?: boolean
88
+ durationHistogram?: boolean
89
+ outcomes?: boolean
90
+ phaseDurationHistogram?: boolean
91
+ getPagesRoundTripsHistogram?: boolean
92
+ transactionStatementCountHistogram?: boolean
93
+ pagesFetched?: boolean
94
+ localPages?: boolean
95
+ localBytes?: boolean
96
+ getPagesDurationHistogram?: boolean
97
+ getPagesPagesHistogram?: boolean
98
+ getPagesResponseBytesHistogram?: boolean
99
+ getPagesMissingPages?: boolean
100
+ workerQueueDepth?: boolean
101
+ workerInflight?: boolean
102
+ coordinatorQueueDepth?: boolean
103
+ fingerprintOverflow?: boolean
104
+ eventDropped?: boolean
105
+ }
86
106
  /**
87
107
  * Experimental SQLite profiling configuration. This entire configuration
88
108
  * surface is subject to change without notice.
89
109
  */
90
110
  export interface JsSqliteProfilingConfig {
91
- queries?: Array<string>
92
- fingerprints?: Array<string>
111
+ enabled?: boolean
112
+ metrics?: JsSqliteProfilingMetrics
113
+ durationHistogramBucketsSeconds?: Array<number>
114
+ filterQueries?: Array<string>
115
+ filterQueryFingerprints?: Array<string>
93
116
  maxTrackedStatementFingerprints?: number
94
117
  maxTrackedTransactionFingerprints?: number
95
118
  maxPrometheusSeries?: number
@@ -112,8 +135,6 @@ export interface JsActorConfig {
112
135
  icon?: string
113
136
  hasDatabase?: boolean
114
137
  remoteSqlite?: boolean
115
- /** Internal. Set by rivetkit when the actor's database provider opts into deferred commits. */
116
- sqliteDeferredCommits?: boolean
117
138
  sqliteProfiling?: JsSqliteProfilingConfig
118
139
  tracing?: JsActorTracingConfig
119
140
  enableActorRuntimeSocket?: boolean
@@ -232,7 +253,6 @@ export interface JsServeConfig {
232
253
  engineBinaryPath?: string
233
254
  startServices?: boolean
234
255
  servicesBinaryPath?: string
235
- engineSpawn?: boolean
236
256
  engineHost?: string
237
257
  enginePort?: number
238
258
  handleInspectorHttpInRuntime?: boolean
@@ -444,28 +464,7 @@ export declare class CancellationToken {
444
464
  constructor()
445
465
  aborted(): boolean
446
466
  cancel(): void
447
- /**
448
- * Calls `callback` once when the token is cancelled.
449
- *
450
- * The returned listener must be released when the caller stops caring
451
- * about cancellation. Releasing ends the waiting task and frees the
452
- * threadsafe function, which otherwise stays alive (with its libuv handle
453
- * and JS closure) until the token is cancelled.
454
- */
455
- onCancelled(callback: (...args: any[]) => any): CancellationListener
456
- }
457
- /**
458
- * Registration returned by `CancellationToken.onCancelled`.
459
- *
460
- * Dropping the JS object does not release the listener, because the callback
461
- * must still fire if the caller keeps no reference to the registration.
462
- */
463
- export declare class CancellationListener {
464
- /**
465
- * Stops waiting for cancellation without calling the callback.
466
- * Idempotent, and a no-op after the callback has fired.
467
- */
468
- release(): void
467
+ onCancelled(callback: (...args: any[]) => any): void
469
468
  }
470
469
  export declare class ConnHandle {
471
470
  id(): string
@@ -486,28 +485,12 @@ export declare class JsNativeDatabase {
486
485
  exec(sql: string): Promise<QueryResult>
487
486
  close(): Promise<void>
488
487
  beginTransaction(timeoutMs?: number | undefined | null, name?: string | undefined | null): Promise<JsSqliteTransaction>
489
- /** Opens the database so later synchronous calls never fetch its first pages. */
490
- open(): Promise<void>
491
- executeSync(sql: string, params?: Array<JsBindParam> | undefined | null): NativeExecuteResult
492
- execSync(sql: string): QueryResult
493
- beginTransactionSync(timeoutMs?: number | undefined | null, name?: string | undefined | null): JsSqliteTransaction
494
- /**
495
- * Returns the latest local commit as a ticket. Tickets stay below 2^53 for any realistic
496
- * generation, so they cross to JavaScript as numbers.
497
- */
498
- commitTicket(): number
499
- abortGeneration(reason: string): void
500
- whenDurable(ticket: number): Promise<void>
501
488
  }
502
489
  export declare class JsSqliteTransaction {
503
490
  execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
504
491
  exec(sql: string): Promise<QueryResult>
505
492
  commit(): Promise<void>
506
493
  rollback(): Promise<void>
507
- executeSync(sql: string, params?: Array<JsBindParam> | undefined | null): NativeExecuteResult
508
- execSync(sql: string): QueryResult
509
- commitSync(): void
510
- rollbackSync(): void
511
494
  }
512
495
  export declare class JsActorStateTransaction {
513
496
  execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { ActorContext, decodeInspectorRequest, encodeInspectorResponse, OutboundCall, WorkflowSpan, WorkflowStepSpan, NapiActorFactory, CancellationToken, CancellationListener, ConnHandle, JsNativeDatabase, JsSqliteTransaction, JsActorStateTransaction, HttpResponseBodyStream, HttpRequestBodyStream, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket, setTelemetryLogSink, shutdownTelemetry } = nativeBinding
313
+ const { ActorContext, decodeInspectorRequest, encodeInspectorResponse, OutboundCall, WorkflowSpan, WorkflowStepSpan, NapiActorFactory, CancellationToken, ConnHandle, JsNativeDatabase, JsSqliteTransaction, JsActorStateTransaction, HttpResponseBodyStream, HttpRequestBodyStream, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket, setTelemetryLogSink, shutdownTelemetry } = nativeBinding
314
314
 
315
315
  module.exports.ActorContext = ActorContext
316
316
  module.exports.decodeInspectorRequest = decodeInspectorRequest
@@ -320,7 +320,6 @@ module.exports.WorkflowSpan = WorkflowSpan
320
320
  module.exports.WorkflowStepSpan = WorkflowStepSpan
321
321
  module.exports.NapiActorFactory = NapiActorFactory
322
322
  module.exports.CancellationToken = CancellationToken
323
- module.exports.CancellationListener = CancellationListener
324
323
  module.exports.ConnHandle = ConnHandle
325
324
  module.exports.JsNativeDatabase = JsNativeDatabase
326
325
  module.exports.JsSqliteTransaction = JsSqliteTransaction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-napi",
3
- "version": "0.0.0-sqlite-sync-3x-release.a00b07f",
3
+ "version": "0.0.0-sqlite-query-metrics-v2.f5d3605",
4
4
  "description": "Native N-API addon for RivetKit providing envoy client and SQLite access",
5
5
  "license": "Apache-2.0",
6
6
  "main": "index.js",
@@ -43,7 +43,7 @@
43
43
  "build:embed": "node scripts/build.mjs"
44
44
  },
45
45
  "dependencies": {
46
- "@rivetkit/engine-envoy-protocol": "0.0.0-sqlite-sync-3x-release.a00b07f"
46
+ "@rivetkit/engine-envoy-protocol": "0.0.0-sqlite-query-metrics-v2.f5d3605"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@napi-rs/cli": "^2.18.4"
@@ -54,11 +54,11 @@
54
54
  "directory": "rivetkit-typescript/packages/rivetkit-napi"
55
55
  },
56
56
  "optionalDependencies": {
57
- "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-sqlite-sync-3x-release.a00b07f",
58
- "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-sqlite-sync-3x-release.a00b07f",
59
- "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-sqlite-sync-3x-release.a00b07f",
60
- "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-sqlite-sync-3x-release.a00b07f",
61
- "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-sqlite-sync-3x-release.a00b07f",
62
- "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-sqlite-sync-3x-release.a00b07f"
57
+ "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-sqlite-query-metrics-v2.f5d3605",
58
+ "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-sqlite-query-metrics-v2.f5d3605",
59
+ "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-sqlite-query-metrics-v2.f5d3605",
60
+ "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-sqlite-query-metrics-v2.f5d3605",
61
+ "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-sqlite-query-metrics-v2.f5d3605",
62
+ "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-sqlite-query-metrics-v2.f5d3605"
63
63
  }
64
64
  }