[Haskell-cafe] Haskell SQL backends: How is data handed over?

Steven Shaw steven at steshaw.org
Wed Aug 10 09:50:08 UTC 2022

Hi Olaf,

It's unlikely that a HDBC database driver will reconstruct a String query
and execute that against the database. The originalQuery is simply the one
you originally provided to prepare the Statement. You probably want
    execute :: [SqlValue] -> IO Integer
    executeMany :: [[SqlValue]] -> IO ()

The executeMany is intended to send a batch of prepared arguments to the
database driver. However, I did note that the PostgreSQL driver for HDBC
doesn't handle this efficiently. So, check the implementation for your
specific backend.


All that said, if you are doing a large bulk import, it could certainly be
more efficient to use your database's facilities for doing bulk import. e.g.

You might also find that you are better off using an alternative to HDBC
for your specific dbms, depending on the performance you require and
whether executeMany is implemented efficiently in the HDBC driver for your
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20220810/ce1ef005/attachment.html>

More information about the Haskell-Cafe mailing list