[golang] rewrite database handling
This commit is contained in:
parent
db07815736
commit
5611f5b468
3 changed files with 134 additions and 54 deletions
|
@ -26,7 +26,10 @@ func main() {
|
|||
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
|
||||
defer cancel()
|
||||
|
||||
db, err := database.DBInit(ctx, "./spacetraders.db")
|
||||
db, err := database.NewDB(
|
||||
ctx,
|
||||
"./spacetraders.db?_txlock=immediate",
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "DbInit error %+v\n", err)
|
||||
os.Exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue