You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello, i am having database is locked issue.
i can reproduce in below minimal example. as far as i know a constrain violation should not lock for subsequent operations
can you help me :) ?
thank you
// example.gopackage main
import (
"fmt""log""os""github.com/upper/db/v4""github.com/upper/db/v4/adapter/sqlite"
)
varsettings= sqlite.ConnectionURL{
Database: `example.db`,
}
funcmain() {
deferos.Remove(`example.db`)
sess, err:=sqlite.Open(settings)
iferr!=nil {
log.Fatalf("db.Open(): %q\n", err)
}
_, err=sess.SQL().Exec(`DROP TABLE IF EXISTS "example1"; create table example1( id INTEGER PRIMARY KEY AUTOINCREMENT, slug text not null, subtype text not null, description text not null, group_id text not null, unique( slug, group_id) );`)
iferr!=nil {
log.Fatal(err)
}
//sess.SetMaxOpenConns(1)defersess.Close()
forrange []int{1, 2, 3} {
Insert(sess)
}
}
funcInsert(sess db.Session) {
tbl:=sess.Collection("example1")
_, err:=tbl.Insert(db.Cond{
"slug": "aa",
"group_id": "g1",
"description": "asas",
"subtype": "asa",
})
fmt.Println(err)
}
hello, i am having database is locked issue.
i can reproduce in below minimal example. as far as i know a constrain violation should not lock for subsequent operations
can you help me :) ?
thank you
The text was updated successfully, but these errors were encountered: