summaryrefslogtreecommitdiff
path: root/project2/sql
diff options
context:
space:
mode:
Diffstat (limited to 'project2/sql')
-rw-r--r--project2/sql/rdbmsDataSource.cpp8
-rw-r--r--project2/sql/sqlBulkLoad.cpp8
-rw-r--r--project2/sql/sqlCache.cpp20
-rw-r--r--project2/sql/sqlMergeTask.cpp87
-rw-r--r--project2/sql/sqlMergeTask.h8
-rw-r--r--project2/sql/sqlRows.cpp6
-rw-r--r--project2/sql/sqlRows.h2
-rw-r--r--project2/sql/sqlTask.cpp12
-rw-r--r--project2/sql/sqlTask.h2
-rw-r--r--project2/sql/sqlTest.cpp10
-rw-r--r--project2/sql/sqlTest.h2
-rw-r--r--project2/sql/sqlWriter.cpp16
-rw-r--r--project2/sql/sqlWriter.h10
13 files changed, 99 insertions, 92 deletions
diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp
index 691daab..de20844 100644
--- a/project2/sql/rdbmsDataSource.cpp
+++ b/project2/sql/rdbmsDataSource.cpp
@@ -43,10 +43,10 @@ RdbmsDataSource::DSNSet RdbmsDataSource::changedDSNs;
RdbmsDataSource::RdbmsDataSource(ScriptNodePtr p) :
DataSource(p),
masterDsn(p->child("masterdsn")),
- preferLocal(p->value("preferlocal", true))
+ preferLocal(p->value("preferlocal", true, NULL))
{
BOOST_FOREACH(ScriptNodePtr node, p->childrenIn("readonly")) {
- roDSNs.insert(ReadonlyDSNs::value_type(node->value("host").as<std::string>(), node));
+ roDSNs.insert(ReadonlyDSNs::value_type(node->value("host", NULL).as<std::string>(), node));
}
}
@@ -194,8 +194,8 @@ RdbmsDataSource::RdbmsConnection::isExpired() const
}
RdbmsDataSource::ConnectionInfo::ConnectionInfo(ScriptNodePtr node) :
- dsn(node->value("dsn").as<std::string>()),
- typeId(Plugable::getLoader<ConnectionLoader, UnknownConnectionProvider>(node->value("provider")))
+ dsn(node->value("dsn", NULL).as<std::string>()),
+ typeId(Plugable::getLoader<ConnectionLoader, UnknownConnectionProvider>(node->value("provider", NULL)))
{
}
diff --git a/project2/sql/sqlBulkLoad.cpp b/project2/sql/sqlBulkLoad.cpp
index a8283b9..8787d3e 100644
--- a/project2/sql/sqlBulkLoad.cpp
+++ b/project2/sql/sqlBulkLoad.cpp
@@ -20,17 +20,17 @@ class SqlBulkLoad : public Task {
void loadComplete(const CommonObjects * co)
{
- db = co->dataSource<RdbmsDataSource>(dataSource());
+ db = co->dataSource<RdbmsDataSource>(dataSource(NULL));
}
- void execute() const
+ void execute(ExecContext * ec) const
{
const DB::Connection & wdb = db->getWritable();
- wdb.beginBulkUpload(targetTable(), extras());
+ wdb.beginBulkUpload(targetTable(ec), extras(ec));
ScopeObject tidy([]{},
[&]{ wdb.endBulkUpload(NULL); },
[&]{ wdb.endBulkUpload("Stack unwind in progress"); });
- stream->runStream(boost::bind(&DB::Connection::bulkUploadData, &wdb, _1, _2));
+ stream->runStream(boost::bind(&DB::Connection::bulkUploadData, &wdb, _1, _2), ec);
}
const Variable dataSource;
diff --git a/project2/sql/sqlCache.cpp b/project2/sql/sqlCache.cpp
index ba8dfb5..66e9288 100644
--- a/project2/sql/sqlCache.cpp
+++ b/project2/sql/sqlCache.cpp
@@ -85,7 +85,7 @@ class SqlCache : public Cache {
friend class SqlCacheRowSet;
const SqlCacheRowSet * sc;
};
- void execute(const Glib::ustring&, const RowProcessor * rp) const {
+ void execute(const Glib::ustring&, const RowProcessorCallback & rp, ExecContext *) const {
SqlCacheRowState ss(this);
HandleAsVariableType h;
do {
@@ -125,7 +125,7 @@ class SqlCache : public Cache {
mutable int64_t cacheId;
};
- RowSetCPtr getCachedRowSet(const Glib::ustring & n, const Glib::ustring & f, const IHaveParameters * ps) const
+ RowSetCPtr getCachedRowSet(ExecContext * ec, const Glib::ustring & n, const Glib::ustring & f, const IHaveParameters * ps) const
{
Buffer sql;
sql.appendf("SELECT r.* \
@@ -136,12 +136,12 @@ class SqlCache : public Cache {
HeaderTable.c_str(),
HeaderTable.c_str(), n.c_str(), f.c_str(),
HeaderTable.c_str(),n.c_str(), f.c_str());
- applyKeys(boost::bind(appendKeyAnds, &sql, _1), ps);
+ applyKeys(ec, boost::bind(appendKeyAnds, &sql, _1), ps);
sql.appendf(" ORDER BY r.p2_cacheid DESC, r.p2_row");
SelectPtr gh(db->getReadonly().newSelectCommand(sql));
unsigned int offset = 0;
gh->bindParamT(offset++, time(NULL) - CacheLife);
- applyKeys(boost::bind(bindKeyValues, gh.get(), &offset, _2), ps);
+ applyKeys(ec, boost::bind(bindKeyValues, gh.get(), &offset, _2), ps);
if (gh->fetch()) {
return new SqlCacheRowSet(gh);
}
@@ -202,7 +202,7 @@ class SqlCache : public Cache {
mutable Values cols, attrs;
};
- RowSetPresenterPtr openFor(const Glib::ustring & n, const Glib::ustring & f, const IHaveParameters * ps)
+ RowSetPresenterPtr openFor(ExecContext * ec, const Glib::ustring & n, const Glib::ustring & f, const IHaveParameters * ps)
{
Buffer sp;
sp.appendf("SAVEPOINT sp%p", this);
@@ -218,19 +218,19 @@ class SqlCache : public Cache {
Buffer sql;
sql.appendf("INSERT INTO %s_%s_%s(", HeaderTable.c_str(), n.c_str(), f.c_str());
unsigned int offset = 0;
- applyKeys(boost::bind(appendKeyCols, &sql, &offset, _1), ps);
+ applyKeys(ec, boost::bind(appendKeyCols, &sql, &offset, _1), ps);
sql.appendf(") VALUES(");
offset = 0;
- applyKeys(boost::bind(appendKeyBinds, &sql, &offset), ps);
+ applyKeys(ec, boost::bind(appendKeyBinds, &sql, &offset), ps);
sql.appendf(")");
ModifyPtr m(db->getWritable().newModifyCommand(sql));
offset = 0;
- applyKeys(boost::bind(bindKeyValues, m.get(), &offset, _2), ps);
+ applyKeys(ec, boost::bind(bindKeyValues, m.get(), &offset, _2), ps);
m->execute();
return new SqlCachePresenter(n, f, db);
}
- void save(const Glib::ustring & , const Glib::ustring & , const IHaveParameters * )
+ void save(ExecContext *, const Glib::ustring & , const Glib::ustring & , const IHaveParameters * )
{
Buffer sp;
sp.appendf("RELEASE SAVEPOINT sp%p", this);
@@ -238,7 +238,7 @@ class SqlCache : public Cache {
s->execute();
}
- void discard(const Glib::ustring & , const Glib::ustring & , const IHaveParameters * )
+ void discard(ExecContext *, const Glib::ustring & , const Glib::ustring & , const IHaveParameters * )
{
Buffer sp;
sp.appendf("ROLLBACK TO SAVEPOINT sp%p", this);
diff --git a/project2/sql/sqlMergeTask.cpp b/project2/sql/sqlMergeTask.cpp
index 0b19c5e..c5eb93c 100644
--- a/project2/sql/sqlMergeTask.cpp
+++ b/project2/sql/sqlMergeTask.cpp
@@ -27,10 +27,10 @@ class SqlMergeInsert : IHaveParameters, public Task {
Task(p),
insert(NULL) {
}
- void execute() const {
+ void execute(ExecContext * ec) const {
unsigned int col = 0;
BOOST_FOREACH(const Parameters::value_type & v, parameters) {
- boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(insert, col++), v.second);
+ boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(insert, col++), v.second(ec));
}
insert->execute();
}
@@ -59,26 +59,26 @@ SqlMergeTask::SqlMergeTask(ScriptNodePtr p) :
insCmd(NULL),
destdb(NULL),
dataSource(p, "datasource"),
- dtable(p->value("targettable").as<std::string>()),
+ dtable(p->value("targettable", NULL).as<std::string>()),
dtablet(stringf("tmp_%s_%d", dtable.c_str(), getpid()))
{
p->script->loader.addLoadTarget(p, Storer::into<ElementLoader>(&sources));
- if (!sources.empty() && useView()) {
+ if (!sources.empty() && useView(NULL)) {
throw NotSupported("useview not supported with iterate fillers");
}
BOOST_FOREACH(ScriptNodePtr e, p->childrenIn("columns")) {
TargetColumnPtr tcp(new TargetColumn(e->get_name()));
- tcp->maptable = e->value("maptable", "").as<std::string>();
+ tcp->maptable = e->value("maptable", "", NULL).as<std::string>();
if (!tcp->maptable.empty()) {
- if (useView()) {
+ if (useView(NULL)) {
throw NotSupported("useview not supported with mapped columns");
}
- tcp->mapcolumn = e->value("mapcolumn").as<std::string>();
+ tcp->mapcolumn = e->value("mapcolumn", NULL).as<std::string>();
}
cols.insert(tcp);
- tcp->isKey = e->value("key", false);
+ tcp->isKey = e->value("key", false, NULL);
if (tcp->isKey) {
keys.insert(tcp->column);
}
@@ -97,7 +97,7 @@ SqlMergeTask::~SqlMergeTask()
void
SqlMergeTask::loadComplete(const CommonObjects * co)
{
- destdb = &co->dataSource<RdbmsDataSource>(dataSource())->getWritable();
+ destdb = &co->dataSource<RdbmsDataSource>(dataSource(NULL))->getWritable();
insCmd = insertCommand();
BOOST_FOREACH(const Sources::value_type & i, sources) {
attach(i, insCmd);
@@ -116,16 +116,37 @@ SqlMergeTask::TargetColumn::Sort::operator()(const TargetColumnPtr & a, const Ta
return a->column < b->column;
}
+class MergeWhere : public TablePatch::WhereProvider {
+ public:
+ MergeWhere(DynamicSql::SqlCommand * u, ExecContext * e) :
+ ec(e),
+ updateWhere(u)
+ {
+ }
+ void appendWhere(Buffer * buf) const
+ {
+ buf->appendf(" AND %s ", updateWhere->getSqlFor("").c_str());
+ }
+ void bindWhere(DB::Command * cmd) const
+ {
+ unsigned int off = 0;
+ updateWhere->bindParams(ec, cmd, off);
+ }
+ private:
+ ExecContext * ec;
+ const DynamicSql::SqlCommand * updateWhere;
+};
+
void
-SqlMergeTask::execute() const
+SqlMergeTask::execute(ExecContext * ec) const
{
createTempTable();
- if (earlyKeys()) {
+ if (earlyKeys(NULL)) {
createTempKey();
- copyToTempTable();
+ copyToTempTable(ec);
}
else {
- copyToTempTable();
+ copyToTempTable(ec);
createTempKey();
}
std::set<std::string> colNames;
@@ -133,20 +154,21 @@ SqlMergeTask::execute() const
colNames.insert(c->column);
}
TablePatch tp(*destdb, dtablet, dtable, colNames);
- tp.doDelete = doDelete();
- tp.doUpdate = doUpdate();
- tp.doInsert = doInsert();
+ tp.doDelete = doDelete(NULL);
+ tp.doUpdate = doUpdate(NULL);
+ tp.doInsert = doInsert(NULL);
BOOST_FOREACH(const Keys::value_type & k, keys) {
tp.addKey(k);
}
- tp.patch(updateWhere ? this : NULL, patchOrder());
+ MergeWhere mw(updateWhere.get(), ec);
+ tp.patch(updateWhere ? &mw : NULL, patchOrder(NULL));
dropTempTable();
}
void
SqlMergeTask::createTempTable() const
{
- if (useView()) {
+ if (useView(NULL)) {
DB::ModifyCommand * cv = destdb->newModifyCommand(stringf(
"CREATE VIEW %s AS %s",
dtablet.c_str(),
@@ -179,7 +201,7 @@ SqlMergeTask::dropTempTable() const
{
if (tempTableCreated) {
DB::ModifyCommand * d;
- if (useView()) {
+ if (useView(NULL)) {
d = destdb->newModifyCommand("DROP VIEW " + dtablet);
}
else {
@@ -192,7 +214,7 @@ SqlMergeTask::dropTempTable() const
void
SqlMergeTask::createTempKey() const
{
- if (useView()) return;
+ if (useView(NULL)) return;
/* Primary key */
Buffer idx;
idx.appendf("ALTER TABLE %s ADD CONSTRAINT pk_%s PRIMARY KEY(%s)",
@@ -244,10 +266,10 @@ class Populate : public NoOutputExecute {
cmd(c)
{
}
- void execute() const
+ void execute(ExecContext * ec) const
{
unsigned int idx = 0;
- RowState::Stack().back()->foreachColumn(boost::bind(&Populate::bind, this, boost::ref(idx), _3));
+ RowState::Stack().back()->foreachColumn(ec, boost::bind(&Populate::bind, this, boost::ref(idx), _3));
cmd->execute();
}
private:
@@ -285,13 +307,13 @@ attach(boost::intrusive_ptr<IHaveSubTasks> i, DB::ModifyCommand * insert)
}
void
-SqlMergeTask::copyToTempTable() const
+SqlMergeTask::copyToTempTable(ExecContext * ec) const
{
- if (useView()) {
+ if (useView(NULL)) {
return;
}
BOOST_FOREACH(const Sources::value_type & i, sources) {
- i->execute();
+ i->execute(ec);
}
if (sqlCommand) {
Buffer ins;
@@ -312,7 +334,7 @@ SqlMergeTask::copyToTempTable() const
ins.appendf(" FROM (%s) tmp_src", sqlCommand->getSqlFor("").c_str());
DB::ModifyCommand * cttt = destdb->newModifyCommand(ins);
unsigned int off = 0;
- sqlCommand->bindParams(cttt, off);
+ sqlCommand->bindParams(ec, cttt, off);
cttt->execute();
delete cttt;
}
@@ -334,16 +356,3 @@ SqlMergeTask::copyToTempTable() const
}
}
-void
-SqlMergeTask::appendWhere(Buffer * buf) const
-{
- buf->appendf(" AND %s ", updateWhere->getSqlFor("").c_str());
-}
-
-void
-SqlMergeTask::bindWhere(DB::Command * cmd) const
-{
- unsigned int off = 0;
- updateWhere->bindParams(cmd, off);
-}
-
diff --git a/project2/sql/sqlMergeTask.h b/project2/sql/sqlMergeTask.h
index b63c277..6b74ccd 100644
--- a/project2/sql/sqlMergeTask.h
+++ b/project2/sql/sqlMergeTask.h
@@ -16,7 +16,7 @@
#include <list>
/// Project2 component merge arbitrary data into an RDBMS table
-class SqlMergeTask : public Task, public TablePatch::WhereProvider {
+class SqlMergeTask : public Task {
public:
typedef std::string Table;
typedef std::string Column;
@@ -44,7 +44,7 @@ class SqlMergeTask : public Task, public TablePatch::WhereProvider {
virtual ~SqlMergeTask();
virtual void loadComplete(const CommonObjects *);
- void execute() const;
+ void execute(ExecContext *) const;
Columns cols;
Keys keys;
Keys indexes;
@@ -57,12 +57,10 @@ class SqlMergeTask : public Task, public TablePatch::WhereProvider {
const Variable doInsert;
private:
- virtual void copyToTempTable() const;
+ virtual void copyToTempTable(ExecContext * ec) const;
void createTempTable() const;
void dropTempTable() const;
void createTempKey() const;
- void appendWhere(Buffer *) const;
- void bindWhere(DB::Command *) const;
mutable bool tempTableCreated;
typedef ANONSTORAGEOF(Iterate) Sources;
diff --git a/project2/sql/sqlRows.cpp b/project2/sql/sqlRows.cpp
index 83763dd..f723269 100644
--- a/project2/sql/sqlRows.cpp
+++ b/project2/sql/sqlRows.cpp
@@ -28,7 +28,7 @@ SqlRows::~SqlRows()
void
SqlRows::loadComplete(const CommonObjects * co)
{
- db = co->dataSource<RdbmsDataSource>(dataSource());
+ db = co->dataSource<RdbmsDataSource>(dataSource(NULL));
}
SqlRows::SqlState::SqlState(SelectPtr s) :
@@ -48,11 +48,11 @@ SqlRows::SqlState::getColumns() const
}
void
-SqlRows::execute(const Glib::ustring & filter, const RowProcessor * rp) const
+SqlRows::execute(const Glib::ustring & filter, const RowProcessorCallback & rp, ExecContext * ec) const
{
unsigned int offset = 0;
SqlState ss(SelectPtr(db->getReadonly().newSelectCommand(sqlCommand.getSqlFor(filter))));
- sqlCommand.bindParams(ss.query.get(), offset);
+ sqlCommand.bindParams(ec, ss.query.get(), offset);
while (ss.query->fetch()) {
HandleAsVariableType h;
if (ss.fields.empty()) {
diff --git a/project2/sql/sqlRows.h b/project2/sql/sqlRows.h
index 7ed5d3f..6f78dcd 100644
--- a/project2/sql/sqlRows.h
+++ b/project2/sql/sqlRows.h
@@ -16,7 +16,7 @@ class SqlRows : public RowSet {
SqlRows(ScriptNodePtr p);
~SqlRows();
- void execute(const Glib::ustring &, const RowProcessor *) const;
+ void execute(const Glib::ustring &, const RowProcessorCallback &, ExecContext *) const;
virtual void loadComplete(const CommonObjects *);
const Variable dataSource;
diff --git a/project2/sql/sqlTask.cpp b/project2/sql/sqlTask.cpp
index 03f67de..80ea08e 100644
--- a/project2/sql/sqlTask.cpp
+++ b/project2/sql/sqlTask.cpp
@@ -29,24 +29,24 @@ SqlTask::~SqlTask()
void
SqlTask::loadComplete(const CommonObjects * co)
{
- db = co->dataSource<RdbmsDataSource>(dataSource());
+ db = co->dataSource<RdbmsDataSource>(dataSource(NULL));
}
void
-SqlTask::execute() const
+SqlTask::execute(ExecContext * ec) const
{
boost::shared_ptr<DB::ModifyCommand> modify = boost::shared_ptr<DB::ModifyCommand>(
- db->getWritable().newModifyCommand(sqlCommand.getSqlFor(filter())));
+ db->getWritable().newModifyCommand(sqlCommand.getSqlFor(filter(NULL))));
unsigned int offset = 0;
- sqlCommand.bindParams(modify.get(), offset);
+ sqlCommand.bindParams(ec, modify.get(), offset);
if (modify->execute() == 0) {
BOOST_FOREACH(const SubNOEs::value_type & sq, noChangesNOEs) {
- sq->execute();
+ sq->execute(ec);
}
}
else {
BOOST_FOREACH(const SubNOEs::value_type & sq, changesNOEs) {
- sq->execute();
+ sq->execute(ec);
}
}
}
diff --git a/project2/sql/sqlTask.h b/project2/sql/sqlTask.h
index b0d0d27..94901a9 100644
--- a/project2/sql/sqlTask.h
+++ b/project2/sql/sqlTask.h
@@ -16,7 +16,7 @@ class SqlTask : public Task {
SqlTask(ScriptNodePtr p);
virtual ~SqlTask();
virtual void loadComplete(const CommonObjects *);
- virtual void execute() const;
+ virtual void execute(ExecContext * ec) const;
const Variable dataSource;
const Variable filter;
diff --git a/project2/sql/sqlTest.cpp b/project2/sql/sqlTest.cpp
index f45b2c9..2723d8e 100644
--- a/project2/sql/sqlTest.cpp
+++ b/project2/sql/sqlTest.cpp
@@ -32,7 +32,7 @@ SqlTest::~SqlTest()
void
SqlTest::loadComplete(const CommonObjects * co)
{
- db = co->dataSource<RdbmsDataSource>(dataSource());
+ db = co->dataSource<RdbmsDataSource>(dataSource(NULL));
}
class HandleDoCompare : public DB::HandleField {
@@ -88,13 +88,13 @@ class HandleDoCompare : public DB::HandleField {
std::string testOp;
};
bool
-SqlTest::passes() const
+SqlTest::passes(ExecContext * ec) const
{
boost::shared_ptr<DB::SelectCommand> query = boost::shared_ptr<DB::SelectCommand>(
- db->getWritable().newSelectCommand(sqlCommand.getSqlFor(filter())));
+ db->getWritable().newSelectCommand(sqlCommand.getSqlFor(filter(NULL))));
unsigned int offset = 0;
- sqlCommand.bindParams(query.get(), offset);
- HandleDoCompare h(testValue, testOp());
+ sqlCommand.bindParams(ec, query.get(), offset);
+ HandleDoCompare h(testValue(ec), testOp(ec));
while (query->fetch()) {
(*query)[0].apply(h);
}
diff --git a/project2/sql/sqlTest.h b/project2/sql/sqlTest.h
index f722424..af843d1 100644
--- a/project2/sql/sqlTest.h
+++ b/project2/sql/sqlTest.h
@@ -14,7 +14,7 @@ class SqlTest : public Test {
virtual ~SqlTest();
virtual void loadComplete(const CommonObjects *);
- bool passes() const;
+ bool passes(ExecContext *) const;
const Variable dataSource;
const Variable filter;
diff --git a/project2/sql/sqlWriter.cpp b/project2/sql/sqlWriter.cpp
index 1220211..5278759 100644
--- a/project2/sql/sqlWriter.cpp
+++ b/project2/sql/sqlWriter.cpp
@@ -64,15 +64,15 @@ DynamicSql::SqlCommand::writeSql(Glib::ustring & sql) const
}
void
-DynamicSql::SqlCommand::bindParams(DB::Command * cmd, unsigned int & offset) const
+DynamicSql::SqlCommand::bindParams(ExecContext * ec, DB::Command * cmd, unsigned int & offset) const
{
BOOST_FOREACH(const SqlWriterPtr & w, writers) {
- w->bindParams(cmd, offset);
+ w->bindParams(ec, cmd, offset);
}
}
DynamicSql::SqlFilter::SqlFilter(ScriptNodePtr p) :
- name(p->value("name").as<Glib::ustring>()),
+ name(p->value("name", NULL).as<Glib::ustring>()),
active(false)
{
p->composeWithCallbacks(
@@ -91,11 +91,11 @@ DynamicSql::SqlFilter::writeSql(Glib::ustring & sql) const
}
void
-DynamicSql::SqlFilter::bindParams(DB::Command * cmd, unsigned int & offset) const
+DynamicSql::SqlFilter::bindParams(ExecContext * ec, DB::Command * cmd, unsigned int & offset) const
{
if (active) {
BOOST_FOREACH(const SqlWriterPtr & w, writers) {
- w->bindParams(cmd, offset);
+ w->bindParams(ec, cmd, offset);
}
}
}
@@ -112,9 +112,9 @@ DynamicSql::SqlParameter::writeSql(Glib::ustring & sql) const
}
void
-DynamicSql::SqlParameter::bindParams(DB::Command * cmd, unsigned int & offset) const
+DynamicSql::SqlParameter::bindParams(ExecContext * ec, DB::Command * cmd, unsigned int & offset) const
{
- boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(cmd, offset++), (*this));
+ boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(cmd, offset++), (*this)(ec));
}
DynamicSql::SqlText::SqlText(const Glib::ustring & n) :
@@ -129,7 +129,7 @@ DynamicSql::SqlText::writeSql(Glib::ustring & sql) const
}
void
-DynamicSql::SqlText::bindParams(DB::Command *, unsigned int &) const
+DynamicSql::SqlText::bindParams(ExecContext *, DB::Command *, unsigned int &) const
{
}
diff --git a/project2/sql/sqlWriter.h b/project2/sql/sqlWriter.h
index 4b57fa9..5eef9ac 100644
--- a/project2/sql/sqlWriter.h
+++ b/project2/sql/sqlWriter.h
@@ -17,13 +17,13 @@ namespace DynamicSql {
SqlWriter();
virtual ~SqlWriter();
virtual void writeSql(Glib::ustring & sql) const = 0;
- virtual void bindParams(DB::Command *, unsigned int & offset) const = 0;
+ virtual void bindParams(ExecContext *, DB::Command *, unsigned int & offset) const = 0;
};
class SqlText : public SqlWriter {
public:
SqlText(const Glib::ustring &);
virtual void writeSql(Glib::ustring & sql) const;
- virtual void bindParams(DB::Command *, unsigned int & offset) const;
+ virtual void bindParams(ExecContext *, DB::Command *, unsigned int & offset) const;
const Glib::ustring text;
};
@@ -31,13 +31,13 @@ namespace DynamicSql {
public:
SqlParameter(ScriptNodePtr);
virtual void writeSql(Glib::ustring & sql) const;
- virtual void bindParams(DB::Command *, unsigned int & offset) const;
+ virtual void bindParams(ExecContext *, DB::Command *, unsigned int & offset) const;
};
class SqlFilter : public SqlWriter {
public:
SqlFilter(ScriptNodePtr);
virtual void writeSql(Glib::ustring & sql) const;
- virtual void bindParams(DB::Command *, unsigned int & offset) const;
+ virtual void bindParams(ExecContext *, DB::Command *, unsigned int & offset) const;
const Glib::ustring name;
bool active;
@@ -49,7 +49,7 @@ namespace DynamicSql {
public:
SqlCommand(ScriptNodePtr);
virtual void writeSql(Glib::ustring & sql) const;
- virtual void bindParams(DB::Command *, unsigned int & offset) const;
+ virtual void bindParams(ExecContext *, DB::Command *, unsigned int & offset) const;
typedef std::multimap<Glib::ustring, SqlFilterPtr> Filters;
Glib::ustring getSqlFor(const Glib::ustring & f) const;
private: