summaryrefslogtreecommitdiff
path: root/src/database/table.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-10-04 21:28:18 +0200
committerlouiz’ <louiz@louiz.org>2017-12-02 20:08:47 +0100
commit0168b96b79db2627fdba77a8712956408aa081d1 (patch)
tree5591527ed8a04be8ea04c49521d9e9c868677bd1 /src/database/table.cpp
parent5b27cee97272d4ae6ff30f03dc57221fa3e3183f (diff)
downloadbiboumi-0168b96b79db2627fdba77a8712956408aa081d1.tar.gz
biboumi-0168b96b79db2627fdba77a8712956408aa081d1.tar.bz2
biboumi-0168b96b79db2627fdba77a8712956408aa081d1.tar.xz
biboumi-0168b96b79db2627fdba77a8712956408aa081d1.zip
Add postgresql support
Diffstat (limited to 'src/database/table.cpp')
-rw-r--r--src/database/table.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/database/table.cpp b/src/database/table.cpp
deleted file mode 100644
index 9224d79..0000000
--- a/src/database/table.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <database/table.hpp>
-
-std::set<std::string> get_all_columns_from_table(sqlite3* db, const std::string& table_name)
-{
- std::set<std::string> result;
- char* errmsg;
- std::string query{"PRAGMA table_info(" + table_name + ")"};
- int res = sqlite3_exec(db, query.data(), [](void* param, int columns_nb, char** columns, char**) -> int {
- constexpr int name_column = 1;
- std::set<std::string>* result = static_cast<std::set<std::string>*>(param);
- if (name_column < columns_nb)
- result->insert(columns[name_column]);
- return 0;
- }, &result, &errmsg);
-
- if (res != SQLITE_OK)
- {
- log_error("Error executing ", query, ": ", errmsg);
- sqlite3_free(errmsg);
- }
-
- return result;
-}