14
14
The internal drizzle connection object struct
16
.. c:type:: drizzle_options_st
18
The internal structure containing connection options
19
.. 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)
21
Creates a TCP/IP connection connection object
23
:param host: The hostname or IP of the server
24
:param port: The port number of the server
25
:param user: The username of the server
26
:param password: The password of the server
27
:param db: The default DB to connect to on the server
28
:param options: The connection options to set
29
:returns: A newly allocated and setup connection object
31
.. c:function:: drizzle_st* drizzle_create_uds(const char *uds, const char *user, const char *password, const char *db, drizzle_options_t options)
33
Creates a Unix Domain Socket connection object
35
:param uds: The path of the UDS file
36
:param user: The username of the server
37
:param password: The password of the server
38
:param db: The default DB to connect to on the server
39
:param options: The connection options to set
23
.. c:function:: drizzle_st* drizzle_create(const char *host, in_port_t port, const char *user, const char *password, const char *db, drizzle_options_st *options)
25
Creates a connection connection object. If a path beginning with ``/`` is given as the host the library will connect as a UDS socket. Otherwise a TCP/IP conection is made.
28
a connection does not happen until the first query or an explicit :c:func:`drizzle_connect` call is made
30
:param host: The socket path, hostname or IP of the server
31
:param port: The port number of the server (if TCP/IP)
32
:param user: The username of the server
33
:param password: The password of the server
34
:param db: The default DB to connect to on the server
35
:param options: A pointer to a :c:type:`drizzle_options_st` created using :c:func:`drizzle_options_create` or :c:type:`NULL`
40
36
:returns: A newly allocated and setup connection object
42
38
.. c:function:: int drizzle_timeout(const drizzle_st *con)
103
99
:param con: A connection object
104
100
:returns: A string containing the sqlstate
106
.. c:function:: drizzle_options_t drizzle_options(const drizzle_st *con)
108
Gets the connection options
110
:param con: A connection object
111
:returns: The options for the connection
113
.. c:function:: void drizzle_set_options(drizzle_st *con, drizzle_options_t options)
115
Sets the connection options
117
:param con: A connection object
118
:param options: A bit field of the :c:type:`drizzle_options_t` options
120
.. c:function:: void drizzle_add_options(drizzle_st *con, drizzle_options_t options)
122
Add connection options
124
:param con: A connection object
125
:param options: A bit field of the :c:type:`drizzle_options_t` options
127
.. c:function:: void drizzle_remove_options(drizzle_st *con, drizzle_options_t options)
129
Removes connection options
131
:param con: A connection object
132
:param options: A bit field of the :c:type:`drizzle_options_t` options
102
.. c:function:: drizzle_options_st *drizzle_options_create(void)
104
Create a new connection options object
106
:returns: The new connection options object
108
.. c:function:: void drizzle_options_destroy(drizzle_options_st *options)
110
Destroys a connection options object
112
:param options: The options object to be destroyed
114
.. c:function:: void drizzle_options_set_non_blocking(drizzle_options_st *options, bool state)
116
Sets/unsets non-blocking connect option
118
:param options: The options object to modify
119
:param state: Set option to true/false
121
.. c:function:: bool drizzle_options_get_non_blocking(drizzle_options_st *options)
123
Gets the non-blocking connect option
125
:param options: The options object to get the value from
126
:returns: The state of the non-blocking option
128
.. c:function:: void drizzle_options_set_raw_scramble(drizzle_options_st *options, bool state)
130
Sets/unsets the raw scramble connect option
132
:param options: The options object to modify
133
:param state: Set to true/false
135
.. c:function:: bool drizzle_options_get_raw_scramble(drizzle_options_st *options)
137
Gets the raw scramble connect option
139
:param options: The options object to get the value from
140
:returns: The state of the raw scramble option
142
.. c:function:: void drizzle_options_set_found_rows(drizzle_options_st *options, bool state)
144
Sets/unsets the found rows connect option
146
:param options: The options object to modify
147
:param state: Set to true/false
149
.. c:function:: bool drizzle_options_get_found_rows(drizzle_options_st *options)
151
Gets the found rows connect option
153
:param options: The options object to get the value from
154
:returns: The state of the found rows option
156
.. c:function:: void drizzle_options_set_interactive(drizzle_options_st *options, bool state)
158
Sets/unsets the interactive connect option
160
:param options: The options object to modify
161
:param state: Set to true/false
163
.. c:function:: bool drizzle_options_get_interactive(drizzle_options_st *option)
165
Gets the interactive connect option
167
:param options: The options object to get the value from
168
:returns: The state of the interactive option
170
.. c:function:: void drizzle_options_set_multi_statements(drizzle_options_st *options, bool state)
172
Sets/unsets the multi-statements connect option
174
:param options: The options object to modify
175
:parma state: Set to true/false
177
.. c:function:: bool drizzle_options_get_multi_statements(drizzle_options_st *options)
179
Gets the multi-statements connect option
181
:param options: The options object to get the value from
182
:returns: The state of the multi-statements option
184
.. c:function:: void drizzle_options_set_auth_plugin(drizzle_options_st *options, bool state)
186
Sets/unsets the auth plugin connect option
188
:param options: The optoins object to modify
189
:param state: Set to true/false
191
.. c:function:: bool drizzle_options_get_auth_plugin(drizzle_options_st *options)
193
Gets the auth plugin connect option
195
:param options: The options object to get the value from
196
:returns: The state of the auth plugin option
134
198
.. c:function:: const char* drizzle_host(const drizzle_st *con)
136
200
Gets the host name from a TCP/IP connection