@delali/sirannon-db 0.3.6-next.77 → 0.3.6-next.78
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/backup/index.d.ts +5 -5
- package/dist/backup/index.mjs +5 -3
- package/dist/backup-scheduler/index.d.ts +2 -2
- package/dist/backup-scheduler/index.mjs +2 -2
- package/dist/chunk-22TYGH7J.mjs +55 -0
- package/dist/{chunk-SB3MIFLG.mjs → chunk-2ZQOZFX7.mjs} +29 -6
- package/dist/{chunk-UIDQGPJY.mjs → chunk-4O7WYZHN.mjs} +38 -3
- package/dist/{chunk-ZFFUVYYE.mjs → chunk-5DKWHT6K.mjs} +109 -1
- package/dist/chunk-5O4J6LQQ.mjs +35 -0
- package/dist/{chunk-CZL4D3BM.mjs → chunk-6CABU54O.mjs} +2 -2
- package/dist/{chunk-JAQ2I4OT.mjs → chunk-A5ULJVK7.mjs} +11 -11
- package/dist/{chunk-RLBKZZ24.mjs → chunk-AC7TKWNH.mjs} +1 -0
- package/dist/chunk-BKO4SCEC.mjs +99 -0
- package/dist/{chunk-KOTBP4AW.mjs → chunk-C7E4H6UN.mjs} +24 -4
- package/dist/{chunk-G4AG3ESO.mjs → chunk-FBA7P4ZA.mjs} +114 -149
- package/dist/{chunk-DKML5425.mjs → chunk-GBVB6WSC.mjs} +2 -2
- package/dist/chunk-I4JY5QPA.mjs +51 -0
- package/dist/{chunk-L6EX6K27.mjs → chunk-MO4APBYG.mjs} +54 -13
- package/dist/{chunk-RPWBYASV.mjs → chunk-MTOQ6QIS.mjs} +1 -1
- package/dist/chunk-MX77PGEN.mjs +60 -0
- package/dist/{chunk-BTUD6XQO.mjs → chunk-N3MHZV3B.mjs} +11 -29
- package/dist/{chunk-UHUDPQFI.mjs → chunk-OJXV4L3N.mjs} +1 -3
- package/dist/chunk-QF7WF7RJ.mjs +34 -0
- package/dist/chunk-RLBV4YTB.mjs +22 -0
- package/dist/{chunk-ISDT4RBD.mjs → chunk-ULUZUBON.mjs} +1 -1
- package/dist/{chunk-AP4367HK.mjs → chunk-VGRAAQX3.mjs} +4 -4
- package/dist/chunk-W74HFQFD.mjs +153 -0
- package/dist/chunk-Y4SP7CRF.mjs +9 -0
- package/dist/{chunk-JFVEGN7J.mjs → chunk-ZAUHAJ4G.mjs} +2 -1
- package/dist/{chunk-DDIHBUEN.mjs → chunk-ZWW53O5P.mjs} +19 -7
- package/dist/client/index.d.ts +8 -8
- package/dist/client/topology.d.ts +4 -4
- package/dist/{client-base-Doaqwrx3.d.ts → client-base-DJZbSY55.d.ts} +2 -2
- package/dist/{client-streams-MKPE4MXW.mjs → client-streams-F7IG3PTU.mjs} +13 -16
- package/dist/core/index.d.ts +48 -12
- package/dist/core/index.mjs +1812 -107
- package/dist/core/writer-worker.mjs +28 -4
- package/dist/{database-fz-8CJBP.d.ts → database-BZ96ZzAx.d.ts} +411 -184
- package/dist/{database-backup-BwTNiBm2.d.ts → database-backup-BhM8yJ1A.d.ts} +32 -2
- package/dist/driver/better-sqlite3.d.ts +11 -1
- package/dist/driver/better-sqlite3.mjs +212 -23
- package/dist/driver/bun.d.ts +1 -1
- package/dist/driver/bun.mjs +15 -22
- package/dist/driver/expo.d.ts +1 -1
- package/dist/driver/expo.mjs +185 -16
- package/dist/driver/node.d.ts +1 -1
- package/dist/driver/node.mjs +15 -62
- package/dist/driver/wa-sqlite.d.ts +1 -1
- package/dist/driver/wa-sqlite.mjs +14 -153
- package/dist/{change-tracker-Dpo99EI-.d.ts → errors-DLMAGQFb.d.ts} +200 -2
- package/dist/file-migrations/index.d.ts +1 -1
- package/dist/peer-refusal-RR37UOLV.mjs +1 -0
- package/dist/{protocol-DZSYSv0S.d.ts → protocol-DE10taas.d.ts} +1 -1
- package/dist/replication/coordinator/etcd.mjs +1 -1
- package/dist/replication/index.d.ts +7 -7
- package/dist/replication/index.mjs +66 -9
- package/dist/{restore-options-CcMukOLO.d.ts → restore-options-B6HV_5XT.d.ts} +6 -1
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.mjs +506 -350
- package/dist/{server-options-B9CsAZp5.d.ts → server-options-Bhdlvehe.d.ts} +14 -1
- package/dist/{server-streams-SBYCHWWM.mjs → server-streams-Q2AZAW3N.mjs} +6 -30
- package/dist/{sirannon-D0CjDULa.d.ts → sirannon-Ba1o2HUQ.d.ts} +5 -5
- package/dist/transport/grpc.d.ts +15 -4
- package/dist/transport/grpc.mjs +34 -37
- package/dist/transport/memory.d.ts +4 -3
- package/dist/transport/memory.mjs +8 -26
- package/dist/{types-DTmi7pXp.d.ts → types-BWyv_N18.d.ts} +189 -1
- package/dist/{types-BlZ9GG1a.d.ts → types-CDnlkVRK.d.ts} +8 -2
- package/package.json +17 -9
- package/dist/chunk-DBN57KVR.mjs +0 -171
- package/dist/chunk-W67A4H2E.mjs +0 -23
- package/dist/chunk-YW7IKQ7T.mjs +0 -62
package/dist/core/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
export { B as BackupCapabilities, a as BackupChainLocation, b as BackupRestorePlan, c as BackupSafeToDeleteOptions, d as backupPiecesSafeToDelete, p as planBackupRestore } from '../database-backup-
|
|
2
|
-
import {
|
|
3
|
-
export { A as AfterQueryHook,
|
|
4
|
-
import { B as BulkLoadDurability, a as BulkLoadResult, R as RequestContext } from '../server-options-
|
|
5
|
-
export { A as AppliedMigrationRow, b as AuthenticateHook, c as BulkLoadOptions, C as ClientOptions, d as ClusterStatusAuthorizer, e as CorsOptions, f as ReplicationStatusInfo, g as ServerExecutionTarget, h as ServerExecutionTargetResolver, S as ServerOptions, W as WSHandlerOptions } from '../server-options-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export { B as BackupCapabilities, a as BackupChainLocation, b as BackupRestorePlan, c as BackupSafeToDeleteOptions, d as backupPiecesSafeToDelete, p as planBackupRestore } from '../database-backup-BhM8yJ1A.js';
|
|
2
|
+
import { L as SQLiteConnection, X as SynchronousLevel, S as SQLiteDriver, D as DatabaseOptions, Y as LifecycleConfig, M as Migration, Z as MigrationResult, _ as RollbackResult } from '../types-BWyv_N18.js';
|
|
3
|
+
export { A as AfterQueryHook, $ as AfterQueryHookContext, a0 as AppliedMigrationEntry, h as BackupChain, i as BackupChainBase, j as BackupChainChange, k as BackupChainPosition, l as BackupChainRecord, n as BackupCycleError, o as BackupCycleOptions, p as BackupCycleStatus, B as BackupDestination, q as BackupFileReport, r as BackupGroupMembership, s as BackupGroupSource, t as BackupLogPosition, u as BackupNodePreference, v as BackupPiece, w as BackupProgress, g as BackupRunReport, R as BackupScheduleOptions, x as BackupSkip, y as BackupSkipReason, z as BackupToDestinationOptions, C as BackupVerifyResult, a1 as BatchSummary, d as BeforeConnectHook, a2 as BeforePushHook, c as BeforeQueryHook, a3 as BeforeSnapshotHook, a4 as BeforeSubscribeHook, a5 as CDCMetrics, a6 as ClusterReadEndpointInfo, K as ClusterStatusInfo, a7 as ConnectionHookContext, a8 as ConnectionMetrics, a9 as Counted, F as DEFAULT_CHAIN_NAME, f as DatabaseCloseHook, aa as DatabaseCopyRequest, ab as DatabaseCopyStep, ac as DatabaseFileSystem, e as DatabaseOpenHook, V as DriverCapabilities, ad as DriverWorkerEntry, ae as EncryptionChange, af as EncryptionChangeStatus, J as EncryptionKey, E as EncryptionOptions, ag as EncryptionStatus, ah as HookConfig, ai as MIGRATION_NAME_RE, b as MetricsCollector, aj as MetricsConfig, ak as MigrationBaseline, al as MigrationSource, am as NODE_HEALTH_REASONS, an as NODE_HEALTH_STATES, N as NodeHealth, ao as NodeHealthReason, ap as NodeHealthState, aq as OpenOptions, ar as QueryHookContext, as as QueryMetrics, at as RunResult, au as SQLiteStatement, a as SirannonOptions, T as Transaction, av as WriterWorkerOptions, H as readBackupChains } from '../types-BWyv_N18.js';
|
|
4
|
+
import { B as BulkLoadDurability, a as BulkLoadResult, R as RequestContext } from '../server-options-Bhdlvehe.js';
|
|
5
|
+
export { A as AppliedMigrationRow, b as AuthenticateHook, c as BulkLoadOptions, C as ClientOptions, d as ClusterStatusAuthorizer, e as CorsOptions, f as ReplicationStatusInfo, g as ServerExecutionTarget, h as ServerExecutionTargetResolver, S as ServerOptions, W as WSHandlerOptions } from '../server-options-Bhdlvehe.js';
|
|
6
|
+
import { S as SirannonError } from '../errors-DLMAGQFb.js';
|
|
7
|
+
export { B as BackupError, a as CDCError, C as ChangeTracker, b as ChangeTrackerOptions, c as ConnectionPoolError, D as DatabaseAlreadyExistsError, d as DatabaseNotFoundError, E as ExtensionError, F as ForbiddenSqlError, H as HookDeniedError, M as MaxDatabasesError, e as MigrationError, Q as QueryError, R as ReadOnlyError, f as RequestDeniedError, T as TransactionError, W as WriteOverloadError } from '../errors-DLMAGQFb.js';
|
|
8
|
+
import { D as Database, C as ConnectionPool } from '../database-BZ96ZzAx.js';
|
|
9
|
+
export { c as ConnectionPoolOptions, d as DatabaseBackups, e as DatabaseEncryption, f as DatabaseLifecycle, a as HookDispose, g as HookEvent, h as HookEventContextMap, i as HookHandler, H as HookRegistry, P as PushHookContext, S as SnapshotHookContext, j as SubscribeHookContext } from '../database-BZ96ZzAx.js';
|
|
9
10
|
export { a as LiveQuery, L as LiveQueryOptions, b as LiveQueryState, c as LiveUpdate, R as ResultOp } from '../types-CEJG0eFS.js';
|
|
10
11
|
import { B as BaselineFileOption } from '../baseline-Co3iIsN_.js';
|
|
11
12
|
import { P as Params, E as ExecuteResult } from '../query-types-5B02ixH0.js';
|
|
12
13
|
export { C as ChangeEvent, b as ChangeOperation, Q as QueryOptions, R as ReadConcern, a as ReadConcernLevel, S as Subscription, c as SubscriptionBuilder, d as SubscriptionOptions, W as WriteConcern, e as WriteConcernLevel } from '../query-types-5B02ixH0.js';
|
|
13
|
-
export { S as Sirannon } from '../sirannon-
|
|
14
|
+
export { S as Sirannon } from '../sirannon-Ba1o2HUQ.js';
|
|
14
15
|
export { D as DatabaseOperations, b as OperationArguments, O as OperationRef, a as OperationRegistry, c as OperationStatement, R as ReadOperation, W as WriteOperation, o as operationName, d as operationRef } from '../operation-registry-CGhNT-Sn.js';
|
|
15
16
|
import '../types-BG31TtrQ.js';
|
|
16
17
|
|
|
@@ -122,6 +123,29 @@ declare function synchronousPragmaValue(level: SynchronousLevel | undefined): st
|
|
|
122
123
|
*/
|
|
123
124
|
declare function isSynchronousLevel(value: unknown): value is SynchronousLevel;
|
|
124
125
|
|
|
126
|
+
/**
|
|
127
|
+
* The codes of the errors that an encrypted database raises.
|
|
128
|
+
*
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
type EncryptionErrorCode = 'ENCRYPTION_UNSUPPORTED' | 'INVALID_ENCRYPTION_KEY' | 'ENCRYPTION_KEY_UNAVAILABLE' | 'ENCRYPTION_KEY_MISSING' | 'ENCRYPTION_KEY_REJECTED' | 'DATABASE_NOT_ENCRYPTED' | 'ENCRYPTED_PAGE_CORRUPT' | 'ENCRYPTION_REQUIRED' | 'ENCRYPTION_CHANGE_IN_PROGRESS' | 'ENCRYPTION_CHANGE_ABORTED';
|
|
132
|
+
/**
|
|
133
|
+
* Thrown when a database cannot be encrypted, opened under its key, or given a new key. The message never contains a
|
|
134
|
+
* key.
|
|
135
|
+
*
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
declare class EncryptionError extends SirannonError {
|
|
139
|
+
/**
|
|
140
|
+
* Returns an error with an encryption code, and the failure that caused it when there is one.
|
|
141
|
+
*
|
|
142
|
+
* @param message - What failed, written without the key.
|
|
143
|
+
* @param code - The machine-readable code.
|
|
144
|
+
* @param cause - The failure that caused this error, such as the error that a key function threw.
|
|
145
|
+
*/
|
|
146
|
+
constructor(message: string, code: EncryptionErrorCode, cause?: unknown);
|
|
147
|
+
}
|
|
148
|
+
|
|
125
149
|
/**
|
|
126
150
|
* The registry supplies these functions so that the lifecycle manager can open, close, count, and look up its databases.
|
|
127
151
|
*
|
|
@@ -300,15 +324,27 @@ declare class MigrationRunner {
|
|
|
300
324
|
/**
|
|
301
325
|
* Executes a read on one connection and returns the rows with their values decoded.
|
|
302
326
|
*
|
|
327
|
+
* @param conn - The connection that executes the read.
|
|
328
|
+
* @param sql - The statement to execute.
|
|
329
|
+
* @param params - The values to bind to the statement, named or positional.
|
|
330
|
+
* @param leasedFrom - The pool that leased `conn` through {@link ConnectionPool.leaseReader}, which gets the lease
|
|
331
|
+
* back once the read settles.
|
|
332
|
+
* @returns The rows with their values decoded.
|
|
303
333
|
* @internal
|
|
304
334
|
*/
|
|
305
|
-
declare function query<T = Record<string, unknown>>(conn: SQLiteConnection, sql: string, params?: Params): Promise<T[]>;
|
|
335
|
+
declare function query<T = Record<string, unknown>>(conn: SQLiteConnection, sql: string, params?: Params, leasedFrom?: ConnectionPool): Promise<T[]>;
|
|
306
336
|
/**
|
|
307
337
|
* Executes a read on one connection and returns the first row, or undefined when the read returns none.
|
|
308
338
|
*
|
|
339
|
+
* @param conn - The connection that executes the read.
|
|
340
|
+
* @param sql - The statement to execute.
|
|
341
|
+
* @param params - The values to bind to the statement, named or positional.
|
|
342
|
+
* @param leasedFrom - The pool that leased `conn` through {@link ConnectionPool.leaseReader}, which gets the lease
|
|
343
|
+
* back once the read settles.
|
|
344
|
+
* @returns The first row, or undefined when the read returns none.
|
|
309
345
|
* @internal
|
|
310
346
|
*/
|
|
311
|
-
declare function queryOne<T = Record<string, unknown>>(conn: SQLiteConnection, sql: string, params?: Params): Promise<T | undefined>;
|
|
347
|
+
declare function queryOne<T = Record<string, unknown>>(conn: SQLiteConnection, sql: string, params?: Params, leasedFrom?: ConnectionPool): Promise<T | undefined>;
|
|
312
348
|
/**
|
|
313
349
|
* Executes one write on a connection and returns the change count and the row id of the last inserted row.
|
|
314
350
|
*
|
|
@@ -377,4 +413,4 @@ declare function readBearerToken(ctx: RequestContext): string | undefined;
|
|
|
377
413
|
*/
|
|
378
414
|
declare function readSubprotocolCredential(ctx: RequestContext, prefix: string): string | undefined;
|
|
379
415
|
|
|
380
|
-
export { BaselineFileOption, BulkLoadDurability, BulkLoadResult, DEFAULT_SYNCHRONOUS, Database, DatabaseOptions, ExecuteResult, type LifecycleCallbacks, LifecycleConfig, LifecycleManager, MIGRATION_FILENAME_PATTERN, Migration, MigrationResult, MigrationRunner, type MigrationsFromFilesOptions, Params, type ParsedMigrationFilename, RequestContext, RollbackResult, SQLiteConnection, SQLiteDriver, SynchronousLevel, type TenantResolverOptions, createTenantResolver, defineDriver, execute, executeBatch, isBulkLoadDurability, isSynchronousLevel, migrationsFromFiles, parseMigrationFilename, query, queryOne, readBearerToken, readHeader, readSubprotocolCredential, runBulkLoad, sanitizeTenantId, synchronousPragmaValue, tenantPath, toSubprotocolCredential };
|
|
416
|
+
export { BaselineFileOption, BulkLoadDurability, BulkLoadResult, ConnectionPool, DEFAULT_SYNCHRONOUS, Database, DatabaseOptions, EncryptionError, type EncryptionErrorCode, ExecuteResult, type LifecycleCallbacks, LifecycleConfig, LifecycleManager, MIGRATION_FILENAME_PATTERN, Migration, MigrationResult, MigrationRunner, type MigrationsFromFilesOptions, Params, type ParsedMigrationFilename, RequestContext, RollbackResult, SQLiteConnection, SQLiteDriver, SirannonError, SynchronousLevel, type TenantResolverOptions, createTenantResolver, defineDriver, execute, executeBatch, isBulkLoadDurability, isSynchronousLevel, migrationsFromFiles, parseMigrationFilename, query, queryOne, readBearerToken, readHeader, readSubprotocolCredential, runBulkLoad, sanitizeTenantId, synchronousPragmaValue, tenantPath, toSubprotocolCredential };
|