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:
@ -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[];
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user