Skip to content

Conversation

@stevenctl
Copy link

Adds a method that allows executing multiple statements from a single sql string.
See powersync-ja/sqlite_async.dart#123 and powersync-ja/sqlite_async.dart#122 for context.

Disclaimer: I have not taken the time to set up the test dependencies on my my machine yet.

Copy link
Owner

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I agree this functionality is a useful addition 👍

Implementation-wise, I think we can probably do this within the existing protocol. When running without parameters, CommonDatabase.execute will use sqlite3_exec which internally supports multiple statements.

Given that the worker already uses execute, I'd expect that calling execute on the client without parameters should accept multiple statements. Is that not what you were seeing?

@stevenctl
Copy link
Author

Assuming the wrapper ends up using execute here, this PR is probably not needed. I made incorrect assumptions on why the wrapper chose select and prepareBatch. I'll close this for now.

And thanks for your quick response across all the issues/PRs.

@stevenctl stevenctl closed this Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants