Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock while using named arguments #55

Closed
percee opened this issue Dec 11, 2021 · 1 comment · Fixed by #80
Closed

Deadlock while using named arguments #55

percee opened this issue Dec 11, 2021 · 1 comment · Fixed by #80

Comments

@percee
Copy link

percee commented Dec 11, 2021

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
@proullon
Copy link
Owner

Thanks for the report, I'll take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants