Use transaction for PutMany and cursor Query

This commit is contained in:
Daniel 2025-02-26 16:52:34 +01:00
parent 130c4a427c
commit b68646c689
3 changed files with 66 additions and 27 deletions

View file

@ -115,17 +115,13 @@ func TestSQLite(t *testing.T) {
qZ := &TestRecord{}
qZ.SetKey("test:z")
qZ.CreateMeta()
// put
_, err = db.Put(qA)
if err == nil {
_, err = db.Put(qB)
}
if err == nil {
_, err = db.Put(qC)
}
if err == nil {
_, err = db.Put(qZ)
}
put, errs := db.PutMany(false)
put <- qA
put <- qB
put <- qC
put <- qZ
close(put)
err = <-errs
if err != nil {
t.Fatal(err)
}