From d416b4058310f5fe4d393cbdd9f24233b11ef27b Mon Sep 17 00:00:00 2001 From: bielow Date: Mon, 21 Nov 2022 22:51:35 +0100 Subject: [PATCH] extend on reset() vs clearBindings() --- include/SQLiteCpp/Statement.h | 5 ++++- src/Statement.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/SQLiteCpp/Statement.h b/include/SQLiteCpp/Statement.h index d5a4c5b..e14fed0 100644 --- a/include/SQLiteCpp/Statement.h +++ b/include/SQLiteCpp/Statement.h @@ -86,7 +86,10 @@ public: /// The finalization will be done by the destructor of the last shared pointer ~Statement() = default; - /// Reset the statement to make it ready for a new execution. Throws an exception on error. + /// Reset the statement to make it ready for a new execution by calling sqlite3_reset. + /// Throws an exception on error. + /// Call this function before any news calls to bind() if the statement was already executed before. + /// Calling reset() does not clear the bindings (see clearBindings()). void reset(); /// Reset the statement. Returns the sqlite result code instead of throwing an exception on error. diff --git a/src/Statement.cpp b/src/Statement.cpp index 9ee3471..a3e5193 100644 --- a/src/Statement.cpp +++ b/src/Statement.cpp @@ -43,7 +43,7 @@ Statement::Statement(Statement&& aStatement) noexcept : aStatement.mbDone = false; } -// Reset the statement to make it ready for a new execution (see also #clearBindings() bellow) +// Reset the statement to make it ready for a new execution (see also #clearBindings() below) void Statement::reset() { const int ret = tryReset();