go-sqlite3
go-sqlite3 copied to clipboard
Return io.EOF for empty Query statements
This small PR is supposed to fix https://github.com/mattn/go-sqlite3/issues/950.
I don't think we should return io.EOF. An empty query is likely a bug, and doing this would mask it.
It is an empty statement. I don't see why it would be considered bug.
I have no strong opinion on this but note that https://pkg.go.dev/modernc.org/sqlite also seems to behave this way and doesn't hang.
It is also similar to the behavior of the already merged https://github.com/mattn/go-sqlite3/pull/973 for Exec.
For me it doesn't make sense db.Query("") to fail and db.Exec("") not.