JULEA
|
#include <julea-config.h>
#include <glib.h>
#include <string.h>
#include <bson.h>
#include <julea.h>
#include <db/jdb-internal.h>
#include <julea-db.h>
Functions | |
JDBSelector * | j_db_selector_new (JDBSchema *schema, JDBSelectorMode mode, GError **error) |
JDBSelector * | j_db_selector_ref (JDBSelector *selector) |
void | j_db_selector_unref (JDBSelector *selector) |
gboolean | j_db_selector_add_field (JDBSelector *selector, gchar const *name, JDBSelectorOperator operator_, gconstpointer value, guint64 length, GError **error) |
gboolean | j_db_selector_add_selector (JDBSelector *selector, JDBSelector *sub_selector, GError **error) |
Add a second selector as sub selector. More... | |
gboolean | j_db_selector_add_join (JDBSelector *selector, gchar const *selector_field, JDBSelector *sub_selector, gchar const *sub_selector_field, GError **error) |
gboolean j_db_selector_add_field | ( | JDBSelector * | selector, |
gchar const * | name, | ||
JDBSelectorOperator | operator_, | ||
gconstpointer | value, | ||
guint64 | length, | ||
GError ** | error | ||
) |
add a search field to the selector.
[in] | selector | to add a search field to |
[in] | name | the name of the field to compare |
[in] | operator_ | the operator to use to compare the stored value with the given value |
[in] | value | the value to compare with |
[in] | length | the length of the value. Only used if value is binary |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
gboolean j_db_selector_add_join | ( | JDBSelector * | selector, |
gchar const * | selector_field, | ||
JDBSelector * | sub_selector, | ||
gchar const * | sub_selector_field, | ||
GError ** | error | ||
) |
Add a JOIN to the primary selector using the schema from the sub selector.
This function will join both schemas using the given fields and also copy previous add_join and add_selector data from the secondary selector to the primary selector. The given selectors must represent different primary schemas in the same namepsace.
[in] | selector | Primary selector. |
[in] | selector_field | Name of a field in the primary schema of the selector. |
[in] | sub_selector | The second selector to be used in the join. |
[in] | sub_selector_field | Name of a field in the primary schema of the sub_selector. |
gboolean j_db_selector_add_selector | ( | JDBSelector * | selector, |
JDBSelector * | sub_selector, | ||
GError ** | error | ||
) |
Add a second selector as sub selector.
Using this function it is possible to build nested expressions (e.g. "A and B and (C or D)" where "C or D" is given by a sub selector). The namespace and schema of both selectors must be the same.
[in] | selector | primary selector |
[in] | sub_selector | sub selector |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
JDBSelector* j_db_selector_new | ( | JDBSchema * | schema, |
JDBSelectorMode | mode, | ||
GError ** | error | ||
) |
Allocates a new selector.
[in] | schema | The schema defines the structure of the selector |
[in] | mode | the more of the selector |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
JDBSelector* j_db_selector_ref | ( | JDBSelector * | selector | ) |
Increase the ref_count of the given selector.
[in] | selector | the selector to increase the ref_count |
void j_db_selector_unref | ( | JDBSelector * | selector | ) |
Decrease the ref_count of the given selector - and automatically call free if ref_count is 0. This is a noop if selector == NULL.
[in] | selector | the selector to decrease the ref_count |