summaryrefslogtreecommitdiffstats
path: root/database/sqlite/sqlite_functions.h
diff options
context:
space:
mode:
Diffstat (limited to 'database/sqlite/sqlite_functions.h')
-rw-r--r--database/sqlite/sqlite_functions.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/database/sqlite/sqlite_functions.h b/database/sqlite/sqlite_functions.h
index 407ed1eff..9cd1f7ad4 100644
--- a/database/sqlite/sqlite_functions.h
+++ b/database/sqlite/sqlite_functions.h
@@ -6,6 +6,8 @@
#include "daemon/common.h"
#include "sqlite3.h"
+void analytics_set_data_str(char **name, const char *value);
+
// return a node list
struct node_instance_list {
uuid_t node_id;
@@ -17,11 +19,10 @@ struct node_instance_list {
};
typedef enum db_check_action_type {
- DB_CHECK_NONE = 0x0000,
- DB_CHECK_INTEGRITY = 0x0001,
- DB_CHECK_FIX_DB = 0x0002,
- DB_CHECK_RECLAIM_SPACE = 0x0004,
- DB_CHECK_CONT = 0x00008
+ DB_CHECK_NONE = (1 << 0),
+ DB_CHECK_RECLAIM_SPACE = (1 << 1),
+ DB_CHECK_CONT = (1 << 2),
+ DB_CHECK_RECOVER = (1 << 3),
} db_check_action_type_t;
#define SQL_MAX_RETRY (100)
@@ -46,9 +47,10 @@ SQLITE_API int sqlite3_exec_monitored(
);
// Initialization and shutdown
-int init_database_batch(sqlite3 *database, int rebuild, int init_type, const char *batch[]);
+int init_database_batch(sqlite3 *database, const char *batch[]);
int sql_init_database(db_check_action_type_t rebuild, int memory);
void sql_close_database(void);
+int configure_sqlite_database(sqlite3 *database, int target_version);
// Helpers
int bind_text_null(sqlite3_stmt *res, int position, const char *text, bool can_be_null);
@@ -60,14 +62,12 @@ void initialize_thread_key_pool(void);
// Look up functions
int get_node_id(uuid_t *host_id, uuid_t *node_id);
-int get_host_id(uuid_t *node_id, uuid_t *host_id);
struct node_instance_list *get_node_list(void);
void sql_load_node_id(RRDHOST *host);
-char *get_hostname_by_node_id(char *node_id);
// Help build archived hosts in memory when agent starts
void sql_build_host_system_info(uuid_t *host_id, struct rrdhost_system_info *system_info);
-DICTIONARY *sql_load_host_labels(uuid_t *host_id);
+RRDLABELS *sql_load_host_labels(uuid_t *host_id);
// TODO: move to metadata
int update_node_id(uuid_t *host_id, uuid_t *node_id);