]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/include/openils/oils_sql.h
d39a43f4e8db3ee82b360bc0c2277867bd019aed
[working/Evergreen.git] / Open-ILS / include / openils / oils_sql.h
1 /*
2 Copyright (C) 2010 Equinox Software Inc.
3 Scott McKellar <scott@esilibrary.com>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14 */
15
16 /**
17         @file oils_sql.h
18
19         @brief Utility routines for translating JSON into SQL.
20 */
21
22 #ifndef OILS_SQL_H
23 #define OILS_SQL_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 dbi_conn oilsConnectDB( const char* mod_name );
30 void oilsSetSQLOptions( const char* module_name, int do_pcrud, int flesh_depth );
31 void oilsSetDBConnection( dbi_conn conn );
32 int oilsExtendIDL( void );
33 int str_is_true( const char* str );
34 char* buildQuery( osrfMethodContext* ctx, jsonObject* query, int flags );
35
36 int beginTransaction ( osrfMethodContext* );
37 int commitTransaction ( osrfMethodContext* );
38 int rollbackTransaction ( osrfMethodContext* );
39
40 int setSavepoint ( osrfMethodContext* );
41 int releaseSavepoint ( osrfMethodContext* );
42 int rollbackSavepoint ( osrfMethodContext* );
43
44 int doJSONSearch ( osrfMethodContext* ctx );
45
46 int doCreate( osrfMethodContext* ctx );
47 int doRetrieve( osrfMethodContext* ctx );
48 int doUpdate( osrfMethodContext* ctx );
49 int doDelete( osrfMethodContext* ctx );
50 int doSearch( osrfMethodContext* ctx );
51 int doIdList( osrfMethodContext* ctx );
52
53 #ifdef __cplusplus
54 }
55 #endif
56
57 #endif