Loading CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Add missing group chat channel message when a user is added to the group. - Add missing group chat channel message when a user is kicked from the group. - Add missing group chat channel message when a user is promoted in the group. - Handle TIMESTAMPTZ return types in Lua runtime custom SQL queries. ## [2.6.0] - 2019-07-01 ### Added Loading server/runtime_lua_context.go +8 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package server import ( "fmt" "github.com/yuin/gopher-lua" "time" ) const ( Loading Loading @@ -113,6 +113,7 @@ func RuntimeLuaConvertValue(l *lua.LState, val interface{}) lua.LValue { // Types looked up from: // https://golang.org/pkg/encoding/json/#Unmarshal // https://developers.google.com/protocol-buffers/docs/proto3#scalar // More types added based on observations. switch v := val.(type) { case bool: return lua.LBool(v) Loading Loading @@ -156,8 +157,13 @@ func RuntimeLuaConvertValue(l *lua.LState, val interface{}) lua.LValue { lt.RawSetInt(k+1, RuntimeLuaConvertValue(l, v)) } return lt case time.Time: return lua.LNumber(v.UTC().Unix()) case nil: return lua.LNil default: return nil // Never return an actual Go `nil` or it will cause nil pointer dereferences inside gopher-lua. return lua.LNil } } Loading Loading
CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Add missing group chat channel message when a user is added to the group. - Add missing group chat channel message when a user is kicked from the group. - Add missing group chat channel message when a user is promoted in the group. - Handle TIMESTAMPTZ return types in Lua runtime custom SQL queries. ## [2.6.0] - 2019-07-01 ### Added Loading
server/runtime_lua_context.go +8 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package server import ( "fmt" "github.com/yuin/gopher-lua" "time" ) const ( Loading Loading @@ -113,6 +113,7 @@ func RuntimeLuaConvertValue(l *lua.LState, val interface{}) lua.LValue { // Types looked up from: // https://golang.org/pkg/encoding/json/#Unmarshal // https://developers.google.com/protocol-buffers/docs/proto3#scalar // More types added based on observations. switch v := val.(type) { case bool: return lua.LBool(v) Loading Loading @@ -156,8 +157,13 @@ func RuntimeLuaConvertValue(l *lua.LState, val interface{}) lua.LValue { lt.RawSetInt(k+1, RuntimeLuaConvertValue(l, v)) } return lt case time.Time: return lua.LNumber(v.UTC().Unix()) case nil: return lua.LNil default: return nil // Never return an actual Go `nil` or it will cause nil pointer dereferences inside gopher-lua. return lua.LNil } } Loading