diff options
Diffstat (limited to 'project2/sql')
-rw-r--r-- | project2/sql/Jamfile.jam | 16 | ||||
-rw-r--r-- | project2/sql/pch.hpp | 2 | ||||
-rw-r--r-- | project2/sql/rdbmsDataSource.cpp | 22 | ||||
-rw-r--r-- | project2/sql/rdbmsDataSource.h | 5 | ||||
-rw-r--r-- | project2/sql/sqlCache.cpp | 2 | ||||
-rw-r--r-- | project2/sql/sqlCheck.cpp | 8 | ||||
-rw-r--r-- | project2/sql/sqlCheck.h | 4 | ||||
-rw-r--r-- | project2/sql/sqlMergeTask.cpp | 51 | ||||
-rw-r--r-- | project2/sql/sqlMergeTask.h | 5 | ||||
-rw-r--r-- | project2/sql/sqlRows.cpp | 5 | ||||
-rw-r--r-- | project2/sql/sqlRows.h | 3 | ||||
-rw-r--r-- | project2/sql/sqlTask.cpp | 21 | ||||
-rw-r--r-- | project2/sql/sqlTask.h | 3 | ||||
-rw-r--r-- | project2/sql/sqlWriter.cpp | 67 | ||||
-rw-r--r-- | project2/sql/sqlWriter.h | 9 |
15 files changed, 106 insertions, 117 deletions
diff --git a/project2/sql/Jamfile.jam b/project2/sql/Jamfile.jam index 779aba3..068394f 100644 --- a/project2/sql/Jamfile.jam +++ b/project2/sql/Jamfile.jam @@ -1,12 +1,12 @@ -alias libxmlpp : : : : - <cflags>"`pkg-config --cflags libxml++-2.6`" - <linkflags>"`pkg-config --libs libxml++-2.6`" ; - +alias glibmm : : : : + <cflags>"`pkg-config --cflags glibmm-2.4`" + <linkflags>"`pkg-config --libs glibmm-2.4`" + ; explicit object sql-modODBC ; obj sql-modODBC : sql-modODBC.cpp : <library>../../libodbcpp//odbcpp - <library>libxmlpp + <library>glibmm <include>../../libmisc <include>../common : : @@ -17,7 +17,7 @@ explicit object sql-modPQ ; obj sql-modPQ : sql-modPQ.cpp : <library>../../libpqpp//pqpp - <library>libxmlpp + <library>glibmm <include>../../libmisc <include>../common : : @@ -27,7 +27,7 @@ obj sql-modPQ : cpp-pch pch : pch.hpp : <include>../../libmisc <include>../../libdbpp - <library>libxmlpp + <library>glibmm <library>../common//p2common ; lib p2sql : @@ -38,7 +38,7 @@ lib p2sql : : <odbc>yes:<library>sql-modODBC <pq>yes:<library>sql-modPQ - <library>libxmlpp + <library>glibmm <library>../common//p2common <include>../../libmisc ; diff --git a/project2/sql/pch.hpp b/project2/sql/pch.hpp index a212245..01c68d4 100644 --- a/project2/sql/pch.hpp +++ b/project2/sql/pch.hpp @@ -21,13 +21,13 @@ #include "sqlWriter.h" #include "variables.h" #include "xmlObjectLoader.h" +#include "scripts.h" #include <boost/bind.hpp> #include <boost/foreach.hpp> #include "options.h" #include <buffer.h> #include <column.h> #include <errno.h> -#include <libxml++/nodes/textnode.h> #include <stdexcept> #endif diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp index 20ccaec..4c6ae17 100644 --- a/project2/sql/rdbmsDataSource.cpp +++ b/project2/sql/rdbmsDataSource.cpp @@ -1,7 +1,6 @@ #include <pch.hpp> #include "rdbmsDataSource.h" #include "connectionLoader.h" -#include <libxml++/nodes/textnode.h> #include <sys/utsname.h> #include "logger.h" #include <errno.h> @@ -40,16 +39,13 @@ RdbmsDataSource::DBHosts RdbmsDataSource::dbhosts; RdbmsDataSource::FailedHosts RdbmsDataSource::failedhosts; RdbmsDataSource::DSNSet RdbmsDataSource::changedDSNs; -RdbmsDataSource::RdbmsDataSource(const xmlpp::Element * p) : +RdbmsDataSource::RdbmsDataSource(ScriptNodePtr p) : DataSource(p), - masterDsn(dynamic_cast<const xmlpp::Element *>(p->find("masterdsn").front())), - preferLocal(p->get_attribute_value("preferlocal") != "false") + masterDsn(p->child("masterdsn")), + preferLocal(p->value("preferlocal", true)) { - BOOST_FOREACH(const xmlpp::Node * node, p->find("readonly/dsn")) { - const xmlpp::Element * elem = dynamic_cast<const xmlpp::Element *>(node); - if (elem) { - roDSNs.insert(ReadonlyDSNs::value_type(elem->get_attribute_value("host"), elem)); - } + BOOST_FOREACH(ScriptNodePtr node, p->childrenIn("readonly")) { + roDSNs.insert(ReadonlyDSNs::value_type(node->value("host"), node)); } } @@ -194,12 +190,10 @@ RdbmsDataSource::RdbmsConnection::isExpired() const return (time(NULL) > lastUsedTime + keepAliveTime); } -RdbmsDataSource::ConnectionInfo::ConnectionInfo(const xmlpp::Element * n) +RdbmsDataSource::ConnectionInfo::ConnectionInfo(ScriptNodePtr node) { - BOOST_FOREACH(const xmlpp::Node * node, n->get_children()) { - typeId = LoaderBase::getLoader<ConnectionLoader, UnknownConnectionProvider>(node->get_name()); - dsn = dynamic_cast<const xmlpp::Element *>(node)->get_child_text()->get_content(); - } + typeId = LoaderBase::getLoader<ConnectionLoader, UnknownConnectionProvider>(node->value("provider")); + dsn = node->value("dsn").as<std::string>(); } DB::Connection * diff --git a/project2/sql/rdbmsDataSource.h b/project2/sql/rdbmsDataSource.h index 60206ff..bc72b05 100644 --- a/project2/sql/rdbmsDataSource.h +++ b/project2/sql/rdbmsDataSource.h @@ -1,7 +1,6 @@ #ifndef RDBMSDATASOURCE_H #define RDBMSDATASOURCE_H -#include <libxml/tree.h> #include <boost/shared_ptr.hpp> #include <map> #include <set> @@ -32,7 +31,7 @@ class RdbmsDataSource : public DataSource { class ConnectionInfo { public: - ConnectionInfo(const xmlpp::Element *); + ConnectionInfo(ScriptNodePtr); DB::Connection * connect() const; @@ -48,7 +47,7 @@ class RdbmsDataSource : public DataSource { typedef std::map<ConnectionInfo, ConnectionPtr> DBHosts; // Map DSN strings to connections typedef std::map<ConnectionInfo, const DB::ConnectionError> FailedHosts; // Map DSN strings to failures - RdbmsDataSource(const xmlpp::Element * p); + RdbmsDataSource(ScriptNodePtr p); ~RdbmsDataSource(); const DB::Connection & getReadonly() const; diff --git a/project2/sql/sqlCache.cpp b/project2/sql/sqlCache.cpp index d1ae930..7ed4ae1 100644 --- a/project2/sql/sqlCache.cpp +++ b/project2/sql/sqlCache.cpp @@ -21,7 +21,7 @@ typedef boost::shared_ptr<DB::ModifyCommand> ModifyPtr; class SqlCache : public Cache { public: - SqlCache(const xmlpp::Element * p) : + SqlCache(ScriptNodePtr p) : Cache(p) { } diff --git a/project2/sql/sqlCheck.cpp b/project2/sql/sqlCheck.cpp index d6e0651..879cbca 100644 --- a/project2/sql/sqlCheck.cpp +++ b/project2/sql/sqlCheck.cpp @@ -13,13 +13,13 @@ DECLARE_LOADER("sqlcheck", SqlCheck); class CantCompareNulls : public std::exception { }; -SqlCheck::SqlCheck(const xmlpp::Element * p) : +SqlCheck::SqlCheck(ScriptNodePtr p) : ParamChecker(p), dataSource(p, "datasource"), - filter(p, "filter", false, ""), - testOp(p, "testOp", false, "=="), + filter(p, "filter", ""), + testOp(p, "testOp", "=="), testValue(p, "testValue"), - sqlCommand(dynamic_cast<xmlpp::Element *>(p->get_children("sql").front())) + sqlCommand(p->child("sql")) { } diff --git a/project2/sql/sqlCheck.h b/project2/sql/sqlCheck.h index c9933d7..86492dc 100644 --- a/project2/sql/sqlCheck.h +++ b/project2/sql/sqlCheck.h @@ -10,7 +10,7 @@ class RdbmsDataSource; /// Project2 component to check the value of a variable against an RDBMS data source class SqlCheck : public ParamChecker { public: - SqlCheck(const xmlpp::Element * p); + SqlCheck(ScriptNodePtr p); virtual ~SqlCheck(); virtual void loadComplete(const CommonObjects *); @@ -22,7 +22,7 @@ class SqlCheck : public ParamChecker { const Variable testValue; private: - const DynamicSql::SqlCommand sqlCommand; + DynamicSql::SqlCommand sqlCommand; const RdbmsDataSource * db; }; diff --git a/project2/sql/sqlMergeTask.cpp b/project2/sql/sqlMergeTask.cpp index 96a895a..972b299 100644 --- a/project2/sql/sqlMergeTask.cpp +++ b/project2/sql/sqlMergeTask.cpp @@ -12,7 +12,6 @@ #include <boost/algorithm/string/join.hpp> #include <boost/foreach.hpp> #include <boost/bind.hpp> -#include <libxml++/nodes/textnode.h> bool SqlMergeTask::defaultUseTempTable = true; static void attach(boost::intrusive_ptr<IHaveSubTasks> i, DB::ModifyCommand * insert); @@ -22,7 +21,7 @@ typedef boost::intrusive_ptr<SqlMergeInsert> SqlMergeInsertPtr; /// Project2 component insert custom constructed records during an SQL Merge task class SqlMergeInsert : IHaveParameters, public Task { public: - SqlMergeInsert(const xmlpp::Element * p) : + SqlMergeInsert(ScriptNodePtr p) : SourceObject(p), IHaveParameters(p), Task(p) { @@ -43,51 +42,51 @@ DECLARE_LOADER("sqlmerge", SqlMergeTask); DECLARE_LOADER("sqlmergeinsert", SqlMergeInsert); // Conversion logic -SqlMergeTask::SqlMergeTask(const xmlpp::Element * p) : +SqlMergeTask::SqlMergeTask(ScriptNodePtr p) : SourceObject(p), Task(p), - updateWhere(p, "updatewhere", false), - patchOrder(p, "patchorder", false), - earlyKeys(p, "earlykeys", false, false), - useView(p, "useview", false, false), + updateWhere(p, "updatewhere", Null()), + patchOrder(p, "patchorder", Null()), + earlyKeys(p, "earlykeys", false), + useView(p, "useview", false), tempTableCreated(false), + sqlCommand(NULL), insCmd(NULL), destdb(NULL), dataSource(p, "datasource"), - dtable(p->get_attribute_value("targettable")), + dtable(p->value("targettable").as<std::string>()), dtablet(stringf("tmp_%s_%d", dtable.c_str(), getpid())) { - LoaderBase loader(true); - loader.supportedStorers.insert(Storer::into<ElementLoader>(&sources)); - loader.collectAll(p, true); + p->script->loader.addLoadTarget(p, Storer::into<ElementLoader>(&sources)); if (!sources.empty() && useView()) { throw NotSupported("useview not supported with iterate fillers"); } - BOOST_FOREACH(xmlpp::Node * psi, p->find("columns/column")) { - xmlpp::Element * e = static_cast<xmlpp::Element *>(psi); - TargetColumnPtr tcp(new TargetColumn(e->get_child_text()->get_content())); - tcp->maptable = e->get_attribute_value("maptable"); + BOOST_FOREACH(ScriptNodePtr e, p->childrenIn("columns")) { + TargetColumnPtr tcp(new TargetColumn(e->get_name())); + tcp->maptable = e->value("maptable", "").as<std::string>(); if (!tcp->maptable.empty()) { if (useView()) { throw NotSupported("useview not supported with mapped columns"); } - tcp->mapcolumn = e->get_attribute_value("mapcolumn"); + tcp->mapcolumn = e->value("mapcolumn").as<std::string>(); } cols.insert(tcp); + tcp->isKey = e->value("key", false); + if (tcp->isKey) { + keys.insert(tcp->column); + } } - BOOST_FOREACH(xmlpp::Node * psi, p->find("columns/column[@key='true']")) { - keys.insert(static_cast<xmlpp::Element *>(psi)->get_child_text()->get_content()); - } - BOOST_FOREACH(xmlpp::Node * psi, p->find("sql")) { - sqls.push_back(static_cast<xmlpp::Element *>(psi)->get_child_text()->get_content()); + if (p->valueExists("sql")) { + sqlCommand = new DynamicSql::SqlCommand(p->child("sql")); } } SqlMergeTask::~SqlMergeTask() { delete insCmd; + delete sqlCommand; } void @@ -143,7 +142,7 @@ SqlMergeTask::createTempTable() const DB::ModifyCommand * cv = destdb->newModifyCommand(stringf( "CREATE VIEW %s AS %s", dtablet.c_str(), - boost::algorithm::join(sqls, " UNION ").c_str())); + sqlCommand->getSqlFor("").c_str())); cv->execute(); delete cv; } @@ -280,11 +279,13 @@ attach(boost::intrusive_ptr<IHaveSubTasks> i, DB::ModifyCommand * insert) void SqlMergeTask::copyToTempTable() const { - if (useView()) return; + if (useView()) { + return; + } BOOST_FOREACH(const Sources::value_type & i, sources) { i->execute(); } - BOOST_FOREACH(const std::string & sql, sqls) { + if (sqlCommand) { Buffer ins; ins.appendf("INSERT INTO %s(", dtablet.c_str()); foreach(Columns::const_iterator, cols, c) { @@ -300,7 +301,7 @@ SqlMergeTask::copyToTempTable() const } ins.append((*c)->column); } - ins.appendf(" FROM (%s) tmp_src", sql.c_str()); + ins.appendf(" FROM (%s) tmp_src", sqlCommand->getSqlFor("").c_str()); DB::ModifyCommand * cttt = destdb->newModifyCommand(ins); cttt->execute(); delete cttt; diff --git a/project2/sql/sqlMergeTask.h b/project2/sql/sqlMergeTask.h index 41d1269..dc23936 100644 --- a/project2/sql/sqlMergeTask.h +++ b/project2/sql/sqlMergeTask.h @@ -32,13 +32,14 @@ class SqlMergeTask : public Task { Column column; Column mapcolumn; Table maptable; + bool isKey; }; typedef std::set<TargetColumnPtr, TargetColumn::Sort> Columns; typedef std::set<Column> Keys; - SqlMergeTask(const xmlpp::Element * p); + SqlMergeTask(ScriptNodePtr p); virtual ~SqlMergeTask(); virtual void loadComplete(const CommonObjects *); @@ -60,7 +61,7 @@ class SqlMergeTask : public Task { mutable bool tempTableCreated; typedef ANONSTORAGEOF(Iterate) Sources; Sources sources; - std::list<std::string> sqls; + DynamicSql::SqlCommand * sqlCommand; protected: DB::ModifyCommand * insertCommand() const; DB::ModifyCommand * insCmd; diff --git a/project2/sql/sqlRows.cpp b/project2/sql/sqlRows.cpp index ed2d71b..dbcc7be 100644 --- a/project2/sql/sqlRows.cpp +++ b/project2/sql/sqlRows.cpp @@ -2,7 +2,6 @@ #include "sqlRows.h" #include "sqlHandleAsVariableType.h" #include "rowProcessor.h" -#include "xml.h" #include "selectcommand.h" #include "rdbmsDataSource.h" #include "column.h" @@ -14,10 +13,10 @@ DECLARE_LOADER("sqlrows", SqlRows); -SqlRows::SqlRows(const xmlpp::Element * p) : +SqlRows::SqlRows(ScriptNodePtr p) : RowSet(p), dataSource(p, "datasource"), - sqlCommand(dynamic_cast<xmlpp::Element *>(p->get_children("sql").front())), + sqlCommand(p->child("sql")), db(NULL) { } diff --git a/project2/sql/sqlRows.h b/project2/sql/sqlRows.h index 5614fa1..7ed5d3f 100644 --- a/project2/sql/sqlRows.h +++ b/project2/sql/sqlRows.h @@ -1,7 +1,6 @@ #ifndef SQLROWS_H #define SQLROWS_H -#include <libxml++/nodes/element.h> #include <boost/intrusive_ptr.hpp> #include <map> #include "selectcommand.h" @@ -14,7 +13,7 @@ class RdbmsDataSource; /// Project2 component to create a row set based on an SQL SELECT statement issued against an RDBMS data source class SqlRows : public RowSet { public: - SqlRows(const xmlpp::Element * p); + SqlRows(ScriptNodePtr p); ~SqlRows(); void execute(const Glib::ustring &, const RowProcessor *) const; diff --git a/project2/sql/sqlTask.cpp b/project2/sql/sqlTask.cpp index 9f881de..6ff05af 100644 --- a/project2/sql/sqlTask.cpp +++ b/project2/sql/sqlTask.cpp @@ -17,27 +17,26 @@ class SqlIfChangesStorer : public StorerBase<NoOutputExecute, ANONORDEREDSTORAGE noChanges(nc) { } - bool insert(const xmlpp::Element * p, NoOutputExecutePtr O) { - xmlpp::Attribute * runon = p->get_attribute("runon"); - if (!runon) { + bool insert(ScriptNodePtr p, NoOutputExecutePtr O) { + try { + ((p->value("runon").as<std::string>() == "changes") ? changes : noChanges)->push_back(O); + return true; + } + catch (const ValueNotFound &) { throw RunOnNotSpecified(); } - ((runon->get_value() == "changes") ? changes : noChanges)->push_back(O); - return true; } Map changes, noChanges; }; -SqlTask::SqlTask(const xmlpp::Element * p) : +SqlTask::SqlTask(ScriptNodePtr p) : SourceObject(p), Task(p), dataSource(p, "datasource"), - filter(p, "filter", false, ""), - sqlCommand(dynamic_cast<xmlpp::Element *>(p->get_children("sql").front())) + filter(p, "filter", ""), + sqlCommand(p->child("sql")) { - LoaderBase loader(true); - loader.supportedStorers.insert(new SqlIfChangesStorer(&changesNOEs, &noChangesNOEs)); - loader.collectAll(p, true, IgnoreUnsupported); + p->script->loader.addLoadTarget(p, new SqlIfChangesStorer(&changesNOEs, &noChangesNOEs)); } SqlTask::~SqlTask() diff --git a/project2/sql/sqlTask.h b/project2/sql/sqlTask.h index 384b000..b0d0d27 100644 --- a/project2/sql/sqlTask.h +++ b/project2/sql/sqlTask.h @@ -1,7 +1,6 @@ #ifndef SQLTASK_H #define SQLTASK_H -#include <libxml++/nodes/element.h> #include <boost/intrusive_ptr.hpp> #include <map> #include "task.h" @@ -14,7 +13,7 @@ class RdbmsDataSource; /// Project2 component to execute a modifying SQL statement against an RDBMS data source class SqlTask : public Task { public: - SqlTask(const xmlpp::Element * p); + SqlTask(ScriptNodePtr p); virtual ~SqlTask(); virtual void loadComplete(const CommonObjects *); virtual void execute() const; diff --git a/project2/sql/sqlWriter.cpp b/project2/sql/sqlWriter.cpp index 90de82f..867e1bd 100644 --- a/project2/sql/sqlWriter.cpp +++ b/project2/sql/sqlWriter.cpp @@ -11,25 +11,33 @@ DynamicSql::SqlWriter::~SqlWriter() { } -DynamicSql::SqlCommand::SqlCommand(const xmlpp::Element * N) +template <typename Type, typename Cons> +static +void +appendNew(DynamicSql::Writers * w, const Cons & cons) { - BOOST_FOREACH(xmlpp::Node * n, N->get_children()) { - const xmlpp::TextNode * t = dynamic_cast<const xmlpp::TextNode *>(n); - if (t) { - writers.push_back(new SqlText(t)); - } - const xmlpp::Element * e = dynamic_cast<const xmlpp::Element *>(n); - if (e) { - if (e->get_name() == "filter") { - SqlFilterPtr f = new SqlFilter(e); - writers.push_back(f); - filters.insert(Filters::value_type(f->name, f)); - } - else if (e->get_name() == "param") { - writers.push_back(new SqlParameter(e)); - } - } + w->push_back(new Type(cons)); +} + +static +void +appendNewFromNode(DynamicSql::Writers * w, DynamicSql::SqlCommand::Filters * fs, ScriptNodePtr p) +{ + if (fs && p->get_name() == "filter") { + DynamicSql::SqlFilterPtr f = new DynamicSql::SqlFilter(p); + w->push_back(f); + fs->insert(DynamicSql::SqlCommand::Filters::value_type(f->name, f)); } + else if (p->get_name() == "param") { + w->push_back(new DynamicSql::SqlParameter(p)); + } +} + +DynamicSql::SqlCommand::SqlCommand(ScriptNodePtr s) +{ + s->composeWithCallbacks( + boost::bind(&appendNew<SqlText, Glib::ustring>, &writers, _1), + boost::bind(&appendNewFromNode, &writers, &filters, _1)); } Glib::ustring @@ -59,22 +67,13 @@ DynamicSql::SqlCommand::bindParams(DB::Command * cmd, unsigned int & offset) con } } -DynamicSql::SqlFilter::SqlFilter(const xmlpp::Element * N) : - name(N->get_attribute_value("name")), +DynamicSql::SqlFilter::SqlFilter(ScriptNodePtr p) : + name(p->value("name").as<Glib::ustring>()), active(false) { - BOOST_FOREACH(xmlpp::Node * n, N->get_children()) { - const xmlpp::TextNode * t = dynamic_cast<const xmlpp::TextNode *>(n); - if (t) { - writers.push_back(new SqlText(t)); - } - const xmlpp::Element * e = dynamic_cast<const xmlpp::Element *>(n); - if (e) { - if (e->get_name() == "param") { - writers.push_back(new SqlParameter(e)); - } - } - } + p->composeWithCallbacks( + boost::bind(&appendNew<SqlText, Glib::ustring>, &writers, _1), + boost::bind(&appendNewFromNode, &writers, (DynamicSql::SqlCommand::Filters *)NULL, _1)); } void @@ -97,7 +96,7 @@ DynamicSql::SqlFilter::bindParams(DB::Command * cmd, unsigned int & offset) cons } } -DynamicSql::SqlParameter::SqlParameter(const xmlpp::Element * n) : +DynamicSql::SqlParameter::SqlParameter(ScriptNodePtr n) : Variable(n, boost::optional<Glib::ustring>("local")) { } @@ -114,8 +113,8 @@ DynamicSql::SqlParameter::bindParams(DB::Command * cmd, unsigned int & offset) c boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(cmd, offset++), (*this)); } -DynamicSql::SqlText::SqlText(const xmlpp::TextNode * n) : - text(n->get_content()) +DynamicSql::SqlText::SqlText(const Glib::ustring & n) : + text(n) { } diff --git a/project2/sql/sqlWriter.h b/project2/sql/sqlWriter.h index 7693e19..4b57fa9 100644 --- a/project2/sql/sqlWriter.h +++ b/project2/sql/sqlWriter.h @@ -2,7 +2,6 @@ #define SQLWRITER_H #include <intrusivePtrBase.h> -#include <libxml++/nodes/textnode.h> #include <command.h> #include <glibmm/ustring.h> #include <list> @@ -22,7 +21,7 @@ namespace DynamicSql { }; class SqlText : public SqlWriter { public: - SqlText(const xmlpp::TextNode *); + SqlText(const Glib::ustring &); virtual void writeSql(Glib::ustring & sql) const; virtual void bindParams(DB::Command *, unsigned int & offset) const; @@ -30,13 +29,13 @@ namespace DynamicSql { }; class SqlParameter : public SqlWriter, Variable { public: - SqlParameter(const xmlpp::Element *); + SqlParameter(ScriptNodePtr); virtual void writeSql(Glib::ustring & sql) const; virtual void bindParams(DB::Command *, unsigned int & offset) const; }; class SqlFilter : public SqlWriter { public: - SqlFilter(const xmlpp::Element *); + SqlFilter(ScriptNodePtr); virtual void writeSql(Glib::ustring & sql) const; virtual void bindParams(DB::Command *, unsigned int & offset) const; @@ -48,7 +47,7 @@ namespace DynamicSql { typedef boost::intrusive_ptr<SqlFilter> SqlFilterPtr; class SqlCommand : public SqlWriter { public: - SqlCommand(const xmlpp::Element *); + SqlCommand(ScriptNodePtr); virtual void writeSql(Glib::ustring & sql) const; virtual void bindParams(DB::Command *, unsigned int & offset) const; typedef std::multimap<Glib::ustring, SqlFilterPtr> Filters; |