@dbcube/core 5.0.13 → 5.1.9
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.mts +331 -345
- package/dist/index.d.ts +331 -345
- package/package.json +8 -7
- package/dist/bin.d.mts +0 -1
- package/dist/bin.d.ts +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,384 +1,370 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
|
|
3
|
-
interface ResponseEngine {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export interface ResponseEngine {
|
|
4
|
+
status: number;
|
|
5
|
+
message: String;
|
|
6
|
+
data: any;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
export declare class Engine {
|
|
9
|
+
private name;
|
|
10
|
+
private config;
|
|
11
|
+
private arguments;
|
|
12
|
+
private binary;
|
|
13
|
+
private timeout;
|
|
14
|
+
constructor(name: string, timeout?: number);
|
|
15
|
+
initializeBinary(): Promise<void>;
|
|
16
|
+
setArguments(): any[];
|
|
17
|
+
setConfig(name: string): {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
} | null;
|
|
20
|
+
getConfig(): any;
|
|
21
|
+
run(binary: string, args: [
|
|
22
|
+
]): Promise<ResponseEngine>;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
disconnect(): Promise<ResponseEngine>;
|
|
24
|
+
export declare class QueryEngine {
|
|
25
|
+
private name;
|
|
26
|
+
private config;
|
|
27
|
+
private arguments;
|
|
28
|
+
private binary;
|
|
29
|
+
private timeout;
|
|
30
|
+
private connectionId;
|
|
31
|
+
private tcpPort;
|
|
32
|
+
constructor(name: string, timeout?: number);
|
|
33
|
+
private generatePort;
|
|
34
|
+
private findAvailablePort;
|
|
35
|
+
private isPortAvailable;
|
|
36
|
+
initializeBinary(): Promise<void>;
|
|
37
|
+
setArguments(): any[];
|
|
38
|
+
setConfig(name: string): {
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
} | null;
|
|
41
|
+
getConfig(): any;
|
|
42
|
+
run(binary: string, args: string[]): Promise<ResponseEngine>;
|
|
43
|
+
private executeWithTcpServer;
|
|
44
|
+
private waitForServerReady;
|
|
45
|
+
private isServerResponding;
|
|
46
|
+
private sleep;
|
|
47
|
+
private getCachedDML;
|
|
48
|
+
private startTcpServer;
|
|
49
|
+
private sendTcpRequestFast;
|
|
50
|
+
private processQueue;
|
|
51
|
+
private createNewConnection;
|
|
52
|
+
private executeOnConnection;
|
|
53
|
+
private createProcess;
|
|
54
|
+
disconnect(): Promise<ResponseEngine>;
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
cpus: number;
|
|
56
|
+
export interface SystemInfo {
|
|
57
|
+
platform: string;
|
|
58
|
+
arch: string;
|
|
59
|
+
release: string;
|
|
60
|
+
type: string;
|
|
61
|
+
endianness: string;
|
|
62
|
+
cpus: number;
|
|
65
63
|
}
|
|
66
|
-
declare class Arquitecture {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
64
|
+
export declare class Arquitecture {
|
|
65
|
+
private systemInfo;
|
|
66
|
+
constructor();
|
|
67
|
+
/**
|
|
68
|
+
* Detecta información completa del sistema
|
|
69
|
+
*/
|
|
70
|
+
private detectSystemInfo;
|
|
71
|
+
/**
|
|
72
|
+
* Obtiene la plataforma normalizada
|
|
73
|
+
*/
|
|
74
|
+
getPlatform(): string;
|
|
75
|
+
/**
|
|
76
|
+
* Obtiene la arquitectura normalizada
|
|
77
|
+
*/
|
|
78
|
+
getArchitecture(): string;
|
|
79
|
+
/**
|
|
80
|
+
* Genera el nombre del binario basado en la arquitectura
|
|
81
|
+
*/
|
|
82
|
+
getBinaryName(baseName: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Obtiene información completa del sistema
|
|
85
|
+
*/
|
|
86
|
+
getSystemInfo(): SystemInfo;
|
|
87
|
+
/**
|
|
88
|
+
* Obtiene el triple de destino (target triple) para Rust
|
|
89
|
+
*/
|
|
90
|
+
getRustTargetTriple(): string;
|
|
91
|
+
/**
|
|
92
|
+
* Muestra información detallada del sistema
|
|
93
|
+
*/
|
|
94
|
+
printSystemInfo(): void;
|
|
97
95
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
schema_engine: string;
|
|
96
|
+
interface BinaryType$1 {
|
|
97
|
+
query_engine: string;
|
|
98
|
+
schema_engine: string;
|
|
102
99
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
static get(): Promise<BinaryType>;
|
|
100
|
+
export declare class Binary {
|
|
101
|
+
private static isDownloading;
|
|
102
|
+
private static downloadPromise;
|
|
103
|
+
private static cachedBinaries;
|
|
104
|
+
static ensureBinariesExist(): Promise<void>;
|
|
105
|
+
private static downloadBinaries;
|
|
106
|
+
private static getBinDir;
|
|
107
|
+
private static findVersionedBinary;
|
|
108
|
+
static get(): Promise<BinaryType$1>;
|
|
113
109
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
data: any | null;
|
|
110
|
+
export interface SqliteResult {
|
|
111
|
+
status: "success" | "error";
|
|
112
|
+
message: string;
|
|
113
|
+
data: any | null;
|
|
119
114
|
}
|
|
120
|
-
interface RunResult {
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
export interface RunResult {
|
|
116
|
+
changes: number;
|
|
117
|
+
lastID: number;
|
|
123
118
|
}
|
|
124
119
|
declare class SqliteExecutor {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
120
|
+
private binaryPath;
|
|
121
|
+
private dbPath;
|
|
122
|
+
constructor(dbPath: string);
|
|
123
|
+
private findVersionedBinary;
|
|
124
|
+
private getBinaryPath;
|
|
125
|
+
private executeBinary;
|
|
126
|
+
connect(): Promise<boolean>;
|
|
127
|
+
exists(): Promise<boolean>;
|
|
128
|
+
query(sql: string, params?: any[]): Promise<SqliteResult>;
|
|
129
|
+
queryMultiple(sql: string): Promise<SqliteResult>;
|
|
130
|
+
prepare(sql: string): {
|
|
131
|
+
all: (...params: any[]) => Promise<any[]>;
|
|
132
|
+
run: (...params: any[]) => Promise<RunResult>;
|
|
133
|
+
};
|
|
134
|
+
prepareSync(sql: string): {
|
|
135
|
+
all: (...params: any[]) => any;
|
|
136
|
+
run: (...params: any[]) => any;
|
|
137
|
+
};
|
|
143
138
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
PORT?: number;
|
|
139
|
+
export interface DatabaseConfig {
|
|
140
|
+
name?: string;
|
|
141
|
+
HOST?: string;
|
|
142
|
+
USER?: string;
|
|
143
|
+
PASSWORD?: string;
|
|
144
|
+
DATABASE?: string;
|
|
145
|
+
PORT?: number;
|
|
152
146
|
}
|
|
153
|
-
interface QueryResult {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
147
|
+
export interface QueryResult {
|
|
148
|
+
status: "success" | "error";
|
|
149
|
+
message: string;
|
|
150
|
+
data: any | null;
|
|
157
151
|
}
|
|
158
|
-
interface ParametrizedQueryResult {
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
export interface ParametrizedQueryResult {
|
|
153
|
+
query: string;
|
|
154
|
+
parameters: any[];
|
|
161
155
|
}
|
|
162
156
|
declare class SQLite {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
157
|
+
private executor;
|
|
158
|
+
private database?;
|
|
159
|
+
constructor(config: DatabaseConfig);
|
|
160
|
+
ifExist(): Promise<Boolean>;
|
|
161
|
+
connect(): Promise<SqliteExecutor>;
|
|
162
|
+
disconnect(): Promise<void>;
|
|
163
|
+
query(sqlQuery: string): Promise<QueryResult>;
|
|
164
|
+
queryWithParameters(sqlQuery: string, params?: any[]): Promise<QueryResult>;
|
|
165
|
+
convertToParameterizedQuery(sql: string): ParametrizedQueryResult;
|
|
172
166
|
}
|
|
173
|
-
declare const DbConfig: SQLite;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Tipo para la configuración de una base de datos
|
|
177
|
-
*/
|
|
178
|
-
type DatabaseConfig = Record<string, any>;
|
|
167
|
+
export declare const DbConfig: SQLite;
|
|
168
|
+
type DatabaseConfig$1 = Record<string, any>;
|
|
179
169
|
/**
|
|
180
170
|
* Tipo para la configuración general del ORM
|
|
181
171
|
*/
|
|
182
|
-
interface ConfigData {
|
|
183
|
-
|
|
184
|
-
|
|
172
|
+
export interface ConfigData {
|
|
173
|
+
[key: string]: any;
|
|
174
|
+
databases?: Record<string, DatabaseConfig$1>;
|
|
185
175
|
}
|
|
186
176
|
/**
|
|
187
177
|
* Clase para manejar la configuración del ORM
|
|
188
178
|
*/
|
|
189
|
-
declare class Config {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
179
|
+
export declare class Config {
|
|
180
|
+
private data;
|
|
181
|
+
private databases;
|
|
182
|
+
/**
|
|
183
|
+
* Establece la configuración
|
|
184
|
+
* @param configData - Datos de configuración
|
|
185
|
+
*/
|
|
186
|
+
set(configData: ConfigData): void;
|
|
187
|
+
/**
|
|
188
|
+
* Obtiene un valor de configuración
|
|
189
|
+
* @param key - Clave de configuración
|
|
190
|
+
* @returns Valor de configuración
|
|
191
|
+
*/
|
|
192
|
+
get<T = any>(key: string): T;
|
|
193
|
+
/**
|
|
194
|
+
* Obtiene la configuración de una base de datos específica
|
|
195
|
+
* @param dbName - Nombre de la base de datos
|
|
196
|
+
* @returns Configuración de la base de datos o null
|
|
197
|
+
*/
|
|
198
|
+
getDatabase(dbName: string): DatabaseConfig$1 | null;
|
|
199
|
+
/**
|
|
200
|
+
* Obtiene todas las bases de datos configuradas
|
|
201
|
+
* @returns Todas las configuraciones de bases de datos
|
|
202
|
+
*/
|
|
203
|
+
getAllDatabases(): Record<string, DatabaseConfig$1>;
|
|
214
204
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
useBuffer?: boolean;
|
|
205
|
+
export interface InterceptOptions {
|
|
206
|
+
interceptLog?: boolean;
|
|
207
|
+
interceptError?: boolean;
|
|
208
|
+
interceptWarn?: boolean;
|
|
209
|
+
keepOriginal?: boolean;
|
|
210
|
+
useBuffer?: boolean;
|
|
222
211
|
}
|
|
223
|
-
interface ReadOptions {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
212
|
+
export interface ReadOptions {
|
|
213
|
+
lines?: number | null;
|
|
214
|
+
fromEnd?: boolean;
|
|
215
|
+
asArray?: boolean;
|
|
227
216
|
}
|
|
228
|
-
interface WatchOptions {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
217
|
+
export interface WatchOptions {
|
|
218
|
+
persistent?: boolean;
|
|
219
|
+
interval?: number;
|
|
220
|
+
fromEnd?: boolean;
|
|
232
221
|
}
|
|
233
|
-
interface WatchController {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
222
|
+
export interface WatchController {
|
|
223
|
+
id: string;
|
|
224
|
+
stop: () => void;
|
|
225
|
+
isWatching: () => boolean;
|
|
237
226
|
}
|
|
238
|
-
interface InterceptController {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
227
|
+
export interface InterceptController {
|
|
228
|
+
restore: () => void;
|
|
229
|
+
commit: () => Promise<boolean>;
|
|
230
|
+
discard: () => number;
|
|
231
|
+
hasBuffer: () => boolean;
|
|
232
|
+
getBufferSize: () => number;
|
|
244
233
|
}
|
|
245
|
-
interface DeleteResult {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
234
|
+
export interface DeleteResult {
|
|
235
|
+
filePath: string;
|
|
236
|
+
deleted: boolean;
|
|
237
|
+
error: string | null;
|
|
249
238
|
}
|
|
250
|
-
type LogLevel =
|
|
251
|
-
declare class FileLogger extends EventEmitter {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
239
|
+
export type LogLevel = "INFO" | "ERROR" | "WARN" | "DEBUG";
|
|
240
|
+
export declare class FileLogger extends EventEmitter {
|
|
241
|
+
private static watchers;
|
|
242
|
+
private static buffers;
|
|
243
|
+
/**
|
|
244
|
+
* Escribe un log en el archivo especificado
|
|
245
|
+
* @param filePath - Ruta del archivo de log
|
|
246
|
+
* @param message - Mensaje a escribir
|
|
247
|
+
* @param level - Nivel del log (INFO, ERROR, WARN, DEBUG)
|
|
248
|
+
* @param append - Si debe agregar al final del archivo (default: true)
|
|
249
|
+
*/
|
|
250
|
+
static write(filePath: string, message: string, level?: LogLevel, append?: boolean): Promise<boolean>;
|
|
251
|
+
/**
|
|
252
|
+
* Inicia un buffer temporal para un archivo de log
|
|
253
|
+
* @param filePath - Ruta del archivo de log
|
|
254
|
+
*/
|
|
255
|
+
static startBuffer(filePath: string): void;
|
|
256
|
+
/**
|
|
257
|
+
* Confirma y escribe todos los logs del buffer al archivo
|
|
258
|
+
* @param filePath - Ruta del archivo de log
|
|
259
|
+
*/
|
|
260
|
+
static commitBuffer(filePath: string): Promise<boolean>;
|
|
261
|
+
/**
|
|
262
|
+
* Descarta todos los logs del buffer sin escribirlos
|
|
263
|
+
* @param filePath - Ruta del archivo de log
|
|
264
|
+
*/
|
|
265
|
+
static discardBuffer(filePath: string): number;
|
|
266
|
+
/**
|
|
267
|
+
* Verifica si existe un buffer activo para un archivo
|
|
268
|
+
* @param filePath - Ruta del archivo de log
|
|
269
|
+
*/
|
|
270
|
+
static hasBuffer(filePath: string): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Obtiene el número de logs en el buffer
|
|
273
|
+
* @param filePath - Ruta del archivo de log
|
|
274
|
+
*/
|
|
275
|
+
static getBufferSize(filePath: string): number;
|
|
276
|
+
/**
|
|
277
|
+
* Intercepta console.log y console.error para escribir a archivo
|
|
278
|
+
* @param filePath - Ruta del archivo de log
|
|
279
|
+
* @param options - Opciones de interceptación
|
|
280
|
+
*/
|
|
281
|
+
static interceptConsole(filePath: string, options?: InterceptOptions): InterceptController;
|
|
282
|
+
/**
|
|
283
|
+
* Lee el contenido completo del archivo de log
|
|
284
|
+
* @param filePath - Ruta del archivo de log
|
|
285
|
+
* @param options - Opciones de lectura
|
|
286
|
+
* @returns Contenido del archivo
|
|
287
|
+
*/
|
|
288
|
+
static read(filePath: string, options?: ReadOptions): Promise<string | string[]>;
|
|
289
|
+
/**
|
|
290
|
+
* Observa un archivo de log en tiempo real
|
|
291
|
+
* @param filePath - Ruta del archivo de log
|
|
292
|
+
* @param callback - Función callback para nuevas líneas
|
|
293
|
+
* @param options - Opciones del watcher
|
|
294
|
+
* @returns Objeto con métodos para controlar el watcher
|
|
295
|
+
*/
|
|
296
|
+
static watch(filePath: string, callback: (line: string, filePath: string) => void, options?: WatchOptions): WatchController;
|
|
297
|
+
/**
|
|
298
|
+
* Detiene todos los watchers activos
|
|
299
|
+
*/
|
|
300
|
+
static stopAllWatchers(): void;
|
|
301
|
+
/**
|
|
302
|
+
* Métodos de conveniencia para diferentes niveles de log
|
|
303
|
+
*/
|
|
304
|
+
static info(filePath: string, message: string): Promise<boolean>;
|
|
305
|
+
static error(filePath: string, message: string): Promise<boolean>;
|
|
306
|
+
static warn(filePath: string, message: string): Promise<boolean>;
|
|
307
|
+
static debug(filePath: string, message: string): Promise<boolean>;
|
|
308
|
+
/**
|
|
309
|
+
* Limpia logs antiguos
|
|
310
|
+
* @param filePath - Ruta del archivo de log
|
|
311
|
+
* @param maxLines - Máximo número de líneas a mantener
|
|
312
|
+
*/
|
|
313
|
+
static cleanup(filePath: string, maxLines?: number): Promise<number>;
|
|
314
|
+
/**
|
|
315
|
+
* Elimina un archivo de log
|
|
316
|
+
* @param filePath - Ruta del archivo de log a eliminar
|
|
317
|
+
*/
|
|
318
|
+
static deleteLogFile(filePath: string): Promise<boolean>;
|
|
319
|
+
/**
|
|
320
|
+
* Elimina múltiples archivos de log
|
|
321
|
+
* @param filePaths - Array de rutas de archivos de log a eliminar
|
|
322
|
+
*/
|
|
323
|
+
static deleteLogFiles(filePaths: string[]): Promise<DeleteResult[]>;
|
|
335
324
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
[key: string]: any;
|
|
325
|
+
export interface DataObject {
|
|
326
|
+
[key: string]: any;
|
|
339
327
|
}
|
|
340
|
-
interface ComputedFieldConfig {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
328
|
+
export interface ComputedFieldConfig {
|
|
329
|
+
id: number;
|
|
330
|
+
table_ref: string;
|
|
331
|
+
column: string;
|
|
332
|
+
type: "string" | "number" | "boolean" | "date" | "object";
|
|
333
|
+
instruction: string;
|
|
334
|
+
database_ref: string;
|
|
335
|
+
created_at: string;
|
|
336
|
+
updated_at: string;
|
|
349
337
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
*/
|
|
374
|
-
static computedFields<T extends DataObject>(data: T[], computedConfigs: ComputedFieldConfig[]): T[];
|
|
338
|
+
export type DatabaseType = "mysql" | "sqlite" | "postgres" | "mongodb";
|
|
339
|
+
export declare class ComputedFieldProcessor {
|
|
340
|
+
static getComputedFields(name: string): Promise<any[]>;
|
|
341
|
+
/**
|
|
342
|
+
* Processes computed field instruction and returns the computed value
|
|
343
|
+
* @param instruction - The @compute instruction
|
|
344
|
+
* @param rowData - The row data containing column values
|
|
345
|
+
* @returns The computed value or null if there's an error
|
|
346
|
+
*/
|
|
347
|
+
static processInstruction(instruction: string, rowData: Record<string, any>): any;
|
|
348
|
+
/**
|
|
349
|
+
* Extracts column dependencies from a computed field instruction
|
|
350
|
+
* @param instruction - The @compute instruction
|
|
351
|
+
* @returns Array of column names that this computed field depends on
|
|
352
|
+
*/
|
|
353
|
+
static extractDependencies(instruction: string): string[];
|
|
354
|
+
/**
|
|
355
|
+
* Adds computed fields to an array of data objects based on configuration array
|
|
356
|
+
* @param data - Array of data objects
|
|
357
|
+
* @param computedConfigs - Array of computed field configurations
|
|
358
|
+
* @returns Array with the new computed fields added
|
|
359
|
+
*/
|
|
360
|
+
static computedFields<T extends DataObject>(data: T[], computedConfigs: ComputedFieldConfig[]): T[];
|
|
375
361
|
}
|
|
376
|
-
declare class TableProcessor {
|
|
377
|
-
|
|
378
|
-
|
|
362
|
+
export declare class TableProcessor {
|
|
363
|
+
static generateAlterQueries(nowQuery: string, dbType: DatabaseType, tableName: string, database_ref: string): Promise<string[]>;
|
|
364
|
+
static saveQuery(table_ref: string, database_ref: string, struct: string): Promise<void>;
|
|
379
365
|
}
|
|
380
|
-
declare class TriggerProcessor {
|
|
381
|
-
|
|
366
|
+
export declare class TriggerProcessor {
|
|
367
|
+
static getTriggers(name: string): Promise<any[]>;
|
|
382
368
|
}
|
|
383
369
|
|
|
384
|
-
export {
|
|
370
|
+
export {};
|