ramsql
ramsql copied to clipboard
Deadlock while using named arguments
While following a slight deviation to the example on https://pkg.go.dev/database/sql, I encountered a deadlock. For example,
example.go
package myproject
import (
"database/sql"
_ "github.com/proullon/ramsql/driver"
)
db, _ := sql.Open("ramsql", ":inmemory:")
defer db.Close()
var name string
// sql: expected 0 arguments, got 1
db.QueryRowContext(context.TODO(), "select p.name from people as p where p.id = :id;", sql.Named("id", "1234")).Scan(&name)
// deadlock 🤔
db.ExecContext(context.TODO(), "INSERT INTO people (id,name) VALUES (?,?)", "1234", "Ramone")
go.mod
module github.com/myorg/myproject
go 1.17
require github.com/proullon/ramsql v0.0.0-20211120092837-c8d0a408b939
Thanks for the report, I'll take a look