Add Database::tryExec() by kcowolf · Pull Request #311 · SRombauts/SQLiteCpp (original) (raw)
I was trying to follow Statement::tryExecuteStep(), which similarly doesn't throw exceptions (compared to Statement::executeStep and Statement::exec, which do).
Also, C# has some "Try" functions which behave similarly. For example, int.TryParse() versus int.Parse(). int.TryParse() returns false if the string can't be parsed as an integer, while int.Parse() throws an exception. https://stackoverflow.com/questions/467613/parse-v-tryparse
I'd be fine with renaming it if you prefer, though. It just made sense to me based on the above.