postgres: change $__timeGroup macro to include "AS time" column alias (#10119)

* change $__timeGroup macro to include column alias

* update docs and help text for $__timeGroup macro
This commit is contained in:
Sven Klemm
2017-12-08 15:14:10 +01:00
committed by Daniel Lee
parent 0c5ef1453d
commit ce809de1ed
4 changed files with 7 additions and 7 deletions

View File

@ -45,7 +45,7 @@ func TestMacroEngine(t *testing.T) {
sql, err := engine.Interpolate(timeRange, "GROUP BY $__timeGroup(time_column,'5m')")
So(err, ShouldBeNil)
So(sql, ShouldEqual, "GROUP BY (extract(epoch from \"time_column\")/300)::bigint*300")
So(sql, ShouldEqual, "GROUP BY (extract(epoch from time_column)/300)::bigint*300 AS time")
})
Convey("interpolate __timeTo function", func() {