mirror of
https://github.com/safing/portmaster
synced 2025-09-10 23:14:35 +00:00
Use transaction for PutMany and cursor Query
This commit is contained in:
parent
130c4a427c
commit
b68646c689
3 changed files with 66 additions and 27 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue