Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
liuliu-dev committed Jan 31, 2025
1 parent 68c0492 commit c6b3a70
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 3 additions & 6 deletions graphql-server/src/connections/connection.provider.ts
Original file line number Diff line number Diff line change
@@ -41,9 +41,7 @@ export class ConnectionProvider {
if (!(name in this.databases)) {
throw new Error("Connection not found");
}
if (!this.databases[name].qf) {
throw new Error("Data source service not initialized");
}

return this.databases[name].qf;
}

@@ -72,7 +70,7 @@ export class ConnectionProvider {
}

async addConnection(config: WorkbenchConfig): Promise<{ isDolt: boolean }> {
const name = config.name;
const { name } = config;
if (name in this.databases) {
if (this.databases[name].ds.isInitialized) {
await this.databases[name].ds.destroy();
@@ -89,9 +87,8 @@ export class ConnectionProvider {
}

const res = await newQueryFactory(config.type, ds);
const qf = res.qf;

this.databases[name] = { ds, config, qf };
this.databases[name] = { ds, config, qf: res.qf };
return { isDolt: res.isDolt };
}

4 changes: 1 addition & 3 deletions graphql-server/src/queryFactory/base.ts
Original file line number Diff line number Diff line change
@@ -32,9 +32,7 @@ export class BaseQueryFactory {
}

async currentDatabase(): Promise<string | undefined> {
return this.handleAsyncQuery(async qr => {
return qr.getCurrentDatabase();
});
return this.handleAsyncQuery(async qr => qr.getCurrentDatabase());
}

async createDatabase(args: t.DBArgs): Promise<void> {

0 comments on commit c6b3a70

Please sign in to comment.