Move tests to query package

This commit is contained in:
Asdine El Hrychy
2019-12-04 20:47:19 +01:00
parent 56abf30461
commit 5b51b1ac0c
14 changed files with 618 additions and 550 deletions

View File

@@ -83,6 +83,17 @@ func (stmt InsertStmt) insertDocuments(t *database.Table, stack EvalStack) (Resu
if err != nil {
return res, err
}
case KVPairs:
v, err := tp.Eval(stack)
if err != nil {
return res, err
}
d, err = v.Value.Value.DecodeToDocument()
if err != nil {
return res, err
}
default:
return res, fmt.Errorf("values must be a list of documents if field list is empty")
}
res.lastInsertKey, err = t.Insert(d)