ueberdb2 5.0.48 → 6.0.2

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 (62) hide show
  1. package/dist/{AbstractDatabase-a4jdIEuT.js → AbstractDatabase-DfQ39Ry6.js} +6 -13
  2. package/dist/{cassandra_db-C5K2zZew.js → cassandra_db-B_5ANRzM.js} +6 -7
  3. package/dist/{couch_db-BVd81sS7.js → couch_db-BXyzauwJ.js} +5 -20
  4. package/dist/databases/cassandra_db.d.ts +5 -3
  5. package/dist/databases/cassandra_db.d.ts.map +1 -1
  6. package/dist/databases/couch_db.d.ts +2 -4
  7. package/dist/databases/couch_db.d.ts.map +1 -1
  8. package/dist/databases/dirty_db.d.ts +1 -1
  9. package/dist/databases/dirty_db.d.ts.map +1 -1
  10. package/dist/databases/dirty_git_db.d.ts +1 -1
  11. package/dist/databases/dirty_git_db.d.ts.map +1 -1
  12. package/dist/databases/elasticsearch_db.d.ts +2 -2
  13. package/dist/databases/elasticsearch_db.d.ts.map +1 -1
  14. package/dist/databases/memory_db.d.ts +1 -1
  15. package/dist/databases/memory_db.d.ts.map +1 -1
  16. package/dist/databases/mock_db.d.ts +1 -1
  17. package/dist/databases/mock_db.d.ts.map +1 -1
  18. package/dist/databases/mongodb_db.d.ts +4 -3
  19. package/dist/databases/mongodb_db.d.ts.map +1 -1
  20. package/dist/databases/mssql_db.d.ts +3 -3
  21. package/dist/databases/mssql_db.d.ts.map +1 -1
  22. package/dist/databases/mysql_db.d.ts +3 -3
  23. package/dist/databases/mysql_db.d.ts.map +1 -1
  24. package/dist/databases/postgres_db.d.ts +2 -2
  25. package/dist/databases/postgres_db.d.ts.map +1 -1
  26. package/dist/databases/postgrespool_db.d.ts +1 -1
  27. package/dist/databases/postgrespool_db.d.ts.map +1 -1
  28. package/dist/databases/redis_db.d.ts +3 -3
  29. package/dist/databases/redis_db.d.ts.map +1 -1
  30. package/dist/databases/rethink_db.d.ts +2 -2
  31. package/dist/databases/rethink_db.d.ts.map +1 -1
  32. package/dist/databases/sqlite_db.d.ts +2 -2
  33. package/dist/databases/sqlite_db.d.ts.map +1 -1
  34. package/dist/databases/surrealdb_db.d.ts +3 -3
  35. package/dist/databases/surrealdb_db.d.ts.map +1 -1
  36. package/dist/{dirty_db-C9zUhXIG.js → dirty_db-CocfsG5w.js} +5 -7
  37. package/dist/{dirty_git_db-Cj3oEEyZ.js → dirty_git_db-BYnH74Hk.js} +8 -10
  38. package/dist/{elasticsearch_db-DjnZ1DHG.js → elasticsearch_db-C6G-Wnou.js} +12 -14
  39. package/dist/index.d.ts +44 -91
  40. package/dist/index.js +106 -282
  41. package/dist/lib/AbstractDatabase.d.ts +13 -15
  42. package/dist/lib/AbstractDatabase.d.ts.map +1 -1
  43. package/dist/lib/CacheAndBufferLayer.d.ts +95 -77
  44. package/dist/lib/CacheAndBufferLayer.d.ts.map +1 -1
  45. package/dist/lib/logging.d.ts +12 -2
  46. package/dist/lib/logging.d.ts.map +1 -1
  47. package/dist/logging-DOvFhjsQ.js +22 -0
  48. package/dist/{memory_db-SlQsh4tk.js → memory_db-CGTi0Ck-.js} +3 -3
  49. package/dist/{mock_db-BBijMErd.js → mock_db-DCUmGtUq.js} +3 -5
  50. package/dist/{mongodb_db-ByZscnbs.js → mongodb_db-DgkIuEMZ.js} +5 -6
  51. package/dist/{mssql_db-C9-gmVgP.js → mssql_db-LiEvv4Sm.js} +19 -22
  52. package/dist/{mysql_db-CRYtP-Mk.js → mysql_db-48mMBbKZ.js} +7 -10
  53. package/dist/{postgres_db-CVDQiNwN.js → postgres_db-7Hiezhpi.js} +6 -9
  54. package/dist/{postgrespool_db-CynysVC1.js → postgrespool_db-CdF-1S34.js} +3 -3
  55. package/dist/{redis_db-CDma40om.js → redis_db-DKRC8sR9.js} +7 -8
  56. package/dist/{rethink_db-D7NvPe_4.js → rethink_db-BGxY_SA3.js} +15 -18
  57. package/dist/{rusty_db-CaVGu0z7.js → rusty_db-Msjxckfm.js} +5 -6
  58. package/dist/{sqlite_db-B-nmfVje.js → sqlite_db-Cy8OT62U.js} +5 -6
  59. package/dist/{surrealdb_db-JmcyCabz.js → surrealdb_db-XnhMQEwL.js} +10 -10
  60. package/package.json +88 -38
  61. package/dist/chunk-8l464Juk.js +0 -28
  62. package/dist/logging-DmqnZRde.js +0 -25
package/dist/index.d.ts CHANGED
@@ -1,99 +1,52 @@
1
- import { Settings } from './lib/AbstractDatabase';
2
- export type DatabaseType = 'mysql' | 'postgres' | 'sqlite' | 'rustydb' | 'mongodb' | 'redis' | 'cassandra' | 'dirty' | 'dirtygit' | 'elasticsearch' | 'memory' | 'mock' | 'mssql' | 'postgrespool' | 'rethink' | 'couch' | 'surrealdb';
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: any;
6
- readonly wrapperSettings: any | {};
7
- readonly logger: Function | null;
8
- db: any;
9
- metrics: any;
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 object. If no logger object is provided no logging will occur.
15
- * The logger object is expected to be a log4js logger object or `console`. A logger object
16
- * from another logging library should also work, but performance may be reduced if the logger
17
- * object does not have is${Level}Enabled() methods (isDebugEnabled(), etc.).
18
- */
19
- constructor(type: undefined | DatabaseType, dbSettings: Settings | null | string, wrapperSettings?: null | {}, logger?: any);
20
- /**
21
- * @param callback - Deprecated. Node-style callback. If null, a Promise is returned.
22
- */
23
- init(callback?: null): any;
24
- initDB(): Promise<import("./databases/cassandra_db").default | import("./databases/mysql_db").default | import("./databases/postgres_db").default | import("./databases/sqlite_db").default | import("./databases/rusty_db").default | import("./databases/mongodb_db").default | import("./databases/redis_db").default | import("./databases/dirty_db").default | import("./databases/dirty_git_db").default | import("./databases/elasticsearch_db").default | import("./databases/memory_db").default | import("./databases/mock_db").default | import("./databases/mssql_db").default | import("./databases/rethink_db").default | import("./databases/couch_db").default | import("./databases/surrealdb_db").default>;
25
- /**
26
- * Wrapper functions
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