allow multiple sql statements#114
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the SQL query execution mechanism to allow multiple SQL statements to be executed in a single batch. The change switches from executing individual SQL statements to using batch execution, which enables support for multiple statements separated by semicolons.
Key changes:
- Replace single statement execution with batch execution
- Update affected rows handling to always return 0
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| .map(|_affected_rows| { | ||
| vec![Response::Execution(Tag::new("OK").with_rows(0))] | ||
| }) | ||
| .map_err(|e| PgWireError::ApiError(Box::new(e))) |
There was a problem hiding this comment.
Always returning 0 affected rows loses important information. The execute_batch method may not return affected row counts, but this hardcoded 0 could mislead clients expecting accurate row counts for INSERT/UPDATE/DELETE operations.
| .map(|affected_rows| { | ||
| vec![Response::Execution(Tag::new("OK").with_rows(affected_rows))] | ||
| .execute_batch(_query) | ||
| .map(|_affected_rows| { |
There was a problem hiding this comment.
The variable _affected_rows is prefixed with underscore but then not used. If execute_batch doesn't return affected rows, consider renaming to _ or removing the variable entirely for clarity.
| .map(|_affected_rows| { | |
| .map(|_| { |
Pull Request Test Coverage Report for Build 16927020019Details
💛 - Coveralls |
No description provided.