@dbcube/core 5.2.3 → 5.2.4

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 CHANGED
@@ -129,7 +129,7 @@ export declare class QueryEngine {
129
129
  private timeout;
130
130
  private connectionId;
131
131
  private tcpPort;
132
- constructor(name: string, timeout?: number);
132
+ constructor(name: string, timeout?: number, explicitConfig?: any);
133
133
  private generatePort;
134
134
  private findAvailablePort;
135
135
  private isPortAvailable;
@@ -233,35 +233,6 @@ export declare class Binary {
233
233
  private static findVersionedBinary;
234
234
  static get(): Promise<BinaryType$1>;
235
235
  }
236
- export interface SqliteResult {
237
- status: "success" | "error";
238
- message: string;
239
- data: any | null;
240
- }
241
- export interface RunResult {
242
- changes: number;
243
- lastID: number;
244
- }
245
- declare class SqliteExecutor {
246
- private binaryPath;
247
- private dbPath;
248
- constructor(dbPath: string);
249
- private findVersionedBinary;
250
- private getBinaryPath;
251
- private executeBinary;
252
- connect(): Promise<boolean>;
253
- exists(): Promise<boolean>;
254
- query(sql: string, params?: any[]): Promise<SqliteResult>;
255
- queryMultiple(sql: string): Promise<SqliteResult>;
256
- prepare(sql: string): {
257
- all: (...params: any[]) => Promise<any[]>;
258
- run: (...params: any[]) => Promise<RunResult>;
259
- };
260
- prepareSync(sql: string): {
261
- all: (...params: any[]) => any;
262
- run: (...params: any[]) => any;
263
- };
264
- }
265
236
  export interface DatabaseConfig {
266
237
  name?: string;
267
238
  HOST?: string;
@@ -280,11 +251,17 @@ export interface ParametrizedQueryResult {
280
251
  parameters: any[];
281
252
  }
282
253
  declare class SQLite {
283
- private executor;
284
- private database?;
254
+ private database;
255
+ private engine;
285
256
  constructor(config: DatabaseConfig);
257
+ /** Ruta del archivo SQLite interno (.dbcube/<database>.db). */
258
+ private dbFilePath;
259
+ /** QueryEngine sqlite apuntando al archivo interno, con config explícito
260
+ * (no vive en dbcube.config.js). La ruta relativa `.dbcube/<db>` deja que
261
+ * QueryEngine le añada `.db` → `.dbcube/<db>.db`, relativo al CWD. */
262
+ private getEngine;
286
263
  ifExist(): Promise<Boolean>;
287
- connect(): Promise<SqliteExecutor>;
264
+ connect(): Promise<QueryEngine>;
288
265
  disconnect(): Promise<void>;
289
266
  query(sqlQuery: string): Promise<QueryResult>;
290
267
  queryWithParameters(sqlQuery: string, params?: any[]): Promise<QueryResult>;
package/dist/index.d.ts CHANGED
@@ -129,7 +129,7 @@ export declare class QueryEngine {
129
129
  private timeout;
130
130
  private connectionId;
131
131
  private tcpPort;
132
- constructor(name: string, timeout?: number);
132
+ constructor(name: string, timeout?: number, explicitConfig?: any);
133
133
  private generatePort;
134
134
  private findAvailablePort;
135
135
  private isPortAvailable;
@@ -233,35 +233,6 @@ export declare class Binary {
233
233
  private static findVersionedBinary;
234
234
  static get(): Promise<BinaryType$1>;
235
235
  }
236
- export interface SqliteResult {
237
- status: "success" | "error";
238
- message: string;
239
- data: any | null;
240
- }
241
- export interface RunResult {
242
- changes: number;
243
- lastID: number;
244
- }
245
- declare class SqliteExecutor {
246
- private binaryPath;
247
- private dbPath;
248
- constructor(dbPath: string);
249
- private findVersionedBinary;
250
- private getBinaryPath;
251
- private executeBinary;
252
- connect(): Promise<boolean>;
253
- exists(): Promise<boolean>;
254
- query(sql: string, params?: any[]): Promise<SqliteResult>;
255
- queryMultiple(sql: string): Promise<SqliteResult>;
256
- prepare(sql: string): {
257
- all: (...params: any[]) => Promise<any[]>;
258
- run: (...params: any[]) => Promise<RunResult>;
259
- };
260
- prepareSync(sql: string): {
261
- all: (...params: any[]) => any;
262
- run: (...params: any[]) => any;
263
- };
264
- }
265
236
  export interface DatabaseConfig {
266
237
  name?: string;
267
238
  HOST?: string;
@@ -280,11 +251,17 @@ export interface ParametrizedQueryResult {
280
251
  parameters: any[];
281
252
  }
282
253
  declare class SQLite {
283
- private executor;
284
- private database?;
254
+ private database;
255
+ private engine;
285
256
  constructor(config: DatabaseConfig);
257
+ /** Ruta del archivo SQLite interno (.dbcube/<database>.db). */
258
+ private dbFilePath;
259
+ /** QueryEngine sqlite apuntando al archivo interno, con config explícito
260
+ * (no vive en dbcube.config.js). La ruta relativa `.dbcube/<db>` deja que
261
+ * QueryEngine le añada `.db` → `.dbcube/<db>.db`, relativo al CWD. */
262
+ private getEngine;
286
263
  ifExist(): Promise<Boolean>;
287
- connect(): Promise<SqliteExecutor>;
264
+ connect(): Promise<QueryEngine>;
288
265
  disconnect(): Promise<void>;
289
266
  query(sqlQuery: string): Promise<QueryResult>;
290
267
  queryWithParameters(sqlQuery: string, params?: any[]): Promise<QueryResult>;