Add ODBC DirectExec public API (#3502)

* ODBC sqlDirectExec

* doc

* Small fix

* Fix tabs, add missing const, fix style

* Add test case

* Small fixes

* suggested fix for async

* test for returned values
This commit is contained in:
Anton
2023-03-22 08:51:57 +03:00
committed by GitHub
parent 3838070146
commit 93d18162f3
9 changed files with 84 additions and 1 deletions

View File

@@ -136,6 +136,23 @@ std::size_t Statement::execute(bool reset)
else throw InvalidAccessException("Statement still executing.");
}
void Statement::executeDirect(const std::string& query)
{
Mutex::ScopedLock lock(_mutex);
bool isDone = done();
if (initialized() || paused() || isDone)
{
if (!isAsync())
{
if (isDone) _pImpl->reset();
return _pImpl->executeDirect(query);
}
else throw InvalidAccessException("Cannot be executed async.");
}
else throw InvalidAccessException("Statement still executing.");
}
const Statement::Result& Statement::executeAsync(bool reset)
{