executeBatch only works on MySQL

Issue #1 open
Anonymous created an issue

You have a bit of code to insert records into the database that accumulates the value groups into a batch and submits them all at once, presumably returning all the generated primary key IDs. (entity.internal and clause.internal, do-prepared-insert)

I don't know if you're aware, but only one database supports this functionality, MySQL. Oracle, PostgreSQL, and DB2 generate error messages when you try to run this code. If you want to support more than MySQL, you need to make individual execute() calls and accumulate the resulting IDs.

Comments (2)

  1. Shantanu Kumar repo owner
    • changed status to open

    Thanks for the bug report -- you are right. The code that actually talks to the database is quite clunky in SQLRat v0.2 right now. To address this, in SQLRat v0.3 (which would be a major overhaul) I am planning to 1. reduce SQLRat v0.3 to only a relational-mapping library that generates SQL statements, and 2. advise to use Fountain-JDBC https://bitbucket.org/kumarshantanu/fountain-jdbc/src for talking to the DB

    In Fountain-JDBC the batch-insert operation does not return a collection of generated IDs: https://bitbucket.org/kumarshantanu/fountain-jdbc/src/184d3dcca3de/src/main/clj/org/bituf/fountain/jdbc.clj#cl-256

    Hope this approach will fix several issues currently associated with SQLRat/c.c.sql. However, I am keeping this bug open for now -- will close it when SQLRat v0.3 gets released.

  2. Anonymous

    Have you gotten anywhere with SQLRat 0.3 in the source tree, or is it still in the planning stages? Or rather, should I be working from source rather than the SQLRat 0.2 release?

  3. Log in to comment