Fix bug with RETURN DIFF in rpc methods
This commit is contained in:
parent
d8c53da443
commit
347e271984
1 changed files with 3 additions and 3 deletions
|
@ -155,17 +155,17 @@ func (r *rpc) Change(c *fibre.Context, class string, thing interface{}, data map
|
||||||
func (r *rpc) Modify(c *fibre.Context, class string, thing interface{}, data []interface{}) (interface{}, error) {
|
func (r *rpc) Modify(c *fibre.Context, class string, thing interface{}, data []interface{}) (interface{}, error) {
|
||||||
switch thing := thing.(type) {
|
switch thing := thing.(type) {
|
||||||
case *fibre.RPCNull:
|
case *fibre.RPCNull:
|
||||||
return db.Execute(c, "UPDATE $class DIFF $data RETURN DIFF", map[string]interface{}{
|
return db.Execute(c, "UPDATE $class DIFF $data RETURN AFTER", map[string]interface{}{
|
||||||
"class": sql.NewTable(class),
|
"class": sql.NewTable(class),
|
||||||
"data": data,
|
"data": data,
|
||||||
})
|
})
|
||||||
case []interface{}:
|
case []interface{}:
|
||||||
return db.Execute(c, "UPDATE $batch DIFF $data RETURN DIFF", map[string]interface{}{
|
return db.Execute(c, "UPDATE $batch DIFF $data RETURN AFTER", map[string]interface{}{
|
||||||
"batch": sql.NewBatch(class, thing),
|
"batch": sql.NewBatch(class, thing),
|
||||||
"data": data,
|
"data": data,
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
return db.Execute(c, "UPDATE $thing DIFF $data RETURN DIFF", map[string]interface{}{
|
return db.Execute(c, "UPDATE $thing DIFF $data RETURN AFTER", map[string]interface{}{
|
||||||
"thing": sql.NewThing(class, thing),
|
"thing": sql.NewThing(class, thing),
|
||||||
"data": data,
|
"data": data,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue