32
32
:param options: The connection options to set
33
33
:returns: A newly allocated and setup connection object
35
.. c:function:: int drizzle_con_timeout(const drizzle_con_st *con)
35
.. c:function:: int drizzle_timeout(const drizzle_st *con)
37
37
Gets the current connection timeout set in the connection object
39
39
:param drizzle: A connection object
40
40
:returns: The current timeout
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)
44
44
Sets the connection timeout for the connection object
46
46
:param drizzle: A connection object
47
47
:param int: The new timeout to set
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)
51
51
Gets the verbosity level set in the connection object
53
53
:param drizzle: A connection object
54
54
:returns: The verbosity level from :c:type:`drizzle_verbose_t`
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)
58
58
Sets the verbosity level for the connection object
60
60
:param drizzle: A connection object
61
61
:param verbose: The verbosity level from :c:type:`drizzle_verbose_t`
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)
65
65
Sets a callback function for log handling
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
71
.. c:function:: const char* drizzle_con_error(const drizzle_con_st *con)
71
.. c:function:: const char* drizzle_error(const drizzle_st *con)
73
73
Get the last error from a connection
75
75
:param con: A connection object
76
76
:returns: A string containing the error message
78
.. c:function:: int drizzle_con_errno(const drizzle_con_st *con)
78
.. c:function:: int drizzle_errno(const drizzle_st *con)
80
80
Get the last OS error code from a connection
82
82
:param con: A connection object
83
83
:returns: The OS error code
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)
87
87
Gets the last error code from a connection
89
89
:param con: A connection object
90
90
:returns: The server error code
92
.. c:function:: const char* drizzle_con_sqlstate(const drizzle_con_st *con)
92
.. c:function:: const char* drizzle_sqlstate(const drizzle_st *con)
94
94
Gets the last sqlstate from a connection
96
96
:param con: A connection object
97
97
:returns: A string containing the sqlstate
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)
101
101
Gets the connection options
103
103
:param con: A connection object
104
104
:returns: The options for the connection
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)
108
108
Sets the connection options
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
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)
115
115
Add connection options
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
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)
122
122
Removes connection options
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
127
.. c:function:: const char* drizzle_con_host(const drizzle_con_st *con)
127
.. c:function:: const char* drizzle_host(const drizzle_st *con)
129
129
Gets the host name from a TCP/IP connection
131
131
:param con: A connection object
132
132
:returns: A string containing the host name or NULL for a UDS connection
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)
136
136
Gets the port number from a TCP/IP connection
138
138
:param con: A connection object
139
139
:returns: The port number or 0 for a UDS connection
141
.. c:function:: const char* drizzle_con_user(const drizzle_con_st *con)
141
.. c:function:: const char* drizzle_user(const drizzle_st *con)
143
143
Gets the user name used at connection time
145
145
:param con: A connection object
146
146
:returns: A string containing the user name
148
.. c:function:: const char* drizzle_con_db(const drizzle_con_st *con)
148
.. c:function:: const char* drizzle_db(const drizzle_st *con)
150
150
Gets the default database used at connection time
152
152
:param con: A connection object
153
153
:returns: A string containing the DB name
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)
157
157
Gets the protocol version used for a connection
159
159
:param con: A connection object
160
160
:returns: The protocol version
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)
164
164
Gets the server version string for a connection
166
166
:param con: A connection object
167
167
:returns: A string containing the server version
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)
171
171
Gets the server version number for a connection
173
173
:param con: A connection object
174
174
:returns: An integer containing the server version number
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)
178
178
Gets the server thread ID for a connection
180
180
:param con: A connection object
181
181
:returns: The server thread ID
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)
185
185
Gets the server capabilites for a connection
187
187
:param con: A connection object
188
188
:returns: A bit field of capabilities
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)
192
192
Gets the character set ID for the connection
194
194
:param con: A connection object
195
195
:returns: The character set used
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)
199
199
Gets the status of the connection
201
201
:param con: A connection object
202
202
:returns: The status of the connection
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)
206
206
Gets the max packet size for a connection
208
208
:param con: A connection object
209
209
:returns: The max packet size for the connection
211
.. c:function:: drizzle_return_t drizzle_con_connect(drizzle_con_st *con)
211
.. c:function:: drizzle_return_t drizzle_connect(drizzle_st *con)
213
213
Open connection to the specified server
215
215
:param con: A connection object
216
216
:returns: A :c:type:`drizzle_return_t` status. :py:const:`DRIZZLE_RETURN_OK` upon success
218
.. c:function:: drizzle_return_t drizzle_con_quit(drizzle_con_st *con)
218
.. c:function:: drizzle_return_t drizzle_quit(drizzle_st *con)
220
220
Gracefully disconnect from a server and free the connection object
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
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)
227
227
Change the current default database