summaryrefslogtreecommitdiff
path: root/src/analysis/db/item-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/db/item-int.h')
-rw-r--r--src/analysis/db/item-int.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/analysis/db/item-int.h b/src/analysis/db/item-int.h
index 0f75ed4..7b99f4a 100644
--- a/src/analysis/db/item-int.h
+++ b/src/analysis/db/item-int.h
@@ -31,9 +31,7 @@
#include <stdint.h>
-
-
-
+#include "misc/rlestr.h"
@@ -44,7 +42,10 @@ typedef bool (* recv_db_item_fc) (GDbItem *, int, int);
typedef bool (* send_db_item_fc) (const GDbItem *, int, int);
/* Constitue les champs destinés à une insertion / modification. */
-typedef bool (* prepare_db_statement) (const GDbItem *, bool, bound_value **, size_t *);
+typedef bool (* prepare_db_statement) (const GDbItem *, bound_value **, size_t *);
+
+/* Charge les valeurs utiles pour une localisation. */
+typedef bool (* load_db_item_fc) (GDbItem *, const bound_value *, size_t);
/* Base d'un élément pour collection générique (instance) */
@@ -55,6 +56,11 @@ struct _GDbItem
uint64_t created; /* Date de création */
uint64_t modified; /* Date de modification */
+ rle_string author; /* Utilisateur d'origine */
+ rle_string tool; /* Eventuel outil automatique ?*/
+
+ rle_string label; /* Représentation humaine */
+
bool is_volatile; /* Pas besoin de sauvegarde ? */
};
@@ -70,9 +76,19 @@ struct _GDbItemClass
send_db_item_fc send; /* Emission depuis le réseau */
prepare_db_statement prepare_stmt; /* Préparation d'une requête */
+ load_db_item_fc load; /* Chargement à partir d'une BD*/
};
+/* Définition du tronc commun pour les créations SQLite */
+#define SQLITE_DB_ITEM_CREATE \
+ "created INTEGER, " \
+ "modified INTEGER, " \
+ SQLITE_RLESTR_CREATE("author") ", " \
+ SQLITE_RLESTR_CREATE("tool") ", " \
+ SQLITE_RLESTR_CREATE("label")
+
+
#endif /* _ANALYSIS_DB_ITEM_INT_H */