From d6c40826ba1762ece7fb674c330a5950935c39f3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 19 Jun 2021 21:22:33 +0100 Subject: Get the target schema name --- lib/output/pq/updateDatabase.cpp | 4 +++- lib/output/pq/updateDatabase.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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 #include #include +#include #include #include 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> tables; -- cgit v1.2.3