GNUnet  0.11.x
Data Structures | Typedefs | Enumerations
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 78 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 35 of file gnunet_db_lib.h.

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