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

Fetching records lazily after closing a connection should raise an error #21

Open
igrep opened this issue Mar 29, 2018 · 1 comment
Open

Comments

@igrep
Copy link

igrep commented Mar 29, 2018

Minimum code to reproduce

import Database.HDBC
import Database.HDBC.Sqlite3

main :: IO ()
main = do
  c <- connectSqlite3 "some.db"
  r <- quickQuery c "select 1;" []
  disconnect c
  print r

Expected result

Raise an error to tell the connection is already closed,
similarly to putStrLn =<< (withFile "file" ReadMode $ hGetContents).

Actual result

Only an empty list [] is printed without any error.
This can make it very hard to detect I used lazy IO in a wrong way.

My environment

  • HDBC-sqlite3-2.3.3.1
  • HDBC-2.4.0.2
  • SQLite: 3.22.0
  • GHC 8.2.2
  • Windows 10 64bit
@igrep
Copy link
Author

igrep commented Apr 28, 2018

ping

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

No branches or pull requests

1 participant