mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 04:59:15 -06:00
persist datatype information
This commit is contained in:
parent
8ced29a0e7
commit
e84a1cbcc5
@ -38,6 +38,7 @@ export class SqlPart {
|
||||
params: any[];
|
||||
label: string;
|
||||
name: string;
|
||||
datatype: string;
|
||||
|
||||
constructor(part: any, def: any) {
|
||||
this.part = part;
|
||||
@ -46,6 +47,8 @@ export class SqlPart {
|
||||
throw { message: 'Could not find sql part ' + part.type };
|
||||
}
|
||||
|
||||
this.datatype = part.datatype;
|
||||
|
||||
if (part.name) {
|
||||
this.name = part.name;
|
||||
this.label = def.label + ' ' + part.name;
|
||||
|
@ -87,14 +87,14 @@ export class PostgresQueryCtrl extends QueryCtrl {
|
||||
updatePersistedParts() {
|
||||
this.target.select = _.map(this.selectParts, function(selectParts) {
|
||||
return _.map(selectParts, function(part: any) {
|
||||
return { type: part.def.type, params: part.params };
|
||||
return { type: part.def.type, datatype: part.datatype, params: part.params };
|
||||
});
|
||||
});
|
||||
this.target.where = _.map(this.whereParts, function(part: any) {
|
||||
return { type: part.def.type, name: part.name, params: part.params };
|
||||
return { type: part.def.type, datatype: part.datatype, name: part.name, params: part.params };
|
||||
});
|
||||
this.target.group = _.map(this.groupParts, function(part: any) {
|
||||
return { type: part.def.type, params: part.params };
|
||||
return { type: part.def.type, datatype: part.datatype, params: part.params };
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user