Add upsert mutation

This commit is contained in:
Vikram Rangnekar
2019-10-05 02:17:08 -04:00
parent 0fc1236266
commit a1fa1f3e9e
5 changed files with 203 additions and 46 deletions

View File

@ -22,6 +22,7 @@ const (
ActionInsert Action = iota + 1
ActionUpdate
ActionDelete
ActionUpsert
)
type QCode struct {
@ -373,6 +374,9 @@ func (com *Compiler) compileArgs(sel *Select, args []Arg) error {
case "update":
sel.Action = ActionUpdate
err = com.compileArgAction(sel, arg)
case "upsert":
sel.Action = ActionUpsert
err = com.compileArgAction(sel, arg)
case "delete":
sel.Action = ActionDelete
err = com.compileArgAction(sel, arg)