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

execute_batch returns the result of the last statement #243

Open
donaldong opened this issue Dec 30, 2018 · 1 comment
Open

execute_batch returns the result of the last statement #243

donaldong opened this issue Dec 30, 2018 · 1 comment
Labels
Milestone

Comments

@donaldong
Copy link

donaldong commented Dec 30, 2018

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 [...]?

@tenderlove
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants