@itwin/core-backend 4.2.0-dev.8 → 4.3.0-dev.0
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/CHANGELOG.md +57 -1
- package/lib/cjs/BlobContainerService.d.ts +6 -2
- package/lib/cjs/BlobContainerService.d.ts.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +5 -1
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +6 -3
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +79 -34
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +7 -9
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +23 -4
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +171 -42
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/SQLiteDb.js +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/SchemaSync.d.ts +41 -0
- package/lib/cjs/SchemaSync.d.ts.map +1 -0
- package/lib/cjs/SchemaSync.js +77 -0
- package/lib/cjs/SchemaSync.js.map +1 -0
- package/lib/cjs/SchemaUtils.d.ts.map +1 -1
- package/lib/cjs/SchemaUtils.js +3 -3
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/TileStorage.d.ts +16 -5
- package/lib/cjs/TileStorage.d.ts.map +1 -1
- package/lib/cjs/TileStorage.js +34 -3
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +41 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +38 -0
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/core-backend.d.ts +1 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +1 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/package.json +18 -15
package/lib/cjs/CloudSqlite.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { AccessToken, Constructor, GuidString, OpenMode, Optional, PickAsyncMethods, PickMethods } from "@itwin/core-bentley";
|
|
5
5
|
import { LocalDirName, LocalFileName } from "@itwin/core-common";
|
|
6
6
|
import { BlobContainer } from "./BlobContainerService";
|
|
7
|
-
import type { VersionedSqliteDb } from "./SQLiteDb";
|
|
7
|
+
import type { SQLiteDb, VersionedSqliteDb } from "./SQLiteDb";
|
|
8
8
|
/**
|
|
9
9
|
* Types for accessing SQLite databases stored in cloud containers.
|
|
10
10
|
* @beta
|
|
@@ -14,19 +14,19 @@ export declare namespace CloudSqlite {
|
|
|
14
14
|
* Request a new AccessToken for a cloud container using the [[BlobContainer]] service.
|
|
15
15
|
* If the service is unavailable or returns an error, an empty token is returned.
|
|
16
16
|
*/
|
|
17
|
-
function requestToken(args: Optional<BlobContainer.RequestTokenProps, "userToken">): Promise<AccessToken>;
|
|
17
|
+
export function requestToken(args: Optional<BlobContainer.RequestTokenProps, "userToken">): Promise<AccessToken>;
|
|
18
18
|
/**
|
|
19
19
|
* Create a new CloudContainer from a ContainerAccessProps. For non-public containers, a valid accessToken must be provided before the container
|
|
20
20
|
* can be used (e.g. via [[CloudSqlite.requestToken]]).
|
|
21
21
|
* @note After the container is successfully connected to a CloudCache, it will begin auto-refreshing its accessToken every `tokenRefreshSeconds` seconds (default is 1 hour)
|
|
22
22
|
* until it is disconnected. However, if the container is public, or if `tokenRefreshSeconds` is <=0, auto-refresh is not enabled.
|
|
23
23
|
*/
|
|
24
|
-
function createCloudContainer(args: ContainerAccessProps & {
|
|
24
|
+
export function createCloudContainer(args: ContainerAccessProps & {
|
|
25
25
|
accessLevel?: BlobContainer.RequestAccessLevel;
|
|
26
26
|
}): CloudContainer;
|
|
27
27
|
/** Begin prefetching all blocks for a database in a CloudContainer in the background. */
|
|
28
|
-
function startCloudPrefetch(container: CloudContainer, dbName: string, args?: PrefetchProps): CloudPrefetch;
|
|
29
|
-
interface ContainerProps {
|
|
28
|
+
export function startCloudPrefetch(container: CloudContainer, dbName: string, args?: PrefetchProps): CloudPrefetch;
|
|
29
|
+
export interface ContainerProps {
|
|
30
30
|
/** The type of storage provider. */
|
|
31
31
|
storageType: "azure" | "google";
|
|
32
32
|
/** The base URI for the container. */
|
|
@@ -37,7 +37,7 @@ export declare namespace CloudSqlite {
|
|
|
37
37
|
isPublic?: boolean;
|
|
38
38
|
}
|
|
39
39
|
/** Properties to access a CloudContainer. */
|
|
40
|
-
interface ContainerAccessProps extends ContainerProps {
|
|
40
|
+
export interface ContainerAccessProps extends ContainerProps {
|
|
41
41
|
/** an alias for the container. Defaults to `containerId` */
|
|
42
42
|
alias?: string;
|
|
43
43
|
/** SAS token that grants access to the container. */
|
|
@@ -54,7 +54,7 @@ export declare namespace CloudSqlite {
|
|
|
54
54
|
tokenRefreshSeconds?: number;
|
|
55
55
|
}
|
|
56
56
|
/** Returned from `CloudContainer.queryDatabase` describing one database in the container */
|
|
57
|
-
interface CachedDbProps {
|
|
57
|
+
export interface CachedDbProps {
|
|
58
58
|
/** The total number of blocks in the database. */
|
|
59
59
|
readonly totalBlocks: number;
|
|
60
60
|
/** the number of blocks of the database that have been downloaded into the CloudCache */
|
|
@@ -65,11 +65,15 @@ export declare namespace CloudSqlite {
|
|
|
65
65
|
readonly transactions: boolean;
|
|
66
66
|
/** the state of this database. Indicates whether the database is new or deleted since last upload */
|
|
67
67
|
readonly state: "" | "copied" | "deleted";
|
|
68
|
+
/** current number of clients that have this database open. */
|
|
69
|
+
readonly nClient: number;
|
|
70
|
+
/** current number of ongoing prefetches on this database. */
|
|
71
|
+
readonly nPrefetch: number;
|
|
68
72
|
}
|
|
69
73
|
/** Filter options passed to CloudContainer.queryHttpLog
|
|
70
74
|
* @internal
|
|
71
75
|
*/
|
|
72
|
-
interface BcvHttpLogFilterOptions {
|
|
76
|
+
export interface BcvHttpLogFilterOptions {
|
|
73
77
|
/** only return rows whose ID is >= the provided id */
|
|
74
78
|
startFromId?: number;
|
|
75
79
|
/** only return rows whose endTime is null OR >= the provided endTime. */
|
|
@@ -80,7 +84,7 @@ export declare namespace CloudSqlite {
|
|
|
80
84
|
/** Returned from 'CloudContainer.queryHttpLog' describing a row in the bcv_http_log table.
|
|
81
85
|
* @internal
|
|
82
86
|
*/
|
|
83
|
-
interface BcvHttpLog {
|
|
87
|
+
export interface BcvHttpLog {
|
|
84
88
|
/** Unique, monotonically increasing id value */
|
|
85
89
|
readonly id: number;
|
|
86
90
|
/** Time request was made, as iso-8601 */
|
|
@@ -98,35 +102,64 @@ export declare namespace CloudSqlite {
|
|
|
98
102
|
/** HTTP response code (e.g. 200) */
|
|
99
103
|
readonly httpcode: number;
|
|
100
104
|
}
|
|
105
|
+
/** Filter options passed to 'CloudContainer.queryBcvStats'
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
interface BcvStatsFilterOptions {
|
|
109
|
+
/** if true, adds activeClients, totalClients, ongoingPrefetches, and attachedContainers to the result. */
|
|
110
|
+
addClientInformation?: boolean;
|
|
111
|
+
}
|
|
112
|
+
/** Returned from 'CloudContainer.queryBcvStats' describing the rows in the bcv_stat table.
|
|
113
|
+
* Also gathers additional statistics using the other virtual tables bcv_container, bcv_database such as totalClients, ongoingPrefetches, activeClients and attachedContainers.
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
export interface BcvStats {
|
|
117
|
+
/** The total number of cache slots that are currently in use or 'locked' by ongoing client read transactions. In daemonless mode, this value is always 0.
|
|
118
|
+
* A locked cache slot implies that it is not eligible for eviction in the event of a full cachefile.
|
|
119
|
+
*/
|
|
120
|
+
readonly lockedCacheslots: number;
|
|
121
|
+
/** The current number of slots with data in them in the cache. */
|
|
122
|
+
readonly populatedCacheslots: number;
|
|
123
|
+
/** The configured size of the cache, in number of slots. */
|
|
124
|
+
readonly totalCacheslots: number;
|
|
125
|
+
/** The total number of clients opened on this cache */
|
|
126
|
+
readonly totalClients?: number;
|
|
127
|
+
/** The total number of ongoing prefetches on this cache */
|
|
128
|
+
readonly ongoingPrefetches?: number;
|
|
129
|
+
/** The total number of active clients on this cache. An active client is one which has an open read txn. */
|
|
130
|
+
readonly activeClients?: number;
|
|
131
|
+
/** The total number of attached containers on this cache. */
|
|
132
|
+
readonly attachedContainers?: number;
|
|
133
|
+
}
|
|
101
134
|
/** The name of a CloudSqlite database within a CloudContainer. */
|
|
102
|
-
interface DbNameProp {
|
|
135
|
+
export interface DbNameProp {
|
|
103
136
|
/** the name of the database within the CloudContainer.
|
|
104
137
|
* @note names of databases within a CloudContainer are always **case sensitive** on all platforms.*/
|
|
105
138
|
dbName: string;
|
|
106
139
|
}
|
|
107
140
|
/** Properties for accessing a database within a CloudContainer */
|
|
108
|
-
interface DbProps extends DbNameProp {
|
|
141
|
+
export interface DbProps extends DbNameProp {
|
|
109
142
|
/** the name of the local file to access the database. */
|
|
110
143
|
localFileName: LocalFileName;
|
|
111
144
|
}
|
|
112
|
-
type TransferDirection = "upload" | "download";
|
|
113
|
-
interface TransferProgress {
|
|
145
|
+
export type TransferDirection = "upload" | "download";
|
|
146
|
+
export interface TransferProgress {
|
|
114
147
|
/** a user-supplied progress function called during the transfer operation. Return a non-0 value to abort the transfer. */
|
|
115
148
|
onProgress?: (loaded: number, total: number) => number;
|
|
116
149
|
}
|
|
117
|
-
interface CloudHttpProps {
|
|
150
|
+
export interface CloudHttpProps {
|
|
118
151
|
/** The number of simultaneous HTTP requests. Default is 6. */
|
|
119
152
|
nRequests?: number;
|
|
120
153
|
}
|
|
121
|
-
interface PrefetchProps extends CloudHttpProps {
|
|
154
|
+
export interface PrefetchProps extends CloudHttpProps {
|
|
122
155
|
/** timeout between requests, in milliseconds. Default is 100. */
|
|
123
156
|
timeout?: number;
|
|
124
157
|
/** The number of prefetch requests to issue while there is foreground activity. Default is 3. */
|
|
125
158
|
minRequests?: number;
|
|
126
159
|
}
|
|
127
|
-
type TransferDbProps = DbProps & TransferProgress & CloudHttpProps;
|
|
160
|
+
export type TransferDbProps = DbProps & TransferProgress & CloudHttpProps;
|
|
128
161
|
/** Properties for creating a CloudCache. */
|
|
129
|
-
interface CacheProps extends CloudHttpProps {
|
|
162
|
+
export interface CacheProps extends CloudHttpProps {
|
|
130
163
|
/** full path of directory for cache to store its files. Must be on a (preferably fast) local drive, and must be empty when the cache is first created. */
|
|
131
164
|
rootDir: string;
|
|
132
165
|
/** name of this cache. It is possible to have more than one CloudCache in the same session, but each must have a unique name. */
|
|
@@ -137,7 +170,7 @@ export declare namespace CloudSqlite {
|
|
|
137
170
|
curlDiagnostics?: boolean;
|
|
138
171
|
}
|
|
139
172
|
/** Parameters used to obtain the write lock on a cloud container */
|
|
140
|
-
interface ObtainLockParams {
|
|
173
|
+
export interface ObtainLockParams {
|
|
141
174
|
/** a string that identifies me to others if I hold the lock while they attempt to acquire it. */
|
|
142
175
|
user?: string;
|
|
143
176
|
/** number of times to retry in the event the lock currently held by someone else.
|
|
@@ -153,7 +186,7 @@ export declare namespace CloudSqlite {
|
|
|
153
186
|
onFailure?: WriteLockBusyHandler;
|
|
154
187
|
}
|
|
155
188
|
/** @internal */
|
|
156
|
-
interface LockAndOpenArgs {
|
|
189
|
+
export interface LockAndOpenArgs extends SQLiteDb.WithOpenDbArgs {
|
|
157
190
|
/** a string that identifies me to others if I hold the lock while they attempt to acquire it. */
|
|
158
191
|
user: string;
|
|
159
192
|
/** the name of the database within the container */
|
|
@@ -162,9 +195,11 @@ export declare namespace CloudSqlite {
|
|
|
162
195
|
container: CloudContainer;
|
|
163
196
|
/** if present, function called when the write lock is currently held by another user. */
|
|
164
197
|
busyHandler?: WriteLockBusyHandler;
|
|
198
|
+
/** if present, open mode for Db. Default is ReadWrite */
|
|
199
|
+
openMode?: OpenMode;
|
|
165
200
|
}
|
|
166
201
|
/** Logging categories for `CloudCache.setLogMask` */
|
|
167
|
-
enum LoggingMask {
|
|
202
|
+
export enum LoggingMask {
|
|
168
203
|
/** log all HTTP requests and responses */
|
|
169
204
|
HTTP = 1,
|
|
170
205
|
/** log as blocks become dirty and must be uploaded */
|
|
@@ -197,7 +232,7 @@ export declare namespace CloudSqlite {
|
|
|
197
232
|
* - The contents of the cache directory are entirely controlled by CloudSqlite and should be empty when the cache is
|
|
198
233
|
* first created and never modified directly thereafter.
|
|
199
234
|
*/
|
|
200
|
-
interface CloudCache {
|
|
235
|
+
export interface CloudCache {
|
|
201
236
|
/** `true` if this CloudCache is connected to a daemon process */
|
|
202
237
|
get isDaemon(): boolean;
|
|
203
238
|
/** The name for this CloudCache. */
|
|
@@ -235,7 +270,7 @@ export declare namespace CloudSqlite {
|
|
|
235
270
|
* - when a CloudContainer is created, it may either be readonly or writeable. If a container is never meant to be used for writes,
|
|
236
271
|
* it is slightly more efficient to indicate that by passing `writeable: false`
|
|
237
272
|
*/
|
|
238
|
-
interface CloudContainer {
|
|
273
|
+
export interface CloudContainer {
|
|
239
274
|
onConnect?: (container: CloudContainer, cache: CloudCache) => void;
|
|
240
275
|
onConnected?: (container: CloudContainer) => void;
|
|
241
276
|
onDisconnect?: (container: CloudContainer, detach: boolean) => void;
|
|
@@ -251,6 +286,10 @@ export declare namespace CloudSqlite {
|
|
|
251
286
|
get alias(): string;
|
|
252
287
|
/** The logId. */
|
|
253
288
|
get logId(): string;
|
|
289
|
+
/** The time that the write lock expires. Of the form 'YYYY-MM-DDTHH:MM:SS.000Z' in UTC.
|
|
290
|
+
* Returns empty string if write lock is not held.
|
|
291
|
+
*/
|
|
292
|
+
get writeLockExpires(): string;
|
|
254
293
|
/** true if this CloudContainer is currently connected to a CloudCache via the `connect` method. */
|
|
255
294
|
get isConnected(): boolean;
|
|
256
295
|
/** true if this CloudContainer was created with the `writeable` flag (and its `accessToken` supplies write access). */
|
|
@@ -380,6 +419,11 @@ export declare namespace CloudSqlite {
|
|
|
380
419
|
* @internal
|
|
381
420
|
*/
|
|
382
421
|
queryHttpLog(filterOptions?: BcvHttpLogFilterOptions): CloudSqlite.BcvHttpLog[];
|
|
422
|
+
/**
|
|
423
|
+
* query the bcv_stat table.
|
|
424
|
+
* @internal
|
|
425
|
+
*/
|
|
426
|
+
queryBcvStats(filterOptions?: BcvStatsFilterOptions): CloudSqlite.BcvStats;
|
|
383
427
|
/**
|
|
384
428
|
* Get the SHA1 hash of the content of a database.
|
|
385
429
|
* @param dbName the name of the database of interest
|
|
@@ -391,7 +435,7 @@ export declare namespace CloudSqlite {
|
|
|
391
435
|
* Object returned by [[CloudSqlite.startCloudPrefetch]].
|
|
392
436
|
* It holds a promise that is fulfilled when a Prefetch is completed. May also be used to cancel an in-progress prefetch.
|
|
393
437
|
*/
|
|
394
|
-
interface CloudPrefetch {
|
|
438
|
+
export interface CloudPrefetch {
|
|
395
439
|
readonly cloudContainer: CloudContainer;
|
|
396
440
|
readonly dbName: string;
|
|
397
441
|
/** Cancel a currently pending prefetch. The promise will be resolved immediately after this call. */
|
|
@@ -408,13 +452,13 @@ export declare namespace CloudSqlite {
|
|
|
408
452
|
promise: Promise<boolean>;
|
|
409
453
|
}
|
|
410
454
|
/** @internal */
|
|
411
|
-
function transferDb(direction: TransferDirection, container: CloudContainer, props: TransferDbProps): Promise<void>;
|
|
455
|
+
export function transferDb(direction: TransferDirection, container: CloudContainer, props: TransferDbProps): Promise<void>;
|
|
412
456
|
/** Upload a local SQLite database file into a CloudContainer.
|
|
413
457
|
* @param container the CloudContainer holding the database. Must be connected.
|
|
414
458
|
* @param props the properties that describe the database to be downloaded, plus optionally an `onProgress` function.
|
|
415
459
|
* @note this function requires that the write lock be held on the container
|
|
416
460
|
*/
|
|
417
|
-
function uploadDb(container: CloudContainer, props: TransferDbProps): Promise<void>;
|
|
461
|
+
export function uploadDb(container: CloudContainer, props: TransferDbProps): Promise<void>;
|
|
418
462
|
/** Download a database from a CloudContainer.
|
|
419
463
|
* @param container the CloudContainer holding the database. Must be connected.
|
|
420
464
|
* @param props the properties that describe the database to be downloaded, plus optionally an `onProgress` function.
|
|
@@ -422,30 +466,30 @@ export declare namespace CloudSqlite {
|
|
|
422
466
|
* @note the download is "restartable." If the transfer is aborted and then re-requested, it will continue from where
|
|
423
467
|
* it left off rather than re-downloading the entire file.
|
|
424
468
|
*/
|
|
425
|
-
function downloadDb(container: CloudContainer, props: TransferDbProps): Promise<void>;
|
|
469
|
+
export function downloadDb(container: CloudContainer, props: TransferDbProps): Promise<void>;
|
|
426
470
|
/** Optional method to be called when an attempt to acquire the write lock fails because another user currently holds it.
|
|
427
471
|
* @param lockedBy The identifier supplied by the application/user that currently holds the lock.
|
|
428
472
|
* @param expires a stringified Date (in local time) indicating when the lock will expire.
|
|
429
473
|
* @return "stop" to give up and stop retrying. Generally, it's a good idea to wait for some time before returning.
|
|
430
474
|
*/
|
|
431
|
-
type WriteLockBusyHandler = (lockedBy: string, expires: string) => Promise<void | "stop">;
|
|
475
|
+
export type WriteLockBusyHandler = (lockedBy: string, expires: string) => Promise<void | "stop">;
|
|
432
476
|
/**
|
|
433
477
|
* Attempt to acquire the write lock for a container, with retries.
|
|
434
478
|
* If write lock is held by another user, call busyHandler if supplied. If no busyHandler, or handler returns "stop", throw. Otherwise try again.
|
|
435
|
-
* @note if write lock is already held, this function
|
|
479
|
+
* @note if write lock is already held by the same user, this function will refresh the write lock's expiry time.
|
|
436
480
|
* @param user the name to be displayed to other users in the event they attempt to obtain the lock while it is held by us
|
|
437
481
|
* @param container the CloudContainer for which the lock is to be acquired
|
|
438
482
|
* @param busyHandler if present, function called when the write lock is currently held by another user.
|
|
439
483
|
* @throws if [[container]] is not connected to a CloudCache.
|
|
440
484
|
*/
|
|
441
|
-
function acquireWriteLock(args: {
|
|
485
|
+
export function acquireWriteLock(args: {
|
|
442
486
|
user: string;
|
|
443
487
|
container: CloudContainer;
|
|
444
488
|
busyHandler?: WriteLockBusyHandler;
|
|
445
489
|
}): Promise<void>;
|
|
446
490
|
/**
|
|
447
491
|
* Perform an asynchronous write operation on a CloudContainer with the write lock held.
|
|
448
|
-
* 1. if write lock is already held by the current user, call operation and return.
|
|
492
|
+
* 1. if write lock is already held by the current user, refresh write lock's expiry time, call operation and return.
|
|
449
493
|
* 2. attempt to acquire the write lock, with retries. Throw if unable to obtain write lock.
|
|
450
494
|
* 3. perform the operation
|
|
451
495
|
* 3.a if the operation throws, abandon all changes and re-throw
|
|
@@ -457,13 +501,13 @@ export declare namespace CloudSqlite {
|
|
|
457
501
|
* @param busyHandler if present, function called when the write lock is currently held by another user.
|
|
458
502
|
* @returns a Promise with the result of `operation`
|
|
459
503
|
*/
|
|
460
|
-
function withWriteLock<T>(args: {
|
|
504
|
+
export function withWriteLock<T>(args: {
|
|
461
505
|
user: string;
|
|
462
506
|
container: CloudContainer;
|
|
463
507
|
busyHandler?: WriteLockBusyHandler;
|
|
464
508
|
}, operation: () => Promise<T>): Promise<T>;
|
|
465
509
|
/** Arguments to create or find a CloudCache */
|
|
466
|
-
interface CreateCloudCacheArg {
|
|
510
|
+
export interface CreateCloudCacheArg {
|
|
467
511
|
/** The name of the CloudCache. CloudCache names must be unique. */
|
|
468
512
|
cacheName: string;
|
|
469
513
|
/** A string that specifies the maximum size of the CloudCache. It should be a number followed by "K",
|
|
@@ -475,7 +519,7 @@ export declare namespace CloudSqlite {
|
|
|
475
519
|
cacheDir?: string;
|
|
476
520
|
}
|
|
477
521
|
/** The collection of currently extant `CloudCache`s, by name. */
|
|
478
|
-
class CloudCaches {
|
|
522
|
+
export class CloudCaches {
|
|
479
523
|
private static readonly cloudCaches;
|
|
480
524
|
/** create a new CloudCache */
|
|
481
525
|
private static makeCache;
|
|
@@ -491,7 +535,7 @@ export declare namespace CloudSqlite {
|
|
|
491
535
|
static getCache(args: CreateCloudCacheArg): CloudCache;
|
|
492
536
|
}
|
|
493
537
|
/** Class that provides convenient local access to a SQLite database in a CloudContainer. */
|
|
494
|
-
class DbAccess<DbType extends VersionedSqliteDb, ReadMethods = DbType, WriteMethods = DbType> {
|
|
538
|
+
export class DbAccess<DbType extends VersionedSqliteDb, ReadMethods = DbType, WriteMethods = DbType> {
|
|
495
539
|
/** The name of the database within the cloud container. */
|
|
496
540
|
readonly dbName: string;
|
|
497
541
|
/** Parameters for obtaining the write lock for this container. */
|
|
@@ -597,5 +641,6 @@ export declare namespace CloudSqlite {
|
|
|
597
641
|
*/
|
|
598
642
|
get reader(): PickMethods<ReadMethods>;
|
|
599
643
|
}
|
|
644
|
+
export {};
|
|
600
645
|
}
|
|
601
646
|
//# sourceMappingURL=CloudSqlite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudSqlite.d.ts","sourceRoot":"","sources":["../../src/CloudSqlite.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EACL,WAAW,EAA+B,WAAW,EAAE,UAAU,EAAU,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAC7H,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"CloudSqlite.d.ts","sourceRoot":"","sources":["../../src/CloudSqlite.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EACL,WAAW,EAA+B,WAAW,EAAE,UAAU,EAAU,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAC7H,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,KAAK,EAAE,QAAQ,EAA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AW;QAOnB;;;;;;;;;;;;WAYG;QACH,IAAW,WAAW,mCAOrB;QAED;;;WAGG;QACH,IAAW,MAAM,6BAOhB;KACF;;CACF"}
|
package/lib/cjs/CloudSqlite.js
CHANGED
|
@@ -48,7 +48,7 @@ var CloudSqlite;
|
|
|
48
48
|
container.lockExpireSeconds = args.lockExpireSeconds ?? 60 * 60; // default is 1 hour
|
|
49
49
|
// don't refresh tokens for public containers or if refreshSeconds<=0
|
|
50
50
|
if (!args.isPublic && refreshSeconds > 0) {
|
|
51
|
-
const tokenProps = { baseUri: args.baseUri, containerId: args.containerId,
|
|
51
|
+
const tokenProps = { baseUri: args.baseUri, containerId: args.containerId, accessLevel: args.accessLevel };
|
|
52
52
|
const doRefresh = async () => {
|
|
53
53
|
let newToken;
|
|
54
54
|
const url = `[${tokenProps.baseUri}/${tokenProps.containerId}]`;
|
|
@@ -156,7 +156,7 @@ var CloudSqlite;
|
|
|
156
156
|
/**
|
|
157
157
|
* Attempt to acquire the write lock for a container, with retries.
|
|
158
158
|
* If write lock is held by another user, call busyHandler if supplied. If no busyHandler, or handler returns "stop", throw. Otherwise try again.
|
|
159
|
-
* @note if write lock is already held, this function
|
|
159
|
+
* @note if write lock is already held by the same user, this function will refresh the write lock's expiry time.
|
|
160
160
|
* @param user the name to be displayed to other users in the event they attempt to obtain the lock while it is held by us
|
|
161
161
|
* @param container the CloudContainer for which the lock is to be acquired
|
|
162
162
|
* @param busyHandler if present, function called when the write lock is currently held by another user.
|
|
@@ -167,8 +167,9 @@ var CloudSqlite;
|
|
|
167
167
|
while (true) {
|
|
168
168
|
try {
|
|
169
169
|
if (container.hasWriteLock) {
|
|
170
|
-
if (container.writeLockHeldBy === args.user)
|
|
171
|
-
return; //
|
|
170
|
+
if (container.writeLockHeldBy === args.user) {
|
|
171
|
+
return container.acquireWriteLock(args.user); // refresh the write lock's expiry time.
|
|
172
|
+
}
|
|
172
173
|
const err = new Error(); // lock held by another user within this process
|
|
173
174
|
err.errorNumber = 5;
|
|
174
175
|
err.lockedBy = container.writeLockHeldBy;
|
|
@@ -187,7 +188,7 @@ var CloudSqlite;
|
|
|
187
188
|
CloudSqlite.acquireWriteLock = acquireWriteLock;
|
|
188
189
|
/**
|
|
189
190
|
* Perform an asynchronous write operation on a CloudContainer with the write lock held.
|
|
190
|
-
* 1. if write lock is already held by the current user, call operation and return.
|
|
191
|
+
* 1. if write lock is already held by the current user, refresh write lock's expiry time, call operation and return.
|
|
191
192
|
* 2. attempt to acquire the write lock, with retries. Throw if unable to obtain write lock.
|
|
192
193
|
* 3. perform the operation
|
|
193
194
|
* 3.a if the operation throws, abandon all changes and re-throw
|
|
@@ -206,18 +207,15 @@ var CloudSqlite;
|
|
|
206
207
|
if (containerInternal.writeLockHeldBy === args.user) // If the user already had the write lock, then don't release it.
|
|
207
208
|
return await operation();
|
|
208
209
|
containerInternal.writeLockHeldBy = args.user;
|
|
209
|
-
containerInternal.writeLockExpires = new Date(Date.now() + 1000 * containerInternal.lockExpireSeconds).toLocaleString();
|
|
210
210
|
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
211
211
|
const val = await operation(); // wait for work to finish or fail
|
|
212
212
|
containerInternal.releaseWriteLock();
|
|
213
213
|
containerInternal.writeLockHeldBy = undefined;
|
|
214
|
-
containerInternal.writeLockExpires = undefined;
|
|
215
214
|
return val;
|
|
216
215
|
}
|
|
217
216
|
catch (e) {
|
|
218
217
|
args.container.abandonChanges(); // if operation threw, abandon all changes
|
|
219
218
|
containerInternal.writeLockHeldBy = undefined;
|
|
220
|
-
containerInternal.writeLockExpires = undefined;
|
|
221
219
|
throw e;
|
|
222
220
|
}
|
|
223
221
|
}
|
|
@@ -385,7 +383,7 @@ var CloudSqlite;
|
|
|
385
383
|
let lockObtained = false;
|
|
386
384
|
const operationName = args.operationName;
|
|
387
385
|
try {
|
|
388
|
-
return await this._cloudDb.withLockedContainer({ user, dbName: this.dbName, container: this.container, busyHandler }, async () => {
|
|
386
|
+
return await this._cloudDb.withLockedContainer({ user, dbName: this.dbName, container: this.container, busyHandler, openMode: args.openMode }, async () => {
|
|
389
387
|
lockObtained = true;
|
|
390
388
|
logInfo(`lock acquired by ${cacheGuid} for ${operationName} ${showMs()}`);
|
|
391
389
|
return operation();
|