From 362943fe3a88dfc1d30319347f4ab9dbdafa8fb3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 19 Sep 2016 21:14:13 +0100 Subject: Remove unused util functions --- gentoobrowse-api/service/utils/dbUtils.cpp | 33 ------------------------------ gentoobrowse-api/service/utils/dbUtils.h | 3 --- 2 files changed, 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 @@ -21,17 +21,6 @@ namespace Gentoo { return false; } - void - bindOptionalS(DB::Command * db, unsigned int c, const IceUtil::Optional & v) - { - if (v) { - db->bindParamS(c, *v); - } - else { - db->bindNull(c); - } - } - void bindOptionalS(DB::Command * db, unsigned int c, const char * v) { @@ -43,22 +32,6 @@ namespace Gentoo { } } - std::atomic tempTableNumber; - std::string - tempTableName() - { - return stringbf("_tmpTable_%x", tempTableNumber++); - } - - std::string - createTempWith(DB::Connection * db, const std::string & sql, const std::set & 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) { @@ -72,12 +45,6 @@ namespace Gentoo { return tempTable; } - std::pair - customTemp(DB::Connection * db, const std::map & cols) - { - return namedTemp(db, "tmp_" + boost::lexical_cast(db), cols); - } - std::pair namedTemp(DB::Connection * db, const std::string & tempTable, const std::map & cols) { 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 > & vs); - void bindOptionalS(DB::Command * db, unsigned int c, const IceUtil::Optional & v); void bindOptionalS(DB::Command * db, unsigned int c, const char * v); - std::string createTempWith(DB::Connection *, const std::string &, const std::set & keys = std::set()); std::string emptyClone(DB::Connection *, const std::string &); - std::pair customTemp(DB::Connection *, const std::map & cols); std::pair namedTemp(DB::Connection *, const std::string &, const std::map & cols); void drop(DB::Connection *, const std::string &); DB::ModifyCommandPtr tablePatchInserter(DB::Connection *, const DB::TablePatch &); -- cgit v1.2.3