GNUnet 0.21.0
gnunet_db_lib.h File Reference

shared definitions for transactional databases More...

#include "gnunet_common.h"
Include dependency graph for gnunet_db_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_DB_EventHeaderP
 Header of a structure that describes an event channel we may subscribe to or notify on. More...
 

Typedefs

typedef void(* GNUNET_DB_EventCallback) (void *cls, const void *extra, size_t extra_size)
 Function called on events received from Postgres. More...
 

Enumerations

enum  GNUNET_DB_QueryStatus { GNUNET_DB_STATUS_HARD_ERROR = -2 , GNUNET_DB_STATUS_SOFT_ERROR = -1 , GNUNET_DB_STATUS_SUCCESS_NO_RESULTS = 0 , GNUNET_DB_STATUS_SUCCESS_ONE_RESULT = 1 }
 Status code returned from functions running database commands. More...
 

Detailed Description

shared definitions for transactional databases

Author
Christian Grothoff

Definition in file gnunet_db_lib.h.

Typedef Documentation

◆ GNUNET_DB_EventCallback

typedef void(* GNUNET_DB_EventCallback) (void *cls, const void *extra, size_t extra_size)

Function called on events received from Postgres.

Parameters
clsclosure
extraadditional event data provided
extra_sizenumber of bytes in extra

Definition at line 79 of file gnunet_db_lib.h.

Enumeration Type Documentation

◆ GNUNET_DB_QueryStatus

Status code returned from functions running database commands.

Can be combined with a function that returns the number of results, so all non-negative values indicate success.

Enumerator
GNUNET_DB_STATUS_HARD_ERROR 

A hard error occurred, retrying will not help.

GNUNET_DB_STATUS_SOFT_ERROR 

A soft error occurred, retrying the transaction may succeed.

Includes DEADLOCKS and SERIALIZATION errors.

GNUNET_DB_STATUS_SUCCESS_NO_RESULTS 

The transaction succeeded, but yielded zero results.

May include the case where an INSERT failed with UNIQUE violation (i.e. row already exists) or where DELETE failed to remove anything (i.e. nothing matched).

GNUNET_DB_STATUS_SUCCESS_ONE_RESULT 

The transaction succeeded, and yielded one result.

Definition at line 36 of file gnunet_db_lib.h.

37{
42
48
56
61
62 /* Larger values may be returned for SELECT statements
63 that returned more than one result. */
64};
@ GNUNET_DB_STATUS_SUCCESS_ONE_RESULT
The transaction succeeded, and yielded one result.
Definition: gnunet_db_lib.h:60
@ GNUNET_DB_STATUS_HARD_ERROR
A hard error occurred, retrying will not help.
Definition: gnunet_db_lib.h:41
@ GNUNET_DB_STATUS_SUCCESS_NO_RESULTS
The transaction succeeded, but yielded zero results.
Definition: gnunet_db_lib.h:55
@ GNUNET_DB_STATUS_SOFT_ERROR
A soft error occurred, retrying the transaction may succeed.
Definition: gnunet_db_lib.h:47