JULEA
jdb-entry.h
Go to the documentation of this file.
1 /*
2  * JULEA - Flexible storage framework
3  * Copyright (C) 2019 Benjamin Warnke
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
23 #ifndef JULEA_DB_ENTRY_H
24 #define JULEA_DB_ENTRY_H
25 
26 #if !defined(JULEA_DB_H) && !defined(JULEA_DB_COMPILATION)
27 #error "Only <julea-db.h> can be included directly."
28 #endif
29 
30 #include <glib.h>
31 
32 #include <julea.h>
33 
34 G_BEGIN_DECLS
35 
36 struct JDBEntry;
37 
38 typedef struct JDBEntry JDBEntry;
39 
40 G_END_DECLS
41 
42 #include <db/jdb-schema.h>
43 #include <db/jdb-selector.h>
44 
45 G_BEGIN_DECLS
46 
57 JDBEntry* j_db_entry_new(JDBSchema* schema, GError** error);
58 
68 
74 void j_db_entry_unref(JDBEntry* entry);
75 
76 G_DEFINE_AUTOPTR_CLEANUP_FUNC(JDBEntry, j_db_entry_unref)
77 
78 
88 gboolean j_db_entry_get_id(JDBEntry* entry, gpointer* value, guint64* length, GError** error);
89 
104 gboolean j_db_entry_set_field(JDBEntry* entry, gchar const* name, gconstpointer value, guint64 length, GError** error);
105 
121 gboolean j_db_entry_insert(JDBEntry* entry, JBatch* batch, GError** error);
122 
141 gboolean j_db_entry_update(JDBEntry* entry, JDBSelector* selector, JBatch* batch, GError** error);
142 
158 gboolean j_db_entry_delete(JDBEntry* entry, JDBSelector* selector, JBatch* batch, GError** error);
159 
160 G_END_DECLS
161 
162 #endif
void j_db_entry_unref(JDBEntry *entry)
Definition: jdb-entry.c:86
gboolean j_db_entry_insert(JDBEntry *entry, JBatch *batch, GError **error)
Definition: jdb-entry.c:174
gboolean j_db_entry_delete(JDBEntry *entry, JDBSelector *selector, JBatch *batch, GError **error)
Definition: jdb-entry.c:227
gboolean j_db_entry_set_field(JDBEntry *entry, gchar const *name, gconstpointer value, guint64 length, GError **error)
Definition: jdb-entry.c:102
G_END_DECLS G_BEGIN_DECLS JDBEntry * j_db_entry_new(JDBSchema *schema, GError **error)
Definition: jdb-entry.c:36
gboolean j_db_entry_update(JDBEntry *entry, JDBSelector *selector, JBatch *batch, GError **error)
Definition: jdb-entry.c:194
JDBEntry * j_db_entry_ref(JDBEntry *entry)
Definition: jdb-entry.c:74
gboolean j_db_entry_get_id(JDBEntry *entry, gpointer *value, guint64 *length, GError **error)
Definition: jdb-entry.c:249
Definition: jbatch.c:49
Definition: jdb-internal.h:46
JDBSchema * schema
Definition: jdb-internal.h:50
Definition: jdb-internal.h:78
Definition: jdb-internal.h:102