From b58f59e5af68d97683911f291252c5e93993b2e2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 19 Jul 2021 20:13:21 +0100 Subject: Rename TableDef to TableOutput Will store things like the prepared statements as they're needed. --- lib/output/pq/updateDatabase.cpp | 6 +++--- lib/output/pq/updateDatabase.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/output/pq') diff --git a/lib/output/pq/updateDatabase.cpp b/lib/output/pq/updateDatabase.cpp index 1dab95e..55ef561 100644 --- a/lib/output/pq/updateDatabase.cpp +++ b/lib/output/pq/updateDatabase.cpp @@ -31,7 +31,7 @@ namespace MyGrate::Output::Pq { auto trecs = output::pq::sql::selectTables::execute(this, source); auto crecs = output::pq::sql::selectColumns::execute(this, source); for (auto t {0U}; t < trecs->rows(); t++) { - tables.emplace(trecs->at(t, 0), std::make_unique(*crecs, trecs->at(t, 0))); + tables.emplace(trecs->at(t, 0), std::make_unique(*crecs, trecs->at(t, 0))); } } @@ -43,7 +43,7 @@ namespace MyGrate::Output::Pq { return (*srcrec)[0].create(); } - TableDef::TableDef(const RecordSet & crecs, std::string_view name) + TableOutput::TableOutput(const RecordSet & crecs, std::string_view name) { for (auto c {0U}; c < crecs.rows(); c++) { if (crecs.at(c, 0) == name) { @@ -71,7 +71,7 @@ namespace MyGrate::Output::Pq { { auto cols = input::sql::selectColumns::execute(conn, tableName); verify(cols->rows() > 0, "Table has no rows"); - auto tableDef {std::make_unique()}; + auto tableDef {std::make_unique()}; Tx {this}([&] { const auto table_id = **output::pq::sql::insertTable::execute(this, tableName, source); std::stringstream ct; diff --git a/lib/output/pq/updateDatabase.h b/lib/output/pq/updateDatabase.h index 20ea96a..0355a47 100644 --- a/lib/output/pq/updateDatabase.h +++ b/lib/output/pq/updateDatabase.h @@ -19,14 +19,14 @@ namespace MyGrate::Output::Pq { }; using ColumnDefPtr = std::unique_ptr; - class TableDef { + class TableOutput { public: - TableDef() = default; - TableDef(const RecordSet &, std::string_view name); + TableOutput() = default; + TableOutput(const RecordSet &, std::string_view name); std::vector columns; }; - using TableDefPtr = std::unique_ptr; + using TableDefPtr = std::unique_ptr; class ConfigError : public std::runtime_error { using std::runtime_error::runtime_error; -- cgit v1.2.3