|
|
|
|
@ -98,8 +98,8 @@ export class PostgresQueryCtrl extends QueryCtrl { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
buildSelectMenu() { |
|
|
|
|
this.selectMenu = [ |
|
|
|
|
{ |
|
|
|
|
this.selectMenu = []; |
|
|
|
|
let aggregates = { |
|
|
|
|
text: 'Aggregate Functions', |
|
|
|
|
value: 'aggregate', |
|
|
|
|
submenu: [ |
|
|
|
|
@ -111,16 +111,26 @@ export class PostgresQueryCtrl extends QueryCtrl { |
|
|
|
|
{ text: 'Standard deviation', value: 'stddev' }, |
|
|
|
|
{ text: 'Variance', value: 'variance' }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// first and last are timescaledb specific
|
|
|
|
|
aggregates.submenu.push({ text: 'First', value: 'first' }); |
|
|
|
|
aggregates.submenu.push({ text: 'Last', value: 'last' }); |
|
|
|
|
|
|
|
|
|
this.selectMenu.push(aggregates); |
|
|
|
|
|
|
|
|
|
// ordered set aggregates require postgres 9.4+
|
|
|
|
|
let aggregates2 = { |
|
|
|
|
text: 'Ordered-Set Aggregate Functions', |
|
|
|
|
value: 'percentile', |
|
|
|
|
submenu: [ |
|
|
|
|
{ text: 'Percentile (continuous)', value: 'percentile_cont' }, |
|
|
|
|
{ text: 'Percentile (discrete)', value: 'percentile_disc' }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
}; |
|
|
|
|
this.selectMenu.push(aggregates2); |
|
|
|
|
|
|
|
|
|
let windows = { |
|
|
|
|
text: 'Window Functions', |
|
|
|
|
value: 'window', |
|
|
|
|
submenu: [ |
|
|
|
|
@ -128,8 +138,9 @@ export class PostgresQueryCtrl extends QueryCtrl { |
|
|
|
|
{ text: 'Rate', value: 'rate' }, |
|
|
|
|
{ text: 'Sum', value: 'sum' }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
}; |
|
|
|
|
this.selectMenu.push(windows); |
|
|
|
|
|
|
|
|
|
this.selectMenu.push({ text: 'Alias', value: 'alias' }); |
|
|
|
|
this.selectMenu.push({ text: 'Column', value: 'column' }); |
|
|
|
|
} |
|
|
|
|
|