JULEA
jdb-selector.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_SELECTOR_H
24 #define JULEA_DB_SELECTOR_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 G_BEGIN_DECLS
33 
35 {
38 };
39 
40 typedef enum JDBSelectorMode JDBSelectorMode;
41 
43 {
44  // <
46  // <=
48  // >
50  // >=
52  // =
54  // !=
56 };
57 
59 
60 struct JDBSelector;
61 
62 typedef struct JDBSelector JDBSelector;
63 
64 G_END_DECLS
65 
66 #include <db/jdb-schema.h>
67 #include <db/jdb-type.h>
68 
69 G_BEGIN_DECLS
70 
83 
93 
99 void j_db_selector_unref(JDBSelector* selector);
100 
101 G_DEFINE_AUTOPTR_CLEANUP_FUNC(JDBSelector, j_db_selector_unref)
102 
103 
122 gboolean j_db_selector_add_field(JDBSelector* selector, gchar const* name, JDBSelectorOperator operator_, gconstpointer value, guint64 length, GError** error);
123 
141 gboolean j_db_selector_add_selector(JDBSelector* selector, JDBSelector* sub_selector, GError** error);
142 
162 gboolean j_db_selector_add_join(JDBSelector* selector, gchar const* selector_field, JDBSelector* sub_selector, gchar const* sub_selector_field, GError** error);
163 
164 G_END_DECLS
165 
166 #endif
G_END_DECLS G_BEGIN_DECLS JDBSelector * j_db_selector_new(JDBSchema *schema, JDBSelectorMode mode, GError **error)
Definition: jdb-selector.c:36
gboolean j_db_selector_add_selector(JDBSelector *selector, JDBSelector *sub_selector, GError **error)
Add a second selector as sub selector.
Definition: jdb-selector.c:276
JDBSelectorMode
Definition: jdb-selector.h:35
@ J_DB_SELECTOR_MODE_OR
Definition: jdb-selector.h:37
@ J_DB_SELECTOR_MODE_AND
Definition: jdb-selector.h:36
JDBSelectorOperator
Definition: jdb-selector.h:43
@ J_DB_SELECTOR_OPERATOR_LE
Definition: jdb-selector.h:47
@ J_DB_SELECTOR_OPERATOR_GT
Definition: jdb-selector.h:49
@ J_DB_SELECTOR_OPERATOR_NE
Definition: jdb-selector.h:55
@ J_DB_SELECTOR_OPERATOR_LT
Definition: jdb-selector.h:45
@ J_DB_SELECTOR_OPERATOR_GE
Definition: jdb-selector.h:51
@ J_DB_SELECTOR_OPERATOR_EQ
Definition: jdb-selector.h:53
gboolean j_db_selector_add_field(JDBSelector *selector, gchar const *name, JDBSelectorOperator operator_, gconstpointer value, guint64 length, GError **error)
Definition: jdb-selector.c:108
JDBSelector * j_db_selector_ref(JDBSelector *selector)
Definition: jdb-selector.c:75
gboolean j_db_selector_add_join(JDBSelector *selector, gchar const *selector_field, JDBSelector *sub_selector, gchar const *sub_selector_field, GError **error)
Definition: jdb-selector.c:308
void j_db_selector_unref(JDBSelector *selector)
Definition: jdb-selector.c:87
Definition: jdb-internal.h:78
Definition: jdb-internal.h:102
JDBSelectorMode mode
TRUE iff final got built and the selector was not modified.
Definition: jdb-internal.h:115
JDBSchema * schema
Definition: jdb-internal.h:116