summaryrefslogtreecommitdiff
path: root/src/database/table.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-12-16 16:32:32 +0100
committerlouiz’ <louiz@louiz.org>2017-12-16 16:32:32 +0100
commit2c4016a4898a050c7f6ebd1843b265e209da1704 (patch)
treeb6c57d4fa446fe588cac6999c498dc1d7587dd9e /src/database/table.cpp
parentaaa9de8fe2c67b67310b7ba78c607bddbf4b25bf (diff)
parentb1f850b6395610c738a8e58abcdf2abfca3edd4e (diff)
downloadbiboumi-2c4016a4898a050c7f6ebd1843b265e209da1704.tar.gz
biboumi-2c4016a4898a050c7f6ebd1843b265e209da1704.tar.bz2
biboumi-2c4016a4898a050c7f6ebd1843b265e209da1704.tar.xz
biboumi-2c4016a4898a050c7f6ebd1843b265e209da1704.zip
Merge branch 'postgresql' into 'master'
Add postgresql support Closes #3237 See merge request louiz/biboumi!18
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;
-}