diff options
-rw-r--r-- | gentoobrowse-api/service/utils/dbUtils.cpp | 33 | ||||
-rw-r--r-- | gentoobrowse-api/service/utils/dbUtils.h | 3 |
2 files changed, 0 insertions, 36 deletions
diff --git a/gentoobrowse-api/service/utils/dbUtils.cpp b/gentoobrowse-api/service/utils/dbUtils.cpp index 8f3ebf2..1d915d5 100644 --- a/gentoobrowse-api/service/utils/dbUtils.cpp +++ b/gentoobrowse-api/service/utils/dbUtils.cpp @@ -22,17 +22,6 @@ namespace Gentoo { } void - bindOptionalS(DB::Command * db, unsigned int c, const IceUtil::Optional<std::string> & v) - { - if (v) { - db->bindParamS(c, *v); - } - else { - db->bindNull(c); - } - } - - void bindOptionalS(DB::Command * db, unsigned int c, const char * v) { if (v) { @@ -43,22 +32,6 @@ namespace Gentoo { } } - std::atomic<uint16_t> tempTableNumber; - std::string - tempTableName() - { - return stringbf("_tmpTable_%x", tempTableNumber++); - } - - std::string - createTempWith(DB::Connection * db, const std::string & sql, const std::set<std::string> & keys) - { - auto tempTable = tempTableName(); - db->execute("CREATE TEMPORARY TABLE " + tempTable + " AS " + sql); - db->execute("ALTER TABLE " + tempTable + " ADD CONSTRAINT pk" + tempTable + " PRIMARY KEY (" + boost::algorithm::join(keys, ",") + ")"); - return tempTable; - } - std::string emptyClone(DB::Connection * db, const std::string & orig) { @@ -73,12 +46,6 @@ namespace Gentoo { } std::pair<std::string, DB::ModifyCommandPtr> - customTemp(DB::Connection * db, const std::map<std::string, const std::string> & cols) - { - return namedTemp(db, "tmp_" + boost::lexical_cast<std::string>(db), cols); - } - - std::pair<std::string, DB::ModifyCommandPtr> namedTemp(DB::Connection * db, const std::string & tempTable, const std::map<std::string, const std::string> & cols) { std::set<std::string> keys; diff --git a/gentoobrowse-api/service/utils/dbUtils.h b/gentoobrowse-api/service/utils/dbUtils.h index bce7f38..03d468e 100644 --- a/gentoobrowse-api/service/utils/dbUtils.h +++ b/gentoobrowse-api/service/utils/dbUtils.h @@ -11,12 +11,9 @@ namespace Gentoo { namespace Utils { namespace Database { bool bindOptionalsS(DB::Command * db, unsigned int c, const std::vector<boost::optional<Glib::ustring> > & vs); - void bindOptionalS(DB::Command * db, unsigned int c, const IceUtil::Optional<std::string> & v); void bindOptionalS(DB::Command * db, unsigned int c, const char * v); - std::string createTempWith(DB::Connection *, const std::string &, const std::set<std::string> & keys = std::set<std::string>()); std::string emptyClone(DB::Connection *, const std::string &); - std::pair<std::string, DB::ModifyCommandPtr> customTemp(DB::Connection *, const std::map<std::string, const std::string> & cols); std::pair<std::string, DB::ModifyCommandPtr> namedTemp(DB::Connection *, const std::string &, const std::map<std::string, const std::string> & cols); void drop(DB::Connection *, const std::string &); DB::ModifyCommandPtr tablePatchInserter(DB::Connection *, const DB::TablePatch &); |