ueberdb2 5.0.48 → 6.0.1
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/{AbstractDatabase-a4jdIEuT.js → AbstractDatabase-DfQ39Ry6.js} +6 -13
- package/dist/{cassandra_db-C5K2zZew.js → cassandra_db-B_5ANRzM.js} +6 -7
- package/dist/{couch_db-BVd81sS7.js → couch_db-BXyzauwJ.js} +5 -20
- package/dist/databases/cassandra_db.d.ts +5 -3
- package/dist/databases/cassandra_db.d.ts.map +1 -1
- package/dist/databases/couch_db.d.ts +2 -4
- package/dist/databases/couch_db.d.ts.map +1 -1
- package/dist/databases/dirty_db.d.ts +1 -1
- package/dist/databases/dirty_db.d.ts.map +1 -1
- package/dist/databases/dirty_git_db.d.ts +1 -1
- package/dist/databases/dirty_git_db.d.ts.map +1 -1
- package/dist/databases/elasticsearch_db.d.ts +2 -2
- package/dist/databases/elasticsearch_db.d.ts.map +1 -1
- package/dist/databases/memory_db.d.ts +1 -1
- package/dist/databases/memory_db.d.ts.map +1 -1
- package/dist/databases/mock_db.d.ts +1 -1
- package/dist/databases/mock_db.d.ts.map +1 -1
- package/dist/databases/mongodb_db.d.ts +4 -3
- package/dist/databases/mongodb_db.d.ts.map +1 -1
- package/dist/databases/mssql_db.d.ts +3 -3
- package/dist/databases/mssql_db.d.ts.map +1 -1
- package/dist/databases/mysql_db.d.ts +3 -3
- package/dist/databases/mysql_db.d.ts.map +1 -1
- package/dist/databases/postgres_db.d.ts +2 -2
- package/dist/databases/postgres_db.d.ts.map +1 -1
- package/dist/databases/postgrespool_db.d.ts +1 -1
- package/dist/databases/postgrespool_db.d.ts.map +1 -1
- package/dist/databases/redis_db.d.ts +3 -3
- package/dist/databases/redis_db.d.ts.map +1 -1
- package/dist/databases/rethink_db.d.ts +2 -2
- package/dist/databases/rethink_db.d.ts.map +1 -1
- package/dist/databases/sqlite_db.d.ts +2 -2
- package/dist/databases/sqlite_db.d.ts.map +1 -1
- package/dist/databases/surrealdb_db.d.ts +3 -3
- package/dist/databases/surrealdb_db.d.ts.map +1 -1
- package/dist/{dirty_db-C9zUhXIG.js → dirty_db-CocfsG5w.js} +5 -7
- package/dist/{dirty_git_db-Cj3oEEyZ.js → dirty_git_db-BYnH74Hk.js} +8 -10
- package/dist/{elasticsearch_db-DjnZ1DHG.js → elasticsearch_db-C6G-Wnou.js} +12 -14
- package/dist/index.d.ts +44 -91
- package/dist/index.js +106 -282
- package/dist/lib/AbstractDatabase.d.ts +13 -15
- package/dist/lib/AbstractDatabase.d.ts.map +1 -1
- package/dist/lib/CacheAndBufferLayer.d.ts +95 -77
- package/dist/lib/CacheAndBufferLayer.d.ts.map +1 -1
- package/dist/lib/logging.d.ts +12 -2
- package/dist/lib/logging.d.ts.map +1 -1
- package/dist/logging-DOvFhjsQ.js +22 -0
- package/dist/{memory_db-SlQsh4tk.js → memory_db-CGTi0Ck-.js} +3 -3
- package/dist/{mock_db-BBijMErd.js → mock_db-DCUmGtUq.js} +3 -5
- package/dist/{mongodb_db-ByZscnbs.js → mongodb_db-DgkIuEMZ.js} +5 -6
- package/dist/{mssql_db-C9-gmVgP.js → mssql_db-LiEvv4Sm.js} +19 -22
- package/dist/{mysql_db-CRYtP-Mk.js → mysql_db-48mMBbKZ.js} +7 -10
- package/dist/{postgres_db-CVDQiNwN.js → postgres_db-7Hiezhpi.js} +6 -9
- package/dist/{postgrespool_db-CynysVC1.js → postgrespool_db-CdF-1S34.js} +3 -3
- package/dist/{redis_db-CDma40om.js → redis_db-DKRC8sR9.js} +7 -8
- package/dist/{rethink_db-D7NvPe_4.js → rethink_db-BGxY_SA3.js} +15 -18
- package/dist/{rusty_db-CaVGu0z7.js → rusty_db-Msjxckfm.js} +5 -6
- package/dist/{sqlite_db-B-nmfVje.js → sqlite_db-Cy8OT62U.js} +5 -6
- package/dist/{surrealdb_db-JmcyCabz.js → surrealdb_db-XnhMQEwL.js} +10 -10
- package/package.json +88 -38
- package/dist/chunk-8l464Juk.js +0 -28
- package/dist/logging-DmqnZRde.js +0 -25
package/dist/index.d.ts
CHANGED
|
@@ -1,99 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 2011 Peter 'Pita' Martischka
|
|
3
|
+
* 2020 John McLear
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS-IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Database as DatabaseCache, type Metrics } from './lib/CacheAndBufferLayer';
|
|
18
|
+
import { normalizeLogger } from './lib/logging';
|
|
19
|
+
import type { Settings } from './lib/AbstractDatabase';
|
|
20
|
+
export type { Settings } from './lib/AbstractDatabase';
|
|
21
|
+
export type { Metrics, CacheSettings } from './lib/CacheAndBufferLayer';
|
|
22
|
+
export type { Logger } from './lib/logging';
|
|
23
|
+
export type DatabaseType = 'cassandra' | 'couch' | 'dirty' | 'dirtygit' | 'elasticsearch' | 'memory' | 'mock' | 'mongodb' | 'mssql' | 'mysql' | 'postgres' | 'postgrespool' | 'redis' | 'rethink' | 'rustydb' | 'sqlite' | 'surrealdb';
|
|
3
24
|
export declare class Database {
|
|
4
25
|
readonly type: DatabaseType;
|
|
5
|
-
readonly dbSettings:
|
|
6
|
-
readonly wrapperSettings:
|
|
7
|
-
readonly
|
|
8
|
-
db:
|
|
9
|
-
metrics:
|
|
26
|
+
readonly dbSettings: Settings | null | string;
|
|
27
|
+
readonly wrapperSettings: Record<string, unknown> | null;
|
|
28
|
+
private readonly _logger;
|
|
29
|
+
db: DatabaseCache;
|
|
30
|
+
metrics: Metrics;
|
|
10
31
|
/**
|
|
11
32
|
* @param type The type of the database
|
|
12
33
|
* @param dbSettings The settings for that specific database type
|
|
13
|
-
* @param wrapperSettings
|
|
14
|
-
* @param logger Optional logger
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* Deprecated synonym of flush().
|
|
30
|
-
*
|
|
31
|
-
* @param callback - Deprecated. Node-style callback. If null, a Promise is returned.
|
|
32
|
-
*/
|
|
33
|
-
doShutdown(callback?: null): any;
|
|
34
|
-
/**
|
|
35
|
-
* Writes any unsaved changes to the underlying database.
|
|
36
|
-
*
|
|
37
|
-
* @param callback - Deprecated. Node-style callback. If null, a Promise is returned.
|
|
38
|
-
*/
|
|
39
|
-
flush(callback?: null): any;
|
|
40
|
-
/**
|
|
41
|
-
* @param key
|
|
42
|
-
* @param callback - Deprecated. Node-style callback. If null, a Promise is returned.
|
|
43
|
-
*/
|
|
44
|
-
get(key: string, callback?: null): any;
|
|
45
|
-
/**
|
|
46
|
-
* @param key
|
|
47
|
-
* @param notKey
|
|
48
|
-
* @param callback - Deprecated. Node-style callback. If null, a Promise is returned.
|
|
49
|
-
*/
|
|
50
|
-
findKeys(key: string, notKey?: string, callback?: null): any;
|
|
51
|
-
/**
|
|
52
|
-
* Removes an entry from the database if present.
|
|
53
|
-
*
|
|
54
|
-
* @param key
|
|
55
|
-
* @param cb Deprecated. Node-style callback. Called when the write has been committed to the
|
|
56
|
-
* underlying database driver. If null, a Promise is returned.
|
|
57
|
-
* @param deprecated Deprecated callback that is called just after cb. Ignored if cb is null.
|
|
58
|
-
*/
|
|
59
|
-
remove(key: string, cb?: null, deprecated?: null): any;
|
|
60
|
-
/**
|
|
61
|
-
* Adds or changes the value of an entry.
|
|
62
|
-
*
|
|
63
|
-
* @param key
|
|
64
|
-
* @param value
|
|
65
|
-
* @param cb Deprecated. Node-style callback. Called when the write has been committed to the
|
|
66
|
-
* underlying database driver. If null, a Promise is returned.
|
|
67
|
-
* @param deprecated Deprecated callback that is called just after cb. Ignored if cb is null.
|
|
68
|
-
*/
|
|
69
|
-
set(key: string, value: any, cb?: null, deprecated?: null): any;
|
|
70
|
-
/**
|
|
71
|
-
* @param key
|
|
72
|
-
* @param sub
|
|
73
|
-
* @param callback - Deprecated. Node-style callback. If null, a Promise is returned.
|
|
74
|
-
*/
|
|
75
|
-
getSub(key: string, sub: string[], callback?: Function | null): any;
|
|
76
|
-
/**
|
|
77
|
-
* Adds or changes a subvalue of an entry.
|
|
78
|
-
*
|
|
79
|
-
* @param key
|
|
80
|
-
* @param sub
|
|
81
|
-
* @param value
|
|
82
|
-
* @param cb Deprecated. Node-style callback. Called when the write has been committed to the
|
|
83
|
-
* underlying database driver. If null, a Promise is returned.
|
|
84
|
-
* @param deprecated Deprecated callback that is called just after cb. Ignored if cb is null.
|
|
85
|
-
*/
|
|
86
|
-
setSub(key: string, sub: string, value: string, cb?: Function | null, deprecated?: Function | null): any;
|
|
87
|
-
/**
|
|
88
|
-
* Flushes unwritten changes then closes the connection to the underlying database. After this
|
|
89
|
-
* returns, any future call to a method on this object may result in an error.
|
|
90
|
-
*
|
|
91
|
-
* @param callback - Deprecated. Node-style callback. If null, a Promise is returned.
|
|
92
|
-
*/
|
|
93
|
-
close(callback?: Function | null): any;
|
|
34
|
+
* @param wrapperSettings Cache/buffer layer settings (cache size, write interval, etc.)
|
|
35
|
+
* @param logger Optional logger (log4js, console, or any object with debug/info/warn/error methods)
|
|
36
|
+
*/
|
|
37
|
+
constructor(type: DatabaseType | undefined, dbSettings: Settings | null | string, wrapperSettings?: Record<string, unknown> | null, logger?: Partial<ReturnType<typeof normalizeLogger>> | null);
|
|
38
|
+
init(): Promise<void>;
|
|
39
|
+
private initDB;
|
|
40
|
+
flush(): Promise<void>;
|
|
41
|
+
/** @deprecated Use flush() */
|
|
42
|
+
doShutdown(): Promise<void>;
|
|
43
|
+
get(key: string): Promise<unknown>;
|
|
44
|
+
findKeys(key: string, notKey?: string): Promise<string[]>;
|
|
45
|
+
remove(key: string): Promise<void>;
|
|
46
|
+
set(key: string, value: unknown): Promise<void>;
|
|
47
|
+
getSub(key: string, sub: string[]): Promise<unknown>;
|
|
48
|
+
setSub(key: string, sub: string[], value: unknown): Promise<void>;
|
|
49
|
+
close(): Promise<void>;
|
|
94
50
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Deprecated synonym of Database.
|
|
97
|
-
*/
|
|
98
51
|
export default Database;
|
|
99
52
|
//# sourceMappingURL=index.d.ts.map
|