feat: implement command functionality with new CommandController, update Query entity, and enhance query execution with headers support
This commit is contained in:
25
src/vm/plugins/query.plugin.ts
Normal file
25
src/vm/plugins/query.plugin.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { QueryExecuterService } from "../../query/executer/query.executer.service";
|
||||
import { Query } from "../../query/entities/query.entity";
|
||||
import { Plugin } from "../plugin.class";
|
||||
|
||||
export class QueryPlugin extends Plugin {
|
||||
constructor(
|
||||
name: string,
|
||||
private query: Query,
|
||||
private QueryExecuterService: QueryExecuterService
|
||||
) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
static async init(query: Query, queryExecuterService: QueryExecuterService) {
|
||||
return new QueryPlugin("query", query, queryExecuterService);
|
||||
}
|
||||
|
||||
async run(data): Promise<any> {
|
||||
return await this.QueryExecuterService.runQuery(this.query.id, data);
|
||||
}
|
||||
|
||||
onFinish() {
|
||||
// No resources to clean up
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user