summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/output/pq/updateDatabase.cpp4
-rw-r--r--lib/output/pq/updateDatabase.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/output/pq/updateDatabase.cpp b/lib/output/pq/updateDatabase.cpp
index f344f42..52388be 100644
--- a/lib/output/pq/updateDatabase.cpp
+++ b/lib/output/pq/updateDatabase.cpp
@@ -11,11 +11,13 @@
#include <output/pq/sql/insertSource.h>
#include <output/pq/sql/selectColumns.h>
#include <output/pq/sql/selectSource.h>
+#include <output/pq/sql/selectSourceSchema.h>
#include <output/pq/sql/selectTables.h>
#include <stdexcept>
namespace MyGrate::Output::Pq {
- UpdateDatabase::UpdateDatabase(const char * const str, uint64_t s) : PqConn {str}, source {s}
+ UpdateDatabase::UpdateDatabase(const char * const str, uint64_t s) :
+ PqConn {str}, source {s}, schema(**output::pq::sql::selectSourceSchema::execute(this, s))
{
auto trecs = output::pq::sql::selectTables::execute(this, source);
auto crecs = output::pq::sql::selectColumns::execute(this, source);
diff --git a/lib/output/pq/updateDatabase.h b/lib/output/pq/updateDatabase.h
index 8fa3b3c..3d3e80d 100644
--- a/lib/output/pq/updateDatabase.h
+++ b/lib/output/pq/updateDatabase.h
@@ -36,6 +36,7 @@ namespace MyGrate::Output::Pq {
const char * db, int sid, const char * sc);
const uint64_t source;
+ const std::string schema;
private:
std::map<std::string, TableDefPtr, std::less<>> tables;