1odbx_get_option(3)                  OpenDBX                 odbx_get_option(3)
2
3
4

NAME

6       odbx_get_option - Query backend for implemented options
7

SYNOPSIS

9       #include <opendbx/api.h>
10
11
12       int odbx_get_option (odbx_t* handle, unsigned int option, void* value);
13

DESCRIPTION

15       odbx_get_option()  asks  the  backend  module  associated  to handle by
16       odbx_init() for implemented options  and  their  current  values.  This
17       function can be used at every stage as long as handle points to a valid
18       connection object. Its primary use is to find out supported features of
19       the backend module and to enable them with odbx_set_option() before the
20       connection  to  the  database  server   is   established   by   calling
21       odbx_bind().
22
23       The  first  parameter  handle  is the connection object created and re‐
24       turned by odbx_init() which becomes invalid as soon as it was  supplied
25       to odbx_finish().
26
27       There  are  several  option  values  defined  as named constants in the
28       odbx.h header file. A few of them are for  informational  purpose  only
29       while most of the options can also be set to different option values by
30       odbx_set_option() to change the behavior of  the  backend  module.  The
31       available options are:
32
33       ODBX_OPT_API_VERSION
34              The  API  version  implemented by the backend. Currently, it re‐
35              turns only zero and is reserved for the future
36
37       ODBX_OPT_THREAD_SAFE
38              If it is safe to use this  backend  and  especially  the  native
39              database  client  library  in  an application which uses threads
40              where more than one thread opens database  connections  via  the
41              OpenDBX library
42
43       ODBX_OPT_TLS
44              The  database  client  library may support transmitting all data
45              securely by encrypting the network traffic via SSL or TLS
46
47       ODBX_OPT_MULTI_STATEMENTS
48              The database server may be able to support multiple  SQL  state‐
49              ments in one query string sent via odbx_query()
50
51       ODBX_OPT_PAGED_RESULTS
52              All  database  servers and client libraries are able to transfer
53              the records row by row. Some of them can also transfer  multiple
54              rows  or even all at once to minimize server load, network traf‐
55              fic and latency. The downside of this  is  an  increased  memory
56              consumption
57
58       ODBX_OPT_COMPRESS
59              Support  of  compressed  network traffic between database client
60              and server. This can lead to higher throughput if the network is
61              the bottleneck
62
63       ODBX_OPT_MODE
64              Some database servers support different modes of operation, e.g.
65              modes for compliance to other SQL implementations or  completely
66              different query languages. This option is available since OpenD‐
67              BX 1.1.4
68
69       value must be a pointer to an integer variable where the backend module
70       will  store the result for the supplied option. If it's not stated oth‐
71       erwise, the value assigned to the value parameter by  odbx_get_option()
72       will  be of boolean nature and therefore is ODBX_ENABLE for a supported
73       option or ODBX_DISABLE for an option which isn't supported.
74

RETURN VALUE

76       odbx_get_option() returns ODBX_ERR_SUCCESS, or an error code whose val‐
77       ue  is  less  than  zero if one of the operations couldn't be completed
78       successfully. Possible error codes are listed in the error section  and
79       they  can  be feed to odbx_error() and odbx_error_type() to get further
80       details.
81

ERRORS

83       -ODBX_ERR_PARAM
84              One of the supplied parameters is invalid or is  NULL  and  this
85              isn't  allowed in the used backend module or in the native data‐
86              base client library
87
88       -ODBX_ERR_OPTION
89              The value passed to the option parameter isn't one of the values
90              listed in this manual. The content of value remains unchanged if
91              this error occurs
92

SEE ALSO

94       odbx_bind(), odbx_error(), odbx_error_type(), odbx_init(), odbx_set_op‐
95       tion()
96
97
98
99                                2 February 2021             odbx_get_option(3)
Impressum