Added comments and test arround Database::exec() method

This commit is contained in:
Sébastien Rombauts
2014-03-13 21:44:07 +01:00
parent 8d87e80b75
commit 3af95da230
4 changed files with 55 additions and 11 deletions

View File

@@ -61,13 +61,13 @@ Database::~Database(void) noexcept // nothrow
SQLITECPP_ASSERT(SQLITE_OK == ret, sqlite3_errmsg(mpSQLite)); // See SQLITECPP_ENABLE_ASSERT_HANDLER
}
// Shortcut to execute one or multiple SQL statements without results (UPDATE, INSERT, ALTER, COMMIT...).
// Shortcut to execute one or multiple SQL statements without results (UPDATE, INSERT, ALTER, COMMIT, CREATE...).
int Database::exec(const char* apQueries)
{
int ret = sqlite3_exec(mpSQLite, apQueries, NULL, NULL, NULL);
check(ret);
// Return the number of rows modified by those SQL statements (INSERT, UPDATE or DELETE)
// Return the number of rows modified by those SQL statements (INSERT, UPDATE or DELETE only)
return sqlite3_changes(mpSQLite);
}