Swift-Kuery icon indicating copy to clipboard operation
Swift-Kuery copied to clipboard

Add reset statement for prepared statements

Open moshegottlieb opened this issue 5 years ago • 1 comments

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:

  1. Prepare statement
  2. For each request:
    1. Execute statement
      1. Iterate results
        1. If a certain condition occurs - break

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.

moshegottlieb avatar Apr 24 '19 10:04 moshegottlieb

This is definitely something we should look to implement.

Moving to backlog for consideration in a future sprint.

kilnerm avatar Apr 24 '19 12:04 kilnerm