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);
52 SQLVisitor visitor(*(m_t->getDataSource()->getDialect()), *sql);
55 m_commands.push_back(sql.release());
62 const std::size_t ncommands = m_commands.size();
64 for(std::size_t i = 0; i < ncommands; ++i)
65 m_t->execute(*m_commands[i]);
98 m_commands.push_back(sql);
A visitor for building an SQL statement using SQLite dialect.
An utility class to coordinate transactions.
~BatchExecutor()
Virtual destructor.
te::da::DataSourceTransactor * getTransactor() const
It returns a pointer to the underlying data source transactor.
BatchExecutor()
Constructor.
void commit()
It commits the transaction.
void PerformCommands(sqlite3 *db, std::istream &istr)
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
Utility functions for the TerraLib SQLite Data Access driver.
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 ReturnType accept(VisitorType &guest) const =0
It call the visit method from the guest object.
Implements the DataSource class for the SQLite Data Access Driver.
void ExecuteScript(sqlite3 *db, const char *fileName)
An implementation of DataSourceTransactor class for the TerraLib SQLite Data Access Driver...
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...
Implementation of the BatchExecutor class for the TerraLib SQLite Data Access driver.
A Query is independent from the data source language/dialect.