sqlite3-ruby icon indicating copy to clipboard operation
sqlite3-ruby copied to clipboard

execute_batch returns the result of the last statement

Open donaldong opened this issue 6 years ago • 1 comments

Currently execute_batch always return nil.

  1. Would it be better to return the result of the last statement instead?
  2. Would it make sense to accept a list of statements as well? For example:
db.execute_batch [
  "PRAGMA empty_result_callbacks=1",
  "CREATE TABLE t1(a,b)",
  "CREATE INDEX t1i3 ON t1(a,b)",
  "INSERT INTO t1 VALUES(1, 2)",
  "SELECT * FROM t1",
]

or simply db.execute [...]?

donaldong avatar Dec 30 '18 00:12 donaldong

Yes, I think both of those things would be fine.

tenderlove avatar Jan 10 '19 19:01 tenderlove