soci-simple.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2008 Maciej Sobczak
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 //
7 
8 #ifndef SOCI_SIMPLE_H_INCLUDED
9 #define SOCI_SIMPLE_H_INCLUDED
10 
11 #include "soci-config.h"
12 
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif // __cplusplus
17 
18 // session
19 
20 typedef void * session_handle;
21 SOCI_DECL session_handle soci_create_session(char const * connectionString);
22 SOCI_DECL void soci_destroy_session(session_handle s);
23 
24 SOCI_DECL void soci_begin(session_handle s);
25 SOCI_DECL void soci_commit(session_handle s);
26 SOCI_DECL void soci_rollback(session_handle s);
27 
28 SOCI_DECL int soci_session_state(session_handle s);
29 SOCI_DECL char const * soci_session_error_message(session_handle s);
30 
31 // statement
32 
33 typedef void * statement_handle;
34 SOCI_DECL statement_handle soci_create_statement(session_handle s);
35 SOCI_DECL void soci_destroy_statement(statement_handle st);
36 
37 // positional bind of into elments (the functions return the position for convenience)
38 SOCI_DECL int soci_into_string (statement_handle st);
39 SOCI_DECL int soci_into_int (statement_handle st);
40 SOCI_DECL int soci_into_long_long(statement_handle st);
41 SOCI_DECL int soci_into_double (statement_handle st);
42 SOCI_DECL int soci_into_date (statement_handle st);
43 
44 // vector versions
45 SOCI_DECL int soci_into_string_v (statement_handle st);
46 SOCI_DECL int soci_into_int_v (statement_handle st);
47 SOCI_DECL int soci_into_long_long_v(statement_handle st);
48 SOCI_DECL int soci_into_double_v (statement_handle st);
49 SOCI_DECL int soci_into_date_v (statement_handle st);
50 
51 // positional read of into elements
52 SOCI_DECL int soci_get_into_state (statement_handle st, int position);
53 SOCI_DECL char const * soci_get_into_string (statement_handle st, int position);
54 SOCI_DECL int soci_get_into_int (statement_handle st, int position);
55 SOCI_DECL long long soci_get_into_long_long(statement_handle st, int position);
56 SOCI_DECL double soci_get_into_double (statement_handle st, int position);
57 SOCI_DECL char const * soci_get_into_date (statement_handle st, int position);
58 
59 // positional (re)size of vectors
60 SOCI_DECL int soci_into_get_size_v(statement_handle st);
61 SOCI_DECL void soci_into_resize_v (statement_handle st, int new_size);
62 
63 // positional read of vectors
64 SOCI_DECL int soci_get_into_state_v (statement_handle st, int position, int index);
65 SOCI_DECL char const * soci_get_into_string_v (statement_handle st, int position, int index);
66 SOCI_DECL int soci_get_into_int_v (statement_handle st, int position, int index);
67 SOCI_DECL long long soci_get_into_long_long_v(statement_handle st, int position, int index);
68 SOCI_DECL double soci_get_into_double_v (statement_handle st, int position, int index);
69 SOCI_DECL char const * soci_get_into_date_v (statement_handle st, int position, int index);
70 
71 
72 // named bind of use elements
73 SOCI_DECL void soci_use_string (statement_handle st, char const * name);
74 SOCI_DECL void soci_use_int (statement_handle st, char const * name);
75 SOCI_DECL void soci_use_long_long(statement_handle st, char const * name);
76 SOCI_DECL void soci_use_double (statement_handle st, char const * name);
77 SOCI_DECL void soci_use_date (statement_handle st, char const * name);
78 
79 // vector versions
80 SOCI_DECL void soci_use_string_v (statement_handle st, char const * name);
81 SOCI_DECL void soci_use_int_v (statement_handle st, char const * name);
82 SOCI_DECL void soci_use_long_long_v(statement_handle st, char const * name);
83 SOCI_DECL void soci_use_double_v (statement_handle st, char const * name);
84 SOCI_DECL void soci_use_date_v (statement_handle st, char const * name);
85 
86 
87 // named write of use elements
88 SOCI_DECL void soci_set_use_state (statement_handle st, char const * name, int state);
89 SOCI_DECL void soci_set_use_string (statement_handle st, char const * name, char const * val);
90 SOCI_DECL void soci_set_use_int (statement_handle st, char const * name, int val);
91 SOCI_DECL void soci_set_use_long_long(statement_handle st, char const * name, long long val);
92 SOCI_DECL void soci_set_use_double (statement_handle st, char const * name, double val);
93 SOCI_DECL void soci_set_use_date (statement_handle st, char const * name, char const * val);
94 
95 // positional (re)size of vectors
96 SOCI_DECL int soci_use_get_size_v(statement_handle st);
97 SOCI_DECL void soci_use_resize_v (statement_handle st, int new_size);
98 
99 // named write of use vectors
100 SOCI_DECL void soci_set_use_state_v(statement_handle st,
101  char const * name, int index, int state);
102 SOCI_DECL void soci_set_use_string_v(statement_handle st,
103  char const * name, int index, char const * val);
104 SOCI_DECL void soci_set_use_int_v(statement_handle st,
105  char const * name, int index, int val);
106 SOCI_DECL void soci_set_use_long_long_v(statement_handle st,
107  char const * name, int index, long long val);
108 SOCI_DECL void soci_set_use_double_v(statement_handle st,
109  char const * name, int index, double val);
110 SOCI_DECL void soci_set_use_date_v(statement_handle st,
111  char const * name, int index, char const * val);
112 
113 
114 // named read of use elements (for modifiable use values)
115 SOCI_DECL int soci_get_use_state (statement_handle st, char const * name);
116 SOCI_DECL char const * soci_get_use_string (statement_handle st, char const * name);
117 SOCI_DECL int soci_get_use_int (statement_handle st, char const * name);
118 SOCI_DECL long long soci_get_use_long_long(statement_handle st, char const * name);
119 SOCI_DECL double soci_get_use_double (statement_handle st, char const * name);
120 SOCI_DECL char const * soci_get_use_date (statement_handle st, char const * name);
121 
122 
123 // statement preparation and execution
124 SOCI_DECL void soci_prepare(statement_handle st, char const * query);
125 SOCI_DECL int soci_execute(statement_handle st, int withDataExchange);
126 SOCI_DECL long long soci_get_affected_rows(statement_handle st);
127 SOCI_DECL int soci_fetch(statement_handle st);
128 SOCI_DECL int soci_got_data(statement_handle st);
129 
130 SOCI_DECL int soci_statement_state(statement_handle s);
131 SOCI_DECL char const * soci_statement_error_message(statement_handle s);
132 
133 #ifdef __cplusplus
134 } // extern "C"
135 #endif // __cplusplus
136 
137 #endif // SOCI_SIMPLE_H_INCLUDED
SOCI_DECL long long soci_get_affected_rows(statement_handle st)
SOCI_DECL void soci_into_resize_v(statement_handle st, int new_size)
SOCI_DECL char const * soci_get_into_string(statement_handle st, int position)
SOCI_DECL void soci_set_use_date(statement_handle st, char const *name, char const *val)
SOCI_DECL void soci_set_use_double(statement_handle st, char const *name, double val)
SOCI_DECL void soci_use_long_long_v(statement_handle st, char const *name)
SOCI_DECL int soci_get_use_state(statement_handle st, char const *name)
SOCI_DECL void soci_use_date_v(statement_handle st, char const *name)
SOCI_DECL void soci_use_double(statement_handle st, char const *name)
SOCI_DECL double soci_get_into_double_v(statement_handle st, int position, int index)
SOCI_DECL char const * soci_get_use_date(statement_handle st, char const *name)
SOCI_DECL void soci_use_date(statement_handle st, char const *name)
SOCI_DECL char const * soci_get_into_date_v(statement_handle st, int position, int index)
SOCI_DECL void soci_use_long_long(statement_handle st, char const *name)
SOCI_DECL void soci_set_use_long_long_v(statement_handle st, char const *name, int index, long long val)
SOCI_DECL int soci_into_long_long_v(statement_handle st)
SOCI_DECL int soci_get_use_int(statement_handle st, char const *name)
SOCI_DECL int soci_into_int_v(statement_handle st)
SOCI_DECL char const * soci_statement_error_message(statement_handle s)
SOCI_DECL session_handle soci_create_session(char const *connectionString)
Definition: soci-simple.cpp:37
SOCI_DECL int soci_into_string(statement_handle st)
SOCI_DECL int soci_into_int(statement_handle st)
SOCI_DECL void soci_commit(session_handle s)
Definition: soci-simple.cpp:84
SOCI_DECL char const * soci_get_into_string_v(statement_handle st, int position, int index)
SOCI_DECL void soci_destroy_session(session_handle s)
Definition: soci-simple.cpp:63
void * session_handle
Definition: soci-simple.h:20
SOCI_DECL void soci_set_use_double_v(statement_handle st, char const *name, int index, double val)
SOCI_DECL void soci_use_double_v(statement_handle st, char const *name)
SOCI_DECL void soci_set_use_string(statement_handle st, char const *name, char const *val)
SOCI_DECL int soci_fetch(statement_handle st)
SOCI_DECL int soci_session_state(session_handle s)
#define SOCI_DECL
Definition: soci-config.h:31
SOCI_DECL int soci_into_get_size_v(statement_handle st)
SOCI_DECL int soci_get_into_int(statement_handle st, int position)
SOCI_DECL void soci_set_use_int_v(statement_handle st, char const *name, int index, int val)
SOCI_DECL int soci_use_get_size_v(statement_handle st)
SOCI_DECL int soci_execute(statement_handle st, int withDataExchange)
SOCI_DECL void soci_set_use_state_v(statement_handle st, char const *name, int index, int state)
SOCI_DECL int soci_get_into_state_v(statement_handle st, int position, int index)
SOCI_DECL void soci_use_int(statement_handle st, char const *name)
SOCI_DECL void soci_rollback(session_handle s)
Definition: soci-simple.cpp:99
SOCI_DECL void soci_set_use_long_long(statement_handle st, char const *name, long long val)
SOCI_DECL statement_handle soci_create_statement(session_handle s)
SOCI_DECL int soci_into_double(statement_handle st)
SOCI_DECL int soci_get_into_state(statement_handle st, int position)
SOCI_DECL void soci_begin(session_handle s)
Definition: soci-simple.cpp:69
SOCI_DECL int soci_get_into_int_v(statement_handle st, int position, int index)
SOCI_DECL int soci_into_string_v(statement_handle st)
SOCI_DECL void soci_use_int_v(statement_handle st, char const *name)
void * statement_handle
Definition: soci-simple.h:33
SOCI_DECL void soci_set_use_date_v(statement_handle st, char const *name, int index, char const *val)
SOCI_DECL void soci_set_use_int(statement_handle st, char const *name, int val)
SOCI_DECL int soci_into_date_v(statement_handle st)
SOCI_DECL int soci_got_data(statement_handle st)
SOCI_DECL double soci_get_use_double(statement_handle st, char const *name)
SOCI_DECL char const * soci_get_into_date(statement_handle st, int position)
SOCI_DECL long long soci_get_into_long_long(statement_handle st, int position)
SOCI_DECL long long soci_get_use_long_long(statement_handle st, char const *name)
SOCI_DECL int soci_into_double_v(statement_handle st)
SOCI_DECL void soci_use_string(statement_handle st, char const *name)
SOCI_DECL void soci_set_use_state(statement_handle st, char const *name, int state)
SOCI_DECL int soci_into_long_long(statement_handle st)
SOCI_DECL void soci_destroy_statement(statement_handle st)
SOCI_DECL int soci_into_date(statement_handle st)
SOCI_DECL char const * soci_session_error_message(session_handle s)
SOCI_DECL double soci_get_into_double(statement_handle st, int position)
SOCI_DECL void soci_prepare(statement_handle st, char const *query)
SOCI_DECL int soci_statement_state(statement_handle s)
SOCI_DECL void soci_set_use_string_v(statement_handle st, char const *name, int index, char const *val)
SOCI_DECL void soci_use_resize_v(statement_handle st, int new_size)
SOCI_DECL char const * soci_get_use_string(statement_handle st, char const *name)
SOCI_DECL void soci_use_string_v(statement_handle st, char const *name)
SOCI_DECL long long soci_get_into_long_long_v(statement_handle st, int position, int index)


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41