- SQL logging channel and archiving strategy

- row formatting refactored
- affected row count for insert, delete and update returned from Statement::execute()
- internal SQL string formatting capability using Poco::format()
This commit is contained in:
Aleksandar Fabijanic
2008-01-12 18:25:27 +00:00
parent b57f579d16
commit 9e8e627347
63 changed files with 2556 additions and 337 deletions

View File

@@ -53,7 +53,8 @@ SQLiteStatementImpl::SQLiteStatementImpl(Poco::Data::SessionImpl& rSession, sqli
_pDB(pDB),
_pStmt(0),
_stepCalled(false),
_nextResponse(0)
_nextResponse(0),
_affectedRowCount(0)
{
}
@@ -136,7 +137,7 @@ bool SQLiteStatementImpl::canBind() const
void SQLiteStatementImpl::bindImpl()
{
_stepCalled = false;
_stepCalled = false;
_nextResponse = 0;
if (_pStmt == 0) return;
@@ -150,6 +151,8 @@ void SQLiteStatementImpl::bindImpl()
Bindings::iterator it = binds.begin();
Bindings::iterator itEnd = binds.end();
if (it != itEnd)
_affectedRowCount = (*it)->numOfRowsHandled();
for (; it != itEnd && (*it)->canBind(); ++it)
{
(*it)->bind(pos);
@@ -161,6 +164,7 @@ void SQLiteStatementImpl::bindImpl()
void SQLiteStatementImpl::clear()
{
_columns.clear();
_affectedRowCount = 0;
if (_pStmt)
{
@@ -222,7 +226,7 @@ Poco::UInt32 SQLiteStatementImpl::next()
int rc = _nextResponse;
Utility::throwException(rc, std::string("Iterator Error: trying to access the next value"));
}
return 1u;
}
@@ -240,4 +244,10 @@ const MetaColumn& SQLiteStatementImpl::metaColumn(Poco::UInt32 pos) const
}
Poco::UInt32 SQLiteStatementImpl::affectedRowCount() const
{
return _affectedRowCount ? _affectedRowCount : sqlite3_changes(_pDB);
}
} } } // namespace Poco::Data::SQLite