mysql: began work on backend macro engine

This commit is contained in:
Torkel Ödegaard
2017-04-19 10:09:52 +02:00
parent 62d11c147b
commit e164eba677
6 changed files with 124 additions and 17 deletions

View File

@ -0,0 +1,22 @@
package mysql
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestMacroEngine(t *testing.T) {
Convey("MacroEngine", t, func() {
Convey("interpolate simple function", func() {
engine := &MySqlMacroEngine{}
sql, err := engine.Interpolate("select $__time(time_column)")
So(err, ShouldBeNil)
So(sql, ShouldEqual, "select UNIX_TIMESTAMP(time_column) as time_sec")
})
})
}