SQLite multiple statement handling

This commit is contained in:
Aleksandar Fabijanic
2008-01-21 00:56:52 +00:00
parent 1f47c0df2f
commit 5e1605823b
24 changed files with 441 additions and 232 deletions

View File

@@ -285,7 +285,7 @@ private:
}
sqlite3_stmt* _pStmt;
NullIndVec _nulls;
NullIndVec _nulls;
};

View File

@@ -95,8 +95,15 @@ protected:
bool canBind() const;
/// Returns true if a valid statement is set and we can bind.
void compileImpl();
/// Compiles the statement, doesn't bind yet
bool compileImpl();
/// Compiles the statement, doesn't bind yet.
/// Returns true if the statement was succesfully compiled.
/// The way SQLite handles batches of statmeents is by compiling
/// one at a time and returning a pointer to the next one.
/// The remainder of the statement is remebered in a string
/// buffer pointed to by _pLeftover member. Non-zero _pLeftover
/// pointing to an empty string means no more statements left
/// to compile.
void bindImpl();
/// Binds parameters
@@ -116,15 +123,22 @@ private:
typedef Poco::Data::AbstractBindingVec Bindings;
typedef Poco::Data::AbstractExtractionVec Extractions;
typedef std::vector<Poco::Data::MetaColumn> MetaColumnVec;
typedef std::vector<MetaColumnVec> MetaColumnVecVec;
typedef Poco::SharedPtr<std::string> StrPtr;
typedef Bindings::iterator BindIt;
sqlite3* _pDB;
sqlite3_stmt* _pStmt;
bool _stepCalled;
int _nextResponse;
BinderPtr _pBinder;
ExtractorPtr _pExtractor;
MetaColumnVec _columns;
Poco::UInt32 _affectedRowCount;
sqlite3* _pDB;
sqlite3_stmt* _pStmt;
bool _stepCalled;
int _nextResponse;
BinderPtr _pBinder;
ExtractorPtr _pExtractor;
MetaColumnVecVec _columns;
Poco::UInt32 _affectedRowCount;
StrPtr _pLeftover;
BindIt _bindBegin;
bool _canBind;
bool _isExtracted;
};
@@ -143,6 +157,12 @@ inline AbstractBinder& SQLiteStatementImpl::binder()
}
inline bool SQLiteStatementImpl::canBind() const
{
return _canBind;
}
} } } // namespace Poco::Data::SQLite