~linuxjedi/libdrizzle/5.1-prep-stmt-cleanup

« back to all changes in this revision

Viewing changes to docs/api/connection.rst

  • Committer: Andrew Hutchings
  • Date: 2012-12-22 08:55:58 UTC
  • mfrom: (43.2.18 5.0)
  • Revision ID: andrew@linuxjedi.co.uk-20121222085558-b3aj47q2ah3cfccg
Merge 5.0 into 5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
Functions
10
10
---------
11
11
 
12
 
.. c:function:: drizzle_con_st* drizzle_con_create_tcp(const char *host, in_port_t port, const char *user, const char *password, const char *db, drizzle_con_options_t options)
 
12
.. c:function:: drizzle_st* drizzle_create_tcp(const char *host, in_port_t port, const char *user, const char *password, const char *db, drizzle_options_t options)
13
13
 
14
14
   Creates a TCP/IP connection connection object
15
15
 
21
21
   :param options: The connection options to set
22
22
   :returns: A newly allocated and setup connection object
23
23
 
24
 
.. c:function:: drizzle_con_st* drizzle_con_create_uds(const char *uds, const char *user, const char *password, const char *db, drizzle_con_options_t options)
 
24
.. c:function:: drizzle_st* drizzle_create_uds(const char *uds, const char *user, const char *password, const char *db, drizzle_options_t options)
25
25
 
26
26
   Creates a Unix Domain Socket connection object
27
27
 
32
32
   :param options: The connection options to set
33
33
   :returns: A newly allocated and setup connection object
34
34
 
35
 
.. c:function:: int drizzle_con_timeout(const drizzle_con_st *con)
 
35
.. c:function:: int drizzle_timeout(const drizzle_st *con)
36
36
 
37
37
   Gets the current connection timeout set in the connection object
38
38
 
39
39
   :param drizzle: A connection object
40
40
   :returns: The current timeout
41
41
 
42
 
.. c:function:: void drizzle_con_set_timeout(drizzle_con_st *con, int timeout)
 
42
.. c:function:: void drizzle_set_timeout(drizzle_st *con, int timeout)
43
43
 
44
44
   Sets the connection timeout for the connection object
45
45
 
46
46
   :param drizzle: A connection object
47
47
   :param int: The new timeout to set
48
48
 
49
 
.. c:function:: drizzle_verbose_t drizzle_con_verbose(const drizzle_con_st *con)
 
49
.. c:function:: drizzle_verbose_t drizzle_verbose(const drizzle_st *con)
50
50
 
51
51
   Gets the verbosity level set in the connection object
52
52
 
53
53
   :param drizzle: A connection object
54
54
   :returns: The verbosity level from :c:type:`drizzle_verbose_t`
55
55
 
56
 
.. c:function:: void drizzle_con_set_verbose(drizzle_con_st *con, drizzle_verbose_t verbose)
 
56
.. c:function:: void drizzle_set_verbose(drizzle_st *con, drizzle_verbose_t verbose)
57
57
 
58
58
   Sets the verbosity level for the connection object
59
59
 
60
60
   :param drizzle: A connection object
61
61
   :param verbose: The verbosity level from :c:type:`drizzle_verbose_t`
62
62
 
63
 
.. c:function:: void drizzle_con_set_log_fn(drizzle_con_st *con, drizzle_log_fn *function, void *context)
 
63
.. c:function:: void drizzle_set_log_fn(drizzle_st *con, drizzle_log_fn *function, void *context)
64
64
 
65
65
   Sets a callback function for log handling
66
66
 
68
68
   :param function: The function to use in the format of :c:func:`drizzle_log_fn`
69
69
   :param context: A pointer to data to pass to the log function
70
70
 
71
 
.. c:function:: const char* drizzle_con_error(const drizzle_con_st *con)
 
71
.. c:function:: const char* drizzle_error(const drizzle_st *con)
72
72
 
73
73
   Get the last error from a connection
74
74
 
75
75
   :param con: A connection object
76
76
   :returns: A string containing the error message
77
77
 
78
 
.. c:function:: int drizzle_con_errno(const drizzle_con_st *con)
 
78
.. c:function:: int drizzle_errno(const drizzle_st *con)
79
79
 
80
80
   Get the last OS error code from a connection
81
81
 
82
82
   :param con: A connection object
83
83
   :returns: The OS error code
84
84
 
85
 
.. c:function:: uint16_t drizzle_con_error_code(const drizzle_con_st *con)
 
85
.. c:function:: uint16_t drizzle_error_code(const drizzle_st *con)
86
86
 
87
87
   Gets the last error code from a connection
88
88
 
89
89
   :param con: A connection object
90
90
   :returns: The server error code
91
91
 
92
 
.. c:function:: const char* drizzle_con_sqlstate(const drizzle_con_st *con)
 
92
.. c:function:: const char* drizzle_sqlstate(const drizzle_st *con)
93
93
 
94
94
   Gets the last sqlstate from a connection
95
95
 
96
96
   :param con: A connection object
97
97
   :returns: A string containing the sqlstate
98
98
 
99
 
.. c:function:: drizzle_con_options_t drizzle_con_options(const drizzle_con_st *con)
 
99
.. c:function:: drizzle_options_t drizzle_options(const drizzle_st *con)
100
100
 
101
101
   Gets the connection options
102
102
 
103
103
   :param con: A connection object
104
104
   :returns: The options for the connection
105
105
 
106
 
.. c:function:: void drizzle_con_set_options(drizzle_con_st *con, drizzle_con_options_t options)
 
106
.. c:function:: void drizzle_set_options(drizzle_st *con, drizzle_options_t options)
107
107
 
108
108
   Sets the connection options
109
109
 
110
110
   :param con: A connection object
111
 
   :param options: A bit field of the :c:type:`drizzle_con_options_t` options
 
111
   :param options: A bit field of the :c:type:`drizzle_options_t` options
112
112
 
113
 
.. c:function:: void drizzle_con_add_options(drizzle_con_st *con, drizzle_con_options_t options)
 
113
.. c:function:: void drizzle_add_options(drizzle_st *con, drizzle_options_t options)
114
114
 
115
115
   Add connection options
116
116
 
117
117
   :param con: A connection object
118
 
   :param options: A bit field of the :c:type:`drizzle_con_options_t` options
 
118
   :param options: A bit field of the :c:type:`drizzle_options_t` options
119
119
 
120
 
.. c:function:: void drizzle_con_remove_options(drizzle_con_st *con, drizzle_con_options_t options)
 
120
.. c:function:: void drizzle_remove_options(drizzle_st *con, drizzle_options_t options)
121
121
 
122
122
   Removes connection options
123
123
 
124
124
   :param con: A connection object
125
 
   :param options: A bit field of the :c:type:`drizzle_con_options_t` options
 
125
   :param options: A bit field of the :c:type:`drizzle_options_t` options
126
126
 
127
 
.. c:function:: const char* drizzle_con_host(const drizzle_con_st *con)
 
127
.. c:function:: const char* drizzle_host(const drizzle_st *con)
128
128
 
129
129
   Gets the host name from a TCP/IP connection
130
130
 
131
131
   :param con: A connection object
132
132
   :returns: A string containing the host name or NULL for a UDS connection
133
133
 
134
 
.. c:function:: in_port_t drizzle_con_port(const drizzle_con_st *con)
 
134
.. c:function:: in_port_t drizzle_port(const drizzle_st *con)
135
135
 
136
136
   Gets the port number from a TCP/IP connection
137
137
 
138
138
   :param con: A connection object
139
139
   :returns: The port number or 0 for a UDS connection
140
140
 
141
 
.. c:function:: const char* drizzle_con_user(const drizzle_con_st *con)
 
141
.. c:function:: const char* drizzle_user(const drizzle_st *con)
142
142
 
143
143
   Gets the user name used at connection time
144
144
 
145
145
   :param con: A connection object
146
146
   :returns: A string containing the user name
147
147
 
148
 
.. c:function:: const char* drizzle_con_db(const drizzle_con_st *con)
 
148
.. c:function:: const char* drizzle_db(const drizzle_st *con)
149
149
 
150
150
   Gets the default database used at connection time
151
151
 
152
152
   :param con: A connection object
153
153
   :returns: A string containing the DB name
154
154
 
155
 
.. c:function:: uint8_t drizzle_con_protocol_version(const drizzle_con_st *con)
 
155
.. c:function:: uint8_t drizzle_protocol_version(const drizzle_st *con)
156
156
 
157
157
   Gets the protocol version used for a connection
158
158
 
159
159
   :param con: A connection object
160
160
   :returns: The protocol version
161
161
 
162
 
.. c:function:: const char* drizzle_con_server_version(const drizzle_con_st *con)
 
162
.. c:function:: const char* drizzle_server_version(const drizzle_st *con)
163
163
 
164
164
   Gets the server version string for a connection
165
165
 
166
166
   :param con: A connection object
167
167
   :returns: A string containing the server version
168
168
 
169
 
.. c:function:: uint32_t drizzle_con_server_version_number(const drizzle_con_st *con)
 
169
.. c:function:: uint32_t drizzle_server_version_number(const drizzle_st *con)
170
170
 
171
171
   Gets the server version number for a connection
172
172
 
173
173
   :param con: A connection object
174
174
   :returns: An integer containing the server version number
175
175
 
176
 
.. c:function:: uint32_t drizzle_con_thread_id(const drizzle_con_st *con)
 
176
.. c:function:: uint32_t drizzle_thread_id(const drizzle_st *con)
177
177
 
178
178
   Gets the server thread ID for a connection
179
179
 
180
180
   :param con: A connection object
181
181
   :returns: The server thread ID
182
182
 
183
 
.. c:function:: drizzle_capabilities_t drizzle_con_capabilities(const drizzle_con_st *con)
 
183
.. c:function:: drizzle_capabilities_t drizzle_capabilities(const drizzle_st *con)
184
184
 
185
185
   Gets the server capabilites for a connection
186
186
 
187
187
   :param con: A connection object
188
188
   :returns: A bit field of capabilities
189
189
 
190
 
.. c:function:: drizzle_charset_t drizzle_con_charset(const drizzle_con_st *con)
 
190
.. c:function:: drizzle_charset_t drizzle_charset(const drizzle_st *con)
191
191
 
192
192
   Gets the character set ID for the connection
193
193
 
194
194
   :param con: A connection object
195
195
   :returns: The character set used
196
196
 
197
 
.. c:function:: drizzle_con_status_t drizzle_con_status(const drizzle_con_st *con)
 
197
.. c:function:: drizzle_status_t drizzle_status(const drizzle_st *con)
198
198
 
199
199
   Gets the status of the connection
200
200
 
201
201
   :param con: A connection object
202
202
   :returns: The status of the connection
203
203
 
204
 
.. c:function:: uint32_t drizzle_con_max_packet_size(const drizzle_con_st *con)
 
204
.. c:function:: uint32_t drizzle_max_packet_size(const drizzle_st *con)
205
205
 
206
206
   Gets the max packet size for a connection
207
207
 
208
208
   :param con: A connection object
209
209
   :returns: The max packet size for the connection
210
210
 
211
 
.. c:function:: drizzle_return_t drizzle_con_connect(drizzle_con_st *con)
 
211
.. c:function:: drizzle_return_t drizzle_connect(drizzle_st *con)
212
212
 
213
213
   Open connection to the specified server
214
214
 
215
215
   :param con: A connection object
216
216
   :returns: A :c:type:`drizzle_return_t` status.  :py:const:`DRIZZLE_RETURN_OK` upon success
217
217
 
218
 
.. c:function:: drizzle_return_t drizzle_con_quit(drizzle_con_st *con)
 
218
.. c:function:: drizzle_return_t drizzle_quit(drizzle_st *con)
219
219
 
220
220
   Gracefully disconnect from a server and free the connection object
221
221
 
222
222
   :param con: A connection object
223
223
   :returns: A :c:type:`drizzle_return_t` response for the quit command sent to the server
224
224
 
225
 
.. c:function:: drizzle_result_st* drizzle_con_select_db(drizzle_con_st *con, const char *db, drizzle_return_t *ret_ptr)
 
225
.. c:function:: drizzle_result_st* drizzle_select_db(drizzle_st *con, const char *db, drizzle_return_t *ret_ptr)
226
226
 
227
227
   Change the current default database
228
228
 
231
231
   :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
232
232
   :returns: A newly allocated result object
233
233
 
234
 
.. c:function:: drizzle_result_st* drizzle_con_shutdown(drizzle_con_st *con, drizzle_return_t *ret_ptr)
 
234
.. c:function:: drizzle_result_st* drizzle_shutdown(drizzle_st *con, drizzle_return_t *ret_ptr)
235
235
 
236
236
   Send a shutdown command to the server
237
237
 
239
239
   :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
240
240
   :returns: A newly allocated result object
241
241
 
242
 
.. c:function:: drizzle_result_st* drizzle_con_kill(drizzle_con_st *con, uint32_t connection_id, drizzle_return_t *ret_ptr)
 
242
.. c:function:: drizzle_result_st* drizzle_kill(drizzle_st *con, uint32_t connection_id, drizzle_return_t *ret_ptr)
243
243
 
244
244
   Sends a query kill command to the server
245
245
 
248
248
   :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
249
249
   :returns: A newly allocated result object
250
250
 
251
 
.. c:function:: drizzle_result_st* drizzle_con_ping(drizzle_con_st *con, drizzle_return_t *ret_ptr)
 
251
.. c:function:: drizzle_result_st* drizzle_ping(drizzle_st *con, drizzle_return_t *ret_ptr)
252
252
 
253
253
   Sends a ping to the server
254
254