@holo-js/cache-db 0.2.5 → 0.3.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/dist/index.d.ts +8 -2
- package/dist/index.mjs +9 -1
- package/package.json +8 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CacheDriverContract } from '@holo-js/cache';
|
|
2
|
-
import {
|
|
2
|
+
import { DatabaseContext, DatabaseContextOptions, SupportedDatabaseDriver } from '@holo-js/db';
|
|
3
|
+
import { HoloProjectConnectionConfig } from '@holo-js/kernel';
|
|
3
4
|
|
|
4
5
|
declare const DEFAULT_CACHE_DATABASE_TABLE = "cache";
|
|
5
6
|
declare const DEFAULT_CACHE_DATABASE_LOCK_TABLE = "cache_locks";
|
|
@@ -89,6 +90,11 @@ declare function withDatabaseCacheTableGuard<TValue>(tableName: string, lockTabl
|
|
|
89
90
|
declare function readEntry(connection: DatabaseContext, tableName: string, key: string, now: number): Promise<DatabaseReadResult<DatabaseCacheEntryRow>>;
|
|
90
91
|
declare function readLock(connection: DatabaseContext, tableName: string, name: string, now: number): Promise<DatabaseReadResult<DatabaseCacheLockRow>>;
|
|
91
92
|
declare function createDatabaseCacheDriver(options: DatabaseCacheDriverOptions): CacheDriverContract;
|
|
93
|
+
declare const databaseCacheDriverFactory: Readonly<{
|
|
94
|
+
driver: "database";
|
|
95
|
+
registrationKey: "@holo-js/cache-db";
|
|
96
|
+
create: typeof createDatabaseCacheDriver;
|
|
97
|
+
}>;
|
|
92
98
|
declare const cacheDbInternals: {
|
|
93
99
|
createDatabaseConnection: typeof createDatabaseConnection;
|
|
94
100
|
createDatabaseContextOptions: typeof createDatabaseContextOptions;
|
|
@@ -102,4 +108,4 @@ declare const cacheDbInternals: {
|
|
|
102
108
|
withDatabaseCacheTableGuard: typeof withDatabaseCacheTableGuard;
|
|
103
109
|
};
|
|
104
110
|
|
|
105
|
-
export { CACHE_DATABASE_TABLE_DEFINITIONS, type CacheDatabaseTableColumnDefinition, type CacheDatabaseTableColumnKind, type CacheDatabaseTableDefinition, DEFAULT_CACHE_DATABASE_LOCK_TABLE, DEFAULT_CACHE_DATABASE_TABLE, type DatabaseCacheDriverOptions, cacheDbInternals, createDatabaseCacheDriver };
|
|
111
|
+
export { CACHE_DATABASE_TABLE_DEFINITIONS, type CacheDatabaseTableColumnDefinition, type CacheDatabaseTableColumnKind, type CacheDatabaseTableDefinition, DEFAULT_CACHE_DATABASE_LOCK_TABLE, DEFAULT_CACHE_DATABASE_TABLE, type DatabaseCacheDriverOptions, cacheDbInternals, createDatabaseCacheDriver, databaseCacheDriverFactory };
|
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
CacheInvalidNumericMutationError,
|
|
6
6
|
CacheLockAcquisitionError,
|
|
7
7
|
deserializeCacheValue,
|
|
8
|
+
registerCacheDriverFactory,
|
|
8
9
|
serializeCacheValue
|
|
9
10
|
} from "@holo-js/cache";
|
|
10
11
|
import {
|
|
@@ -372,6 +373,12 @@ function createDatabaseCacheDriver(options) {
|
|
|
372
373
|
}
|
|
373
374
|
};
|
|
374
375
|
}
|
|
376
|
+
var databaseCacheDriverFactory = Object.freeze({
|
|
377
|
+
driver: "database",
|
|
378
|
+
registrationKey: "@holo-js/cache-db",
|
|
379
|
+
create: createDatabaseCacheDriver
|
|
380
|
+
});
|
|
381
|
+
registerCacheDriverFactory(databaseCacheDriverFactory);
|
|
375
382
|
var cacheDbInternals = {
|
|
376
383
|
createDatabaseConnection,
|
|
377
384
|
createDatabaseContextOptions,
|
|
@@ -389,5 +396,6 @@ export {
|
|
|
389
396
|
DEFAULT_CACHE_DATABASE_LOCK_TABLE,
|
|
390
397
|
DEFAULT_CACHE_DATABASE_TABLE,
|
|
391
398
|
cacheDbInternals,
|
|
392
|
-
createDatabaseCacheDriver
|
|
399
|
+
createDatabaseCacheDriver,
|
|
400
|
+
databaseCacheDriverFactory
|
|
393
401
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/cache-db",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Holo-JS Framework - DB-backed cache driver",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,15 +23,18 @@
|
|
|
23
23
|
"test": "vitest --run"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@holo-js/cache": "^0.
|
|
27
|
-
"@holo-js/db": "^0.
|
|
26
|
+
"@holo-js/cache": "^0.3.0",
|
|
27
|
+
"@holo-js/db": "^0.3.0",
|
|
28
|
+
"@holo-js/kernel": "^0.3.0"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
31
|
"tslib": "^2.8.1"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@holo-js/cache": "^0.
|
|
34
|
-
"@holo-js/db": "^0.
|
|
34
|
+
"@holo-js/cache": "^0.3.0",
|
|
35
|
+
"@holo-js/db": "^0.3.0",
|
|
36
|
+
"@holo-js/db-sqlite": "^0.3.0",
|
|
37
|
+
"@holo-js/kernel": "^0.3.0",
|
|
35
38
|
"@types/node": "^22.10.2",
|
|
36
39
|
"tsup": "^8.3.5",
|
|
37
40
|
"typescript": "^5.7.2",
|