helper functions for Sqlite3 DB interactions More...
Go to the source code of this file.
Functions | |
| enum GNUNET_GenericReturnValue | GNUNET_SQ_bind (sqlite3_stmt *stmt, const struct GNUNET_SQ_QueryParam *params) |
| Execute binding operations for a prepared statement. | |
| enum GNUNET_GenericReturnValue | GNUNET_SQ_extract_result (sqlite3_stmt *result, struct GNUNET_SQ_ResultSpec *rs) |
| Extract results from a query result according to the given specification. | |
| void | GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs) |
| Free all memory that was allocated in rs during GNUNET_SQ_extract_result(). | |
| void | GNUNET_SQ_reset (sqlite3 *dbh, sqlite3_stmt *stmt) |
| Reset stmt and log error. | |
helper functions for Sqlite3 DB interactions
Definition in file sq.c.
| enum GNUNET_GenericReturnValue GNUNET_SQ_bind | ( | sqlite3_stmt * | stmt, |
| const struct GNUNET_SQ_QueryParam * | params | ||
| ) |
Execute binding operations for a prepared statement.
| db_conn | database connection |
| params | parameters to the statement |
Definition at line 30 of file sq.c.
References _, conv, GNUNET_SQ_QueryParam::conv, data, GNUNET_assert, GNUNET_ERROR_TYPE_WARNING, GNUNET_log_from, GNUNET_OK, GNUNET_SYSERR, GNUNET_SQ_QueryParam::num_params, and size.
Referenced by delete_by_rowid(), get_any(), get_typed(), lookup_records(), namecache_sqlite_cache_block(), namecache_sqlite_expire_blocks(), namecache_sqlite_lookup_block(), namestore_sqlite_editor_hint_clear(), namestore_sqlite_iterate_records(), namestore_sqlite_store_records(), namestore_sqlite_zone_to_name(), peerstore_sqlite_delete_records(), peerstore_sqlite_expire_records(), peerstore_sqlite_iterate_records(), peerstore_sqlite_store_record(), sqlite_plugin_del(), sqlite_plugin_get_closest(), sqlite_plugin_get_expiration(), sqlite_plugin_get_key(), sqlite_plugin_get_replication(), sqlite_plugin_get_zero_anonymity(), sqlite_plugin_put(), sqlite_plugin_put(), and sqlite_plugin_remove_key().
| enum GNUNET_GenericReturnValue GNUNET_SQ_extract_result | ( | sqlite3_stmt * | result, |
| struct GNUNET_SQ_ResultSpec * | rs | ||
| ) |
Extract results from a query result according to the given specification.
| result | result to process | |
| [in,out] | rs | result specification to extract for |
Definition at line 75 of file sq.c.
References GNUNET_SQ_ResultSpec::cleaner, conv, GNUNET_SQ_ResultSpec::conv, GNUNET_SQ_ResultSpec::dst_size, GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, GNUNET_SQ_ResultSpec::num_params, result, and GNUNET_SQ_ResultSpec::result_size.
Referenced by execute_get(), get_any(), get_records_and_call_iterator(), get_typed(), namecache_sqlite_lookup_block(), peerstore_sqlite_iterate_records(), sqlite_plugin_del(), sqlite_plugin_get_closest(), and sqlite_plugin_get_keys().
| void GNUNET_SQ_cleanup_result | ( | struct GNUNET_SQ_ResultSpec * | rs | ) |
Free all memory that was allocated in rs during GNUNET_SQ_extract_result().
| rs | result specification to clean up |
Definition at line 104 of file sq.c.
References GNUNET_SQ_ResultSpec::cleaner, and GNUNET_SQ_ResultSpec::conv.
Referenced by execute_get(), get_any(), get_records_and_call_iterator(), get_typed(), namecache_sqlite_lookup_block(), peerstore_sqlite_iterate_records(), sqlite_plugin_del(), and sqlite_plugin_get_closest().
| void GNUNET_SQ_reset | ( | sqlite3 * | dbh, |
| sqlite3_stmt * | stmt | ||
| ) |
Reset stmt and log error.
| dbh | database handle |
| stmt | statement to reset |
Definition at line 119 of file sq.c.
References _, GNUNET_ERROR_TYPE_BULK, GNUNET_ERROR_TYPE_ERROR, and GNUNET_log_from.
Referenced by delete_by_rowid(), execute_get(), get_any(), get_records_and_call_iterator(), get_typed(), lookup_records(), namecache_sqlite_cache_block(), namecache_sqlite_expire_blocks(), namecache_sqlite_lookup_block(), namestore_sqlite_editor_hint_clear(), namestore_sqlite_iterate_records(), namestore_sqlite_store_records(), namestore_sqlite_zone_to_name(), peerstore_sqlite_delete_records(), peerstore_sqlite_expire_records(), peerstore_sqlite_iterate_records(), peerstore_sqlite_store_record(), sqlite_plugin_del(), sqlite_plugin_get_closest(), sqlite_plugin_get_replication(), sqlite_plugin_put(), sqlite_plugin_put(), and sqlite_plugin_remove_key().