]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/include/openils/oils_sql.h
1. Renamed function getRelation to oilsGetRelation.
[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 char* oilsGetRelation( osrfHash* classdef );
37
38 int beginTransaction ( osrfMethodContext* );
39 int commitTransaction ( osrfMethodContext* );
40 int rollbackTransaction ( osrfMethodContext* );
41
42 int setSavepoint ( osrfMethodContext* );
43 int releaseSavepoint ( osrfMethodContext* );
44 int rollbackSavepoint ( osrfMethodContext* );
45
46 int doJSONSearch ( osrfMethodContext* ctx );
47
48 int doCreate( osrfMethodContext* ctx );
49 int doRetrieve( osrfMethodContext* ctx );
50 int doUpdate( osrfMethodContext* ctx );
51 int doDelete( osrfMethodContext* ctx );
52 int doSearch( osrfMethodContext* ctx );
53 int doIdList( osrfMethodContext* ctx );
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59 #endif