add executeMultiple for multi-statement strings #123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #122
This PR adds a new method that allows executing all statements in a given string. More context is in the issue.
Based on feedback, I've updated the PR to just use
executewhich doesn't require any changes to the coresqlite3package. However, I still believe this functionality needs a new API. It is valid to expect aResultSetfrom the vanillaexecute. I don't think there is a way to modify that signature to add settings here. The only way to avoid adding an API hereAlso, using
executemeans that it is valid after all to pass parameters. Usingparams.isEmpty/isNotEmptyis probably not a good way to decide whether the user can expect a result back (it's perfectly valid to expect a result fromINSERT INTO mytable (something) RETURNING id.This is implemented using prepareMultiple from thesqlite3package.For web support, an additional PR (simolus3/sqlite3.dart#337) was required in that repo/package. For now I left a dependency override that should be removed before merging.