summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-11-23 21:16:33 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-11-23 21:16:33 +0000
commit4d03df7087ed6eff33014bf0c6e1b8435a4b6346 (patch)
tree35cabb09b8c873ef13e4d6b6840abb13d028068b
parentMove common code for database references into SqlBase (diff)
downloadproject2-4d03df7087ed6eff33014bf0c6e1b8435a4b6346.tar.bz2
project2-4d03df7087ed6eff33014bf0c6e1b8435a4b6346.tar.xz
project2-4d03df7087ed6eff33014bf0c6e1b8435a4b6346.zip
Allow SqlBase to be initialised with just a datasource name
-rw-r--r--project2/sql/sqlBase.cpp7
-rw-r--r--project2/sql/sqlBase.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/project2/sql/sqlBase.cpp b/project2/sql/sqlBase.cpp
index 608842c..dd1e90d 100644
--- a/project2/sql/sqlBase.cpp
+++ b/project2/sql/sqlBase.cpp
@@ -9,6 +9,13 @@ SqlBase::SqlBase(ScriptNodePtr p) :
{
}
+SqlBase::SqlBase(const std::string & datasource) :
+ SourceObject(ScriptNodePtr()),
+ dataSource(datasource),
+ db(NULL)
+{
+}
+
void
SqlBase::loadComplete(const CommonObjects * co)
{
diff --git a/project2/sql/sqlBase.h b/project2/sql/sqlBase.h
index 9266ae3..461589f 100644
--- a/project2/sql/sqlBase.h
+++ b/project2/sql/sqlBase.h
@@ -9,6 +9,7 @@ class RdbmsDataSource;
class SqlBase : public virtual SourceObject {
public:
SqlBase(ScriptNodePtr);
+ SqlBase(const std::string &);
virtual void loadComplete(const CommonObjects *) override;