2 This file is part of GNUnet
3 Copyright (C) 2017 GNUnet e.V.
5 GNUnet is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3, or (at your option) any later version.
9 GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License along with
14 GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
17 * @file include/gnunet_db_lib.h
18 * @brief shared defintions for transactional databases
19 * @author Christian Grothoff
21 #ifndef GNUNET_DB_LIB_H
22 #define GNUNET_DB_LIB_H
26 * Status code returned from functions running database commands.
27 * Can be combined with a function that returns the number
28 * of results, so all non-negative values indicate success.
30 enum GNUNET_DB_QueryStatus
33 * A hard error occurred, retrying will not help.
35 GNUNET_DB_STATUS_HARD_ERROR = -2,
38 * A soft error occurred, retrying the transaction may succeed.
39 * Includes DEADLOCKS and SERIALIZATION errors.
41 GNUNET_DB_STATUS_SOFT_ERROR = -1,
44 * The transaction succeeded, but yielded zero results.
45 * May include the case where an INSERT failed with UNIQUE
46 * violation (i.e. row already exists) or where DELETE
47 * failed to remove anything (i.e. nothing matched).
49 GNUNET_DB_STATUS_SUCCESS_NO_RESULTS = 0,
52 * The transaction succeeded, and yielded one result.
54 GNUNET_DB_STATUS_SUCCESS_ONE_RESULT = 1
56 /* Larger values may be returned for SELECT statements
57 that returned more than one result. */