]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/include/openils/oils_sql.h
LP1831390: Fixing implementation of registerOnTouch
[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 oilsIsDBConnected( dbi_conn handle );
33 int oilsExtendIDL( dbi_conn handle );
34 int str_is_true( const char* str );
35 char* buildQuery( osrfMethodContext* ctx, jsonObject* query, int flags );
36
37 char* oilsGetRelation( osrfHash* classdef );
38
39 int beginTransaction ( osrfMethodContext* ctx );
40 int commitTransaction ( osrfMethodContext* ctx );
41 int rollbackTransaction ( osrfMethodContext* ctx );
42
43 int setSavepoint ( osrfMethodContext* ctx );
44 int releaseSavepoint ( osrfMethodContext* ctx );
45 int rollbackSavepoint ( osrfMethodContext* ctx );
46
47 int doJSONSearch ( osrfMethodContext* ctx );
48
49 int doCreate( osrfMethodContext* ctx );
50 int doRetrieve( osrfMethodContext* ctx );
51 int doUpdate( osrfMethodContext* ctx );
52 int doDelete( osrfMethodContext* ctx );
53 int doSearch( osrfMethodContext* ctx );
54 int doIdList( osrfMethodContext* ctx );
55
56 int is_identifier( const char* s);
57 int is_good_operator( const char* op );
58
59 int setAuditInfo( osrfMethodContext* ctx );
60
61 #ifdef __cplusplus
62 }
63 #endif
64
65 #endif