@onurege3467/zerohelper 10.3.0 → 11.0.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.
Files changed (81) hide show
  1. package/README.md +9 -779
  2. package/dist/index.js +19 -44
  3. package/package.json +21 -70
  4. package/dist/bin/commands/cache.d.ts +0 -2
  5. package/dist/bin/commands/cache.js +0 -92
  6. package/dist/bin/commands/db-backup.d.ts +0 -3
  7. package/dist/bin/commands/db-backup.js +0 -118
  8. package/dist/bin/commands/db.d.ts +0 -2
  9. package/dist/bin/commands/db.js +0 -334
  10. package/dist/bin/commands/import-export.d.ts +0 -3
  11. package/dist/bin/commands/import-export.js +0 -123
  12. package/dist/bin/commands/init.d.ts +0 -2
  13. package/dist/bin/commands/init.js +0 -85
  14. package/dist/bin/commands/migrate.d.ts +0 -3
  15. package/dist/bin/commands/migrate.js +0 -167
  16. package/dist/bin/commands/repl.d.ts +0 -2
  17. package/dist/bin/commands/repl.js +0 -96
  18. package/dist/bin/commands/seed.d.ts +0 -2
  19. package/dist/bin/commands/seed.js +0 -76
  20. package/dist/bin/commands/zpack.d.ts +0 -2
  21. package/dist/bin/commands/zpack.js +0 -36
  22. package/dist/bin/index.d.ts +0 -2
  23. package/dist/bin/index.js +0 -28
  24. package/dist/bin/types.d.ts +0 -22
  25. package/dist/bin/types.js +0 -2
  26. package/dist/bin/utils/config.d.ts +0 -3
  27. package/dist/bin/utils/config.js +0 -78
  28. package/dist/bin/utils/prompts.d.ts +0 -3
  29. package/dist/bin/utils/prompts.js +0 -115
  30. package/dist/bin/zero.d.ts +0 -2
  31. package/dist/bin/zero.js +0 -849
  32. package/dist/database/IDatabase.d.ts +0 -71
  33. package/dist/database/IDatabase.js +0 -48
  34. package/dist/database/cacheWrapper.d.ts +0 -34
  35. package/dist/database/cacheWrapper.js +0 -214
  36. package/dist/database/index.d.ts +0 -12
  37. package/dist/database/index.js +0 -100
  38. package/dist/database/json.d.ts +0 -32
  39. package/dist/database/json.js +0 -208
  40. package/dist/database/migration.d.ts +0 -21
  41. package/dist/database/migration.js +0 -97
  42. package/dist/database/mongodb.d.ts +0 -26
  43. package/dist/database/mongodb.js +0 -145
  44. package/dist/database/mysql.d.ts +0 -29
  45. package/dist/database/mysql.js +0 -282
  46. package/dist/database/pg.d.ts +0 -28
  47. package/dist/database/pg.js +0 -200
  48. package/dist/database/redis.d.ts +0 -31
  49. package/dist/database/redis.js +0 -176
  50. package/dist/database/seeder.d.ts +0 -20
  51. package/dist/database/seeder.js +0 -37
  52. package/dist/database/sqlite.d.ts +0 -26
  53. package/dist/database/sqlite.js +0 -211
  54. package/dist/database/telemetry.d.ts +0 -35
  55. package/dist/database/telemetry.js +0 -41
  56. package/dist/database/toon.d.ts +0 -33
  57. package/dist/database/toon.js +0 -244
  58. package/dist/database/types.d.ts +0 -71
  59. package/dist/database/types.js +0 -2
  60. package/dist/database/zpack.d.ts +0 -75
  61. package/dist/database/zpack.js +0 -616
  62. package/dist/functions/ai.d.ts +0 -126
  63. package/dist/functions/ai.js +0 -387
  64. package/dist/functions/index.d.ts +0 -223
  65. package/dist/functions/index.js +0 -686
  66. package/dist/functions/security.d.ts +0 -15
  67. package/dist/functions/security.js +0 -46
  68. package/dist/functions/toon.d.ts +0 -10
  69. package/dist/functions/toon.js +0 -214
  70. package/dist/functions/worker.d.ts +0 -5
  71. package/dist/functions/worker.js +0 -35
  72. package/dist/index.d.ts +0 -8
  73. package/dist/migrations/1767521950635_test_migration.d.ts +0 -3
  74. package/dist/migrations/1767521950635_test_migration.js +0 -11
  75. package/dist/migrations/1767522158826_create_users_table.d.ts +0 -2
  76. package/dist/migrations/1767522158826_create_users_table.js +0 -11
  77. package/dist/package.json +0 -79
  78. package/dist/tests/test.d.ts +0 -1
  79. package/dist/tests/test.js +0 -26
  80. package/dist/zero.config.d.ts +0 -10
  81. package/dist/zero.config.js +0 -13
@@ -1,71 +0,0 @@
1
- export type HookType = 'beforeInsert' | 'afterInsert' | 'beforeUpdate' | 'afterUpdate' | 'beforeDelete' | 'afterDelete';
2
- export type HookFunction = (table: string, data: any) => Promise<void> | void;
3
- /**
4
- * Defines the common interface that all database adapters must implement.
5
- */
6
- export declare abstract class IDatabase {
7
- protected hooks: Record<HookType, HookFunction[]>;
8
- /**
9
- * Registers a lifecycle hook.
10
- */
11
- on(hook: HookType, fn: HookFunction): void;
12
- protected runHooks(hook: HookType, table: string, data: any): Promise<void>;
13
- /**
14
- * Returns performance metrics for the database and cache.
15
- */
16
- getMetrics(): {
17
- database: {
18
- totalOperations: number;
19
- averageDuration: string;
20
- slowestOperations: import("./telemetry").DatabaseMetrics[];
21
- recentLogs: import("./telemetry").DatabaseMetrics[];
22
- };
23
- cache: {
24
- ratio: string;
25
- hits: number;
26
- misses: number;
27
- };
28
- };
29
- protected recordMetric(operation: string, table: string, duration: number): void;
30
- /**
31
- * Selects multiple records based on the specified conditions.
32
- */
33
- abstract select<T = any>(table: string, where?: Record<string, any> | null): Promise<T[]>;
34
- /**
35
- * Selects a single record based on the specified conditions.
36
- */
37
- abstract selectOne<T = any>(table: string, where?: Record<string, any> | null): Promise<T | null>;
38
- /**
39
- * Inserts a new record.
40
- */
41
- abstract insert(table: string, data: Record<string, any>): Promise<number | string | any>;
42
- /**
43
- * Updates records matching the specified conditions.
44
- */
45
- abstract update(table: string, data: Record<string, any>, where: Record<string, any>): Promise<number>;
46
- /**
47
- * Updates a record or inserts it as a new record if it doesn't exist (Upsert).
48
- */
49
- abstract set(table: string, data: Record<string, any>, where: Record<string, any>): Promise<any>;
50
- /**
51
- * Deletes records matching the specified conditions.
52
- */
53
- abstract delete(table: string, where: Record<string, any>): Promise<number>;
54
- /**
55
- * Inserts multiple records in bulk.
56
- */
57
- abstract bulkInsert(table: string, dataArray: Record<string, any>[]): Promise<number>;
58
- /**
59
- * Increments numeric fields.
60
- */
61
- abstract increment(table: string, increments: Record<string, number>, where: Record<string, any>): Promise<number>;
62
- /**
63
- * Decrements numeric fields.
64
- */
65
- abstract decrement(table: string, decrements: Record<string, number>, where: Record<string, any>): Promise<number>;
66
- /**
67
- * Safely closes the database connection.
68
- */
69
- abstract close(): Promise<void>;
70
- }
71
- export default IDatabase;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IDatabase = void 0;
4
- const telemetry_1 = require("./telemetry");
5
- /**
6
- * Defines the common interface that all database adapters must implement.
7
- */
8
- class IDatabase {
9
- constructor() {
10
- this.hooks = {
11
- beforeInsert: [],
12
- afterInsert: [],
13
- beforeUpdate: [],
14
- afterUpdate: [],
15
- beforeDelete: [],
16
- afterDelete: [],
17
- };
18
- }
19
- /**
20
- * Registers a lifecycle hook.
21
- */
22
- on(hook, fn) {
23
- if (this.hooks[hook]) {
24
- this.hooks[hook].push(fn);
25
- }
26
- }
27
- async runHooks(hook, table, data) {
28
- for (const fn of this.hooks[hook]) {
29
- await fn(table, data);
30
- }
31
- }
32
- /**
33
- * Returns performance metrics for the database and cache.
34
- */
35
- getMetrics() {
36
- return telemetry_1.telemetry.getMetrics();
37
- }
38
- recordMetric(operation, table, duration) {
39
- telemetry_1.telemetry.recordDb({
40
- operation,
41
- table,
42
- duration,
43
- timestamp: Date.now()
44
- });
45
- }
46
- }
47
- exports.IDatabase = IDatabase;
48
- exports.default = IDatabase;
@@ -1,34 +0,0 @@
1
- import { IDatabase, HookType, HookFunction } from './IDatabase';
2
- export declare class CacheWrapper extends IDatabase {
3
- db: IDatabase;
4
- private cacheType;
5
- private tableCaches;
6
- private redisClient;
7
- private redisAvailable;
8
- private ttl;
9
- private keyPrefix;
10
- private cache;
11
- constructor(databaseInstance: IDatabase, options?: any);
12
- /**
13
- * Redirect hooks registration to the underlying database instance.
14
- */
15
- on(hook: HookType, fn: HookFunction): void;
16
- private _initMemoryCache;
17
- private _initRedisCache;
18
- private _getCache;
19
- private _generateKey;
20
- private _getCacheValue;
21
- private _setCacheValue;
22
- private _clearCache;
23
- select<T = any>(table: string, where?: Record<string, any> | null): Promise<T[]>;
24
- selectOne<T = any>(table: string, where?: Record<string, any> | null): Promise<T | null>;
25
- insert(table: string, data: Record<string, any>): Promise<any>;
26
- update(table: string, data: Record<string, any>, where: Record<string, any>): Promise<number>;
27
- set(table: string, data: Record<string, any>, where: Record<string, any>): Promise<any>;
28
- delete(table: string, where: Record<string, any>): Promise<number>;
29
- bulkInsert(table: string, dataArray: Record<string, any>[]): Promise<number>;
30
- increment(table: string, increments: Record<string, number>, where?: Record<string, any>): Promise<number>;
31
- decrement(table: string, decrements: Record<string, number>, where?: Record<string, any>): Promise<number>;
32
- close(): Promise<void>;
33
- }
34
- export default CacheWrapper;
@@ -1,214 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CacheWrapper = void 0;
4
- const IDatabase_1 = require("./IDatabase");
5
- const lru_cache_1 = require("lru-cache");
6
- const redis_1 = require("redis");
7
- const telemetry_1 = require("./telemetry");
8
- class CacheWrapper extends IDatabase_1.IDatabase {
9
- constructor(databaseInstance, options = {}) {
10
- super();
11
- this.tableCaches = {};
12
- this.redisClient = null;
13
- this.redisAvailable = false;
14
- this.ttl = 300;
15
- this.keyPrefix = 'db_cache:';
16
- this.cache = null;
17
- this.db = databaseInstance;
18
- this.cacheType = options.type || 'memory';
19
- if (this.cacheType === 'redis') {
20
- this._initRedisCache(options);
21
- }
22
- else {
23
- this._initMemoryCache(options);
24
- }
25
- }
26
- /**
27
- * Redirect hooks registration to the underlying database instance.
28
- */
29
- on(hook, fn) {
30
- this.db.on(hook, fn);
31
- }
32
- _initMemoryCache(options) {
33
- this.cache = new lru_cache_1.LRUCache({
34
- max: options.max || 500,
35
- ttl: options.ttl || 1000 * 60 * 5,
36
- });
37
- this.redisAvailable = false;
38
- }
39
- async _initRedisCache(options) {
40
- const redisConfig = {
41
- socket: {
42
- host: options.host || '127.0.0.1',
43
- port: options.port || 6379,
44
- connectTimeout: options.connectTimeout || 5000,
45
- },
46
- password: options.password,
47
- database: options.db || 0,
48
- };
49
- this.redisClient = (0, redis_1.createClient)(redisConfig);
50
- this.ttl = (options.ttl || 300000) / 1000;
51
- this.keyPrefix = options.keyPrefix || 'db_cache:';
52
- this.redisClient.on('error', () => {
53
- this.redisAvailable = false;
54
- });
55
- this.redisClient.on('ready', () => {
56
- this.redisAvailable = true;
57
- });
58
- try {
59
- await this.redisClient.connect();
60
- this.redisAvailable = true;
61
- }
62
- catch (error) {
63
- this._initMemoryCache(options);
64
- }
65
- }
66
- _getCache(table) {
67
- if (this.cacheType === 'redis' && this.redisAvailable && this.redisClient)
68
- return this.redisClient;
69
- if (!this.tableCaches[table]) {
70
- this.tableCaches[table] = new lru_cache_1.LRUCache({
71
- max: this.cache?.max || 500,
72
- ttl: this.cache?.ttl || 300000,
73
- });
74
- }
75
- return this.tableCaches[table];
76
- }
77
- _generateKey(table, where) {
78
- const sortedWhere = where ? Object.keys(where).sort().reduce((acc, key) => {
79
- acc[key] = where[key];
80
- return acc;
81
- }, {}) : {};
82
- const key = `${table}:${JSON.stringify(sortedWhere)}`;
83
- return this.cacheType === 'redis' ? `${this.keyPrefix}${key}` : key;
84
- }
85
- async _getCacheValue(cache, key, table) {
86
- if (this.cacheType === 'redis' && this.redisAvailable && this.redisClient) {
87
- try {
88
- const value = await cache.get(key);
89
- if (value) {
90
- telemetry_1.telemetry.recordCacheHit();
91
- return JSON.parse(value);
92
- }
93
- }
94
- catch {
95
- this.redisAvailable = false;
96
- }
97
- }
98
- else if (cache instanceof lru_cache_1.LRUCache) {
99
- const value = cache.get(key);
100
- if (value) {
101
- telemetry_1.telemetry.recordCacheHit();
102
- return value;
103
- }
104
- }
105
- telemetry_1.telemetry.recordCacheMiss();
106
- return null;
107
- }
108
- async _setCacheValue(cache, key, value, table) {
109
- if (this.cacheType === 'redis' && this.redisAvailable && this.redisClient) {
110
- try {
111
- await cache.setEx(key, Math.floor(this.ttl), JSON.stringify(value));
112
- }
113
- catch {
114
- this.redisAvailable = false;
115
- this._getCache(table).set(key, value);
116
- }
117
- }
118
- else {
119
- cache.set(key, value);
120
- }
121
- }
122
- async _clearCache(table) {
123
- if (this.cacheType === 'redis' && this.redisAvailable && this.redisClient) {
124
- try {
125
- const keys = await this.redisClient.keys(`${this.keyPrefix}${table}:*`);
126
- if (keys.length)
127
- await this.redisClient.del(keys);
128
- }
129
- catch {
130
- this.redisAvailable = false;
131
- }
132
- }
133
- if (this.tableCaches[table])
134
- this.tableCaches[table].clear();
135
- }
136
- async select(table, where = null) {
137
- const cache = this._getCache(table);
138
- const key = this._generateKey(table, where);
139
- let data = await this._getCacheValue(cache, key, table);
140
- if (data !== null && data !== undefined)
141
- return data;
142
- const start = Date.now();
143
- data = await this.db.select(table, where);
144
- this.db.recordMetric?.('select', table, Date.now() - start);
145
- if (data !== null && data !== undefined)
146
- await this._setCacheValue(cache, key, data, table);
147
- return data;
148
- }
149
- async selectOne(table, where = null) {
150
- const cache = this._getCache(table);
151
- const key = this._generateKey(table + '_one', where);
152
- let data = await this._getCacheValue(cache, key, table);
153
- if (data !== null && data !== undefined)
154
- return data;
155
- const start = Date.now();
156
- data = await this.db.selectOne(table, where);
157
- this.db.recordMetric?.('selectOne', table, Date.now() - start);
158
- if (data !== null && data !== undefined)
159
- await this._setCacheValue(cache, key, data, table);
160
- return data;
161
- }
162
- async insert(table, data) {
163
- const start = Date.now();
164
- const result = await this.db.insert(table, data);
165
- this.db.recordMetric?.('insert', table, Date.now() - start);
166
- await this._clearCache(table);
167
- return result;
168
- }
169
- async update(table, data, where) {
170
- const start = Date.now();
171
- const result = await this.db.update(table, data, where);
172
- this.db.recordMetric?.('update', table, Date.now() - start);
173
- if (result > 0)
174
- await this._clearCache(table);
175
- return result;
176
- }
177
- async set(table, data, where) {
178
- const result = await this.db.set(table, data, where);
179
- await this._clearCache(table);
180
- return result;
181
- }
182
- async delete(table, where) {
183
- const start = Date.now();
184
- const result = await this.db.delete(table, where);
185
- this.db.recordMetric?.('delete', table, Date.now() - start);
186
- if (result > 0)
187
- await this._clearCache(table);
188
- return result;
189
- }
190
- async bulkInsert(table, dataArray) {
191
- const result = await this.db.bulkInsert(table, dataArray);
192
- await this._clearCache(table);
193
- return result;
194
- }
195
- async increment(table, increments, where = {}) {
196
- const result = await this.db.increment(table, increments, where);
197
- await this._clearCache(table);
198
- return result;
199
- }
200
- async decrement(table, decrements, where = {}) {
201
- const result = await this.db.decrement(table, decrements, where);
202
- await this._clearCache(table);
203
- return result;
204
- }
205
- async close() {
206
- if (this.redisClient) {
207
- await this.redisClient.quit();
208
- this.redisClient = null;
209
- }
210
- await this.db.close();
211
- }
212
- }
213
- exports.CacheWrapper = CacheWrapper;
214
- exports.default = CacheWrapper;
@@ -1,12 +0,0 @@
1
- import { IDatabase } from './IDatabase';
2
- import { DatabaseOptions } from './types';
3
- import MigrationManager from './migration';
4
- import ZPackAdapter, { ZPackDatabase } from './zpack';
5
- import ToonDatabase from './toon';
6
- import { DataSeeder } from './seeder';
7
- /**
8
- * Belirtilen adaptör tipine göre bir veritabanı örneği oluşturur ve döndürür.
9
- */
10
- export declare function createDatabase(options: DatabaseOptions): IDatabase;
11
- export { IDatabase, MigrationManager, ZPackDatabase, ZPackAdapter, DataSeeder, ToonDatabase };
12
- export default createDatabase;
@@ -1,100 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.ToonDatabase = exports.DataSeeder = exports.ZPackAdapter = exports.ZPackDatabase = exports.MigrationManager = exports.IDatabase = void 0;
40
- exports.createDatabase = createDatabase;
41
- const IDatabase_1 = require("./IDatabase");
42
- Object.defineProperty(exports, "IDatabase", { enumerable: true, get: function () { return IDatabase_1.IDatabase; } });
43
- const mysql_1 = __importDefault(require("./mysql"));
44
- const sqlite_1 = __importDefault(require("./sqlite"));
45
- const mongodb_1 = __importDefault(require("./mongodb"));
46
- const json_1 = __importDefault(require("./json"));
47
- const pg_1 = __importDefault(require("./pg"));
48
- const redis_1 = __importDefault(require("./redis"));
49
- const cacheWrapper_1 = __importDefault(require("./cacheWrapper"));
50
- const migration_1 = __importDefault(require("./migration"));
51
- exports.MigrationManager = migration_1.default;
52
- const zpack_1 = __importStar(require("./zpack"));
53
- exports.ZPackAdapter = zpack_1.default;
54
- Object.defineProperty(exports, "ZPackDatabase", { enumerable: true, get: function () { return zpack_1.ZPackDatabase; } });
55
- const toon_1 = __importDefault(require("./toon"));
56
- exports.ToonDatabase = toon_1.default;
57
- const seeder_1 = require("./seeder");
58
- Object.defineProperty(exports, "DataSeeder", { enumerable: true, get: function () { return seeder_1.DataSeeder; } });
59
- const adapters = {
60
- mysql: mysql_1.default,
61
- sqlite: sqlite_1.default,
62
- mongodb: mongodb_1.default,
63
- postgres: pg_1.default,
64
- json: json_1.default,
65
- redis: redis_1.default,
66
- zpack: zpack_1.default,
67
- toon: toon_1.default,
68
- };
69
- /**
70
- * Belirtilen adaptör tipine göre bir veritabanı örneği oluşturur ve döndürür.
71
- */
72
- function createDatabase(options) {
73
- const { adapter, config } = options;
74
- if (!adapter || !adapters[adapter]) {
75
- throw new Error(`Geçersiz veya desteklenmeyen adaptör: ${adapter}. Desteklenenler: ${Object.keys(adapters).join(', ')}`);
76
- }
77
- if (!config) {
78
- throw new Error(`'${adapter}' adaptörü için yapılandırma (config) gereklidir.`);
79
- }
80
- const DatabaseClass = adapters[adapter];
81
- const dbInstance = new DatabaseClass(config);
82
- if (config.cache) {
83
- const wrapper = new cacheWrapper_1.default(dbInstance, config.cache);
84
- return new Proxy(wrapper, {
85
- get: (target, prop) => {
86
- if (prop in target) {
87
- const val = target[prop];
88
- return typeof val === 'function' ? val.bind(target) : val;
89
- }
90
- if (prop in target.db) {
91
- const val = target.db[prop];
92
- return typeof val === 'function' ? val.bind(target.db) : val;
93
- }
94
- return undefined;
95
- }
96
- });
97
- }
98
- return dbInstance;
99
- }
100
- exports.default = createDatabase;
@@ -1,32 +0,0 @@
1
- import { IDatabase } from './IDatabase';
2
- import { JsonConfig } from './types';
3
- export declare class JsonDatabase extends IDatabase {
4
- private filePath;
5
- private db;
6
- private isDirty;
7
- private isWriting;
8
- private writeQueue;
9
- private saveDebounceTimeout;
10
- private saveInterval;
11
- private initPromise;
12
- constructor(config: JsonConfig);
13
- private _execute;
14
- private _load;
15
- private _queueRequest;
16
- private _processQueue;
17
- private _scheduleSave;
18
- private _saveNow;
19
- private flushSync;
20
- ensureTable(table: string): Promise<void>;
21
- insert(table: string, data: Record<string, any>): Promise<number>;
22
- update(table: string, data: Record<string, any>, where: Record<string, any>): Promise<number>;
23
- delete(table: string, where: Record<string, any>): Promise<number>;
24
- select<T = any>(table: string, where?: Record<string, any> | null): Promise<T[]>;
25
- selectOne<T = any>(table: string, where?: Record<string, any> | null): Promise<T | null>;
26
- set(table: string, data: Record<string, any>, where: Record<string, any>): Promise<any>;
27
- bulkInsert(table: string, dataArray: Record<string, any>[]): Promise<number>;
28
- increment(table: string, incs: Record<string, number>, where?: Record<string, any>): Promise<number>;
29
- decrement(table: string, decs: Record<string, number>, where?: Record<string, any>): Promise<number>;
30
- close(): Promise<void>;
31
- }
32
- export default JsonDatabase;