27 #include "../common/STLUtils.h" 28 #include "../dataaccess/datasource/ScopedTransaction.h" 29 #include "../dataaccess/query/Query.h" 48 std::auto_ptr<te::da::Query> qq(q);
50 std::auto_ptr<std::string> sql(
new std::string);
62 const std::size_t ncommands =
m_commands.size();
64 for(std::size_t i = 0; i < ncommands; ++i)
std::vector< std::string * > m_commands
An utility class to coordinate transactions.
~BatchExecutor()
Virtual destructor.
virtual ReturnType accept(VisitorType &guest) const =0
It call the visit method from the guest object.
te::da::DataSourceTransactor * getTransactor() const
It returns a pointer to the underlying data source transactor.
BatchExecutor()
Constructor.
void commit()
It commits the transaction.
te::da::DataSource * getDataSource() const
It returns the parent data source of the transactor.
void PerformCommands(sqlite3 *db, std::istream &istr)
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
void execute(const te::da::Query &command)
It executes the specified command using a generic query representation.
DataSourceTransactor * m_t
void add(te::da::Query *q)
It adds the given statement to the list of commands to be executed.
A visitor for building an SQL statement using SQLite dialect.
virtual const SQLDialect * getDialect() const =0
It returns the data source SQL dialect, if there is one.
void ExecuteScript(sqlite3 *db, const char *fileName)
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
A Query is independent from the data source language/dialect.