Open
Description
I can fix after my last pr is approved the code to fix it is
All changes add in datasource.ts
import { getBackendSrv, getTemplateSrv } from '@grafana/runtime';
applyTemplateVariables(query: MyQuery, scopedVars: any): MyQuery {
return {
...query,
query: getTemplateSrv().replace(query.query || '', scopedVars),
};
}
async query(options: DataQueryRequest<MyQuery>): Promise<DataQueryResponse> {
const timestamps = getConsumableTime(options.range);
const interpolatedTargets = options.targets.map((target) => {
return this.applyTemplateVariables(target, options.scopedVars);
});
const promises = interpolatedTargets.map((target) => {
if (!this.cachedQuery.data) {
this.cachedQuery.data = new Promise((resolve, reject) => {
this.cachedQuery.promise = {
resolve,
reject,
};
});
}
after this is deployed something like this will work
select * from "default"
WHERE account_id = ${AccountId}
Metadata
Metadata
Assignees
Labels
No labels