persist datatype information

This commit is contained in:
Sven Klemm 2018-08-16 12:50:32 +02:00
parent 8ced29a0e7
commit e84a1cbcc5
2 changed files with 6 additions and 3 deletions

View File

@ -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;

View File

@ -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 };
});
}