#include <glib.h>
#include <db/jdb-schema.h>
#include <db/jdb-selector.h>
Go to the source code of this file.
◆ JDBIterator
◆ j_db_iterator_get_field()
gboolean j_db_iterator_get_field |
( |
JDBIterator * |
iterator, |
|
|
JDBSchema * |
schema, |
|
|
gchar const * |
name, |
|
|
JDBType * |
type, |
|
|
gpointer * |
value, |
|
|
guint64 * |
length, |
|
|
GError ** |
error |
|
) |
| |
Get a single value from the current entry of the iterator.
- Parameters
-
[in] | iterator | The iterator to query. |
[in] | schema | The schema the field belongs to. If the field is in the primary schema (especially if no joins are used) NULL may be passed. |
[in] | name | The name of the value to retrieve. |
[out] | type | The type of the retrieved value. |
[out] | value | The retieved value. |
[out] | length | The length of the retrieved value. |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
- Precondition
- iterator != NULL
-
name != NULL
-
type != NULL
-
value != NULL
-
*value should not be initialized
-
length != NULL
- Postcondition
- *value points to a new allocated memory region. The caller must free this later using g_free.
-
*length contains the length of the allocated memory region
- Returns
- TRUE on success, FALSE otherwise
◆ j_db_iterator_new()
Allocates a new iterator.
- Parameters
-
[in] | schema | The primary schema of the iterator. |
[in] | selector | The selector to use. |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
- Precondition
- schema != NULL
-
selector != NULL
- Returns
- the new iterator or NULL on failure
◆ j_db_iterator_next()
gboolean j_db_iterator_next |
( |
JDBIterator * |
iterator, |
|
|
GError ** |
error |
|
) |
| |
The iterator moves to the next element.
- Parameters
-
[in,out] | iterator | to update |
[out] | error | A GError pointer. Will point to a GError object in case of failure. |
- Precondition
- iterator != NULL
- Returns
- TRUE on success, FALSE otherwise
◆ j_db_iterator_ref()
Increase the ref_count of the given iterator.
- Parameters
-
[in] | iterator | the iterator to increase the ref_count |
- Precondition
- iterator != NULL
- Returns
- the iterator or NULL on failure
◆ j_db_iterator_unref()
Decrease the ref_count of the given iterator - and automatically call free if ref_count is 0. This is a noop if iterator == NULL.
- Parameters
-
[in] | iterator | the iterator to decrease the ref_count |