Skip to content

Commit 97266b6

Browse files
committed
Refactor DBeaverClient to use utility functions directly for query building and version extraction
1 parent fb75b37 commit 97266b6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/dbeaver-client.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
ConnectionTest,
1212
DatabaseStats
1313
} from './types.js';
14-
import { findDBeaverExecutable } from './utils.js';
14+
import { findDBeaverExecutable, getTestQuery, parseVersionFromResult, buildSchemaQuery, buildListTablesQuery } from './utils.js';
1515

1616
export class DBeaverClient {
1717
private executablePath: string;
@@ -289,17 +289,14 @@ export class DBeaverClient {
289289

290290
private getTestQuery(driver: string): string {
291291
// Delegate to utils
292-
const { getTestQuery } = require('./utils');
293292
return getTestQuery(driver);
294293
}
295294

296295
private extractVersionFromResult(result: any): string | undefined {
297-
const { parseVersionFromResult } = require('./utils');
298296
return parseVersionFromResult(result);
299297
}
300298

301299
private buildSchemaQuery(driver: string, tableName: string): string {
302-
const { buildSchemaQuery } = require('./utils');
303300
return buildSchemaQuery(driver, tableName);
304301
}
305302

@@ -407,7 +404,6 @@ export class DBeaverClient {
407404

408405
async listTables(connection: DBeaverConnection, schema?: string, includeViews: boolean = false): Promise<any[]> {
409406
try {
410-
const { buildListTablesQuery } = require('./utils');
411407
const query = buildListTablesQuery(connection.driver, schema, includeViews);
412408
const result = await this.executeQuery(connection, query);
413409

0 commit comments

Comments
 (0)