@@ -194,12 +194,16 @@ step! = |@Stmt(stmt)|
194194 |> Result . map_err (internal_to_external_error )
195195
196196# internal use only
197+ ## Resets a prepared statement back to its initial state, ready to be re-executed.
197198reset ! : Stmt => Result {} [SqliteErr ErrCode Str ]
198199reset ! = |@Stmt (stmt)|
199200 Host . sqlite_reset !(stmt )
200201 |> Result . map_err (internal_to_external_error )
201202
202- ## Execute a SQL statement that doesn't return any rows (like INSERT, UPDATE, DELETE).
203+ ## Execute a SQL statement that **doesn't return any rows** (like INSERT, UPDATE, DELETE).
204+ ## Use a function starting with `query_` if you expect rows to be returned.
205+ ##
206+ ## Use execute_prepared! if you expect to run the same query multiple times.
203207##
204208## Example:
205209## ```
@@ -218,12 +222,13 @@ execute! :
218222 query : Str ,
219223 bindings : List Binding ,
220224 }
221- => Result {} [SqliteErr ErrCode Str , UnhandledRows ]
225+ => Result {} [SqliteErr ErrCode Str , RowsReturnedUseQueryInstead ]
222226execute ! = |{ path, query: q, bindings }|
223227 stmt = try(prepare!, { path, query: q })
224228 execute_prepared!({ stmt, bindings })
225229
226- ## Execute a prepared SQL statement that doesn't return any rows.
230+ ## Execute a prepared SQL statement that **doesn't return any rows** (like INSERT, UPDATE, DELETE).
231+ ## Use a function starting with `query_` if you expect rows to be returned.
227232##
228233## This is more efficient than [execute!] when running the same query multiple times
229234## as it reuses the prepared statement.
@@ -232,7 +237,7 @@ execute_prepared! :
232237 stmt : Stmt ,
233238 bindings : List Binding ,
234239 }
235- => Result {} [SqliteErr ErrCode Str , UnhandledRows ]
240+ => Result {} [SqliteErr ErrCode Str , RowsReturnedUseQueryInstead ]
236241execute_prepared ! = |{ stmt, bindings }|
237242 try(bind!, stmt, bindings)
238243 res = step!(stmt)
@@ -242,7 +247,7 @@ execute_prepared! = |{ stmt, bindings }|
242247 Ok ({})
243248
244249 Ok (Row ) ->
245- Err (UnhandledRows )
250+ Err (RowsReturnedUseQueryInstead )
246251
247252 Err (e) ->
248253 Err (e)
0 commit comments