Stop switching to a different datasource per workspace (#3425)

* Stop switching to a different datasource per workspace

* Add console

* Remove call to metadata
This commit is contained in:
Charles Bochet
2024-01-14 00:21:21 +01:00
committed by GitHub
parent 95326b2828
commit 8893cbc05d
25 changed files with 83 additions and 32 deletions

View File

@ -1,10 +1,12 @@
import { GraphQLResolveInfo } from 'graphql';
import { FieldMetadataInterface } from 'src/metadata/field-metadata/interfaces/field-metadata.interface';
import { ObjectMetadataInterface } from 'src/metadata/field-metadata/interfaces/object-metadata.interface';
export interface WorkspaceQueryRunnerOptions {
targetTableName: string;
workspaceId: string;
info: GraphQLResolveInfo;
fieldMetadataCollection: FieldMetadataInterface[];
objectMetadataCollection: ObjectMetadataInterface[];
}

View File

@ -64,11 +64,17 @@ export class WorkspaceQueryRunnerService {
): Promise<IConnection<Record> | undefined> {
try {
const { workspaceId, targetTableName } = options;
const start = performance.now();
const query = await this.workspaceQueryBuilderFactory.findMany(
args,
options,
);
const result = await this.execute(query, workspaceId);
const end = performance.now();
console.log(`query time: ${end - start} ms`);
return this.parseResult<IConnection<Record>>(result, targetTableName, '');
} catch (exception) {