Code

store, plugin: Let the plugin module determine an objects backends.
[sysdb.git] / src / include / utils / dbi.h
index 77d004296d333acaefc7460677a246765e182423..af2c8a44ecb1da78acc6ed8de7581e1445da0c2e 100644 (file)
 #define SDB_UTILS_DBI_H 1
 
 #include "core/object.h"
-#include "utils/data.h"
+#include "core/data.h"
 
 #include <stddef.h>
 
 /* translate libdbi types to SysDB types */
-#define DBI_TYPE_TO_SC(dt) \
+#define DBI_TYPE_TO_SDB(dt) \
        (((dt) == DBI_TYPE_INTEGER) \
                ? SDB_TYPE_INTEGER \
                : ((dt) == DBI_TYPE_DECIMAL) \
@@ -113,6 +113,17 @@ sdb_dbi_client_set_options(sdb_dbi_client_t *client,
 int
 sdb_dbi_client_connect(sdb_dbi_client_t *client);
 
+/*
+ * sdb_dbi_client_check_conn:
+ * Check the database-connection and try to reconnect if that fails.
+ *
+ * Returns:
+ *  - 0 on success (the connection is connected after the call)
+ *  - a negative value else (failed to reconnect)
+ */
+int
+sdb_dbi_client_check_conn(sdb_dbi_client_t *client);
+
 /*
  * sdb_dbi_exec_query:
  * Execute an SQL query on the database. The specified 'callback' will be