Swift-Kuery
Swift-Kuery copied to clipboard
Add reset statement for prepared statements
The way I would normally work with servers is to prepare statements for each connection, and then reuse these statements.
In Kuery, this is not an easy task.
While it is possible to release
prepared statements using the Connection
protocol, it is not possible to reset those statements and prepare them for reuse.
Imagine the following scenario:
- Prepare statement
- For each request:
- Execute statement
- Iterate results
- If a certain condition occurs - break
- Iterate results
- Execute statement
The problem here is that the statement will be left in a transient state, and cannot be reused until it is reset, because not all results were necessarily fetched.
Something like PQclear
for posgresql and sqlite3_reset
for sqlite.
This is definitely something we should look to implement.
Moving to backlog for consideration in a future sprint.