| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<HTML |
| 3 |
><HEAD |
| 4 |
><TITLE |
| 5 |
>Database Independent Abstraction Layer for C</TITLE |
| 6 |
><META |
| 7 |
NAME="GENERATOR" |
| 8 |
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK |
| 9 |
REL="NEXT" |
| 10 |
TITLE="Introduction" |
| 11 |
HREF="intro.html"></HEAD |
| 12 |
><BODY |
| 13 |
CLASS="BOOK" |
| 14 |
BGCOLOR="#FFFFFF" |
| 15 |
TEXT="#000000" |
| 16 |
LINK="#0000FF" |
| 17 |
VLINK="#840084" |
| 18 |
ALINK="#0000FF" |
| 19 |
><DIV |
| 20 |
CLASS="BOOK" |
| 21 |
><A |
| 22 |
NAME="DRIVER-GUIDE" |
| 23 |
></A |
| 24 |
><DIV |
| 25 |
CLASS="TITLEPAGE" |
| 26 |
><H1 |
| 27 |
CLASS="TITLE" |
| 28 |
><A |
| 29 |
NAME="AEN2" |
| 30 |
>Database Independent Abstraction Layer for C</A |
| 31 |
></H1 |
| 32 |
><H2 |
| 33 |
CLASS="SUBTITLE" |
| 34 |
>libdbi Driver Author's Guide</H2 |
| 35 |
><H3 |
| 36 |
CLASS="AUTHOR" |
| 37 |
><A |
| 38 |
NAME="AEN5" |
| 39 |
></A |
| 40 |
>David A. Parker</H3 |
| 41 |
><DIV |
| 42 |
CLASS="AFFILIATION" |
| 43 |
><SPAN |
| 44 |
CLASS="ORGNAME" |
| 45 |
>Neon Goat Productions<BR></SPAN |
| 46 |
><DIV |
| 47 |
CLASS="ADDRESS" |
| 48 |
><P |
| 49 |
CLASS="ADDRESS" |
| 50 |
><CODE |
| 51 |
CLASS="EMAIL" |
| 52 |
><<A |
| 53 |
HREF="mailto:[email protected]" |
| 54 |
>[email protected]</A |
| 55 |
>></CODE |
| 56 |
></P |
| 57 |
></DIV |
| 58 |
></DIV |
| 59 |
><H3 |
| 60 |
CLASS="AUTHOR" |
| 61 |
><A |
| 62 |
NAME="AEN13" |
| 63 |
></A |
| 64 |
>Markus Hoenicka</H3 |
| 65 |
><DIV |
| 66 |
CLASS="AFFILIATION" |
| 67 |
><DIV |
| 68 |
CLASS="ADDRESS" |
| 69 |
><P |
| 70 |
CLASS="ADDRESS" |
| 71 |
><CODE |
| 72 |
CLASS="EMAIL" |
| 73 |
><<A |
| 74 |
HREF="mailto:[email protected]" |
| 75 |
>[email protected]</A |
| 76 |
>></CODE |
| 77 |
></P |
| 78 |
></DIV |
| 79 |
></DIV |
| 80 |
><P |
| 81 |
CLASS="COPYRIGHT" |
| 82 |
>Copyright © 2001-2013 David Parker, Neon Goat Productions, Markus Hoenicka</P |
| 83 |
><DIV |
| 84 |
><DIV |
| 85 |
CLASS="ABSTRACT" |
| 86 |
><P |
| 87 |
></P |
| 88 |
><A |
| 89 |
NAME="AEN30" |
| 90 |
></A |
| 91 |
><P |
| 92 |
> libdbi implements a database-independent abstraction layer in C, |
| 93 |
similar to the DBI/DBD layer in Perl. Writing one generic set of code, |
| 94 |
programmers can leverage the power of multiple databases and multiple |
| 95 |
simultaneous database connections by using this framework. |
| 96 |
</P |
| 97 |
><P |
| 98 |
> This guide explains the internal DBD interface for libdbi drivers, and |
| 99 |
provides a reference for all available driver helper functions. |
| 100 |
</P |
| 101 |
><P |
| 102 |
></P |
| 103 |
></DIV |
| 104 |
></DIV |
| 105 |
><DIV |
| 106 |
CLASS="LEGALNOTICE" |
| 107 |
><P |
| 108 |
></P |
| 109 |
><A |
| 110 |
NAME="AEN25" |
| 111 |
></A |
| 112 |
><P |
| 113 |
> Permission is granted to copy, distribute and/or modify this |
| 114 |
document under the terms of the <A |
| 115 |
HREF="copying-fdl.html" |
| 116 |
> <I |
| 117 |
CLASS="CITETITLE" |
| 118 |
>GNU Free Documentation License</I |
| 119 |
></A |
| 120 |
>, |
| 121 |
Version 1.1 or any later version published by the Free Software |
| 122 |
Foundation; with no Invariant Sections, with no Front-Cover Texts, |
| 123 |
and with no Back-Cover Texts. A copy of the license is included in |
| 124 |
<A |
| 125 |
HREF="copying-fdl.html" |
| 126 |
>Appendix A</A |
| 127 |
>. |
| 128 |
</P |
| 129 |
><P |
| 130 |
></P |
| 131 |
></DIV |
| 132 |
><HR></DIV |
| 133 |
><DIV |
| 134 |
CLASS="TOC" |
| 135 |
><DL |
| 136 |
><DT |
| 137 |
><B |
| 138 |
>Table of Contents</B |
| 139 |
></DT |
| 140 |
><DT |
| 141 |
>1. <A |
| 142 |
HREF="intro.html" |
| 143 |
>Introduction</A |
| 144 |
></DT |
| 145 |
><DD |
| 146 |
><DL |
| 147 |
><DT |
| 148 |
>1.1. <A |
| 149 |
HREF="description.html" |
| 150 |
>Description</A |
| 151 |
></DT |
| 152 |
><DT |
| 153 |
>1.2. <A |
| 154 |
HREF="terminology.html" |
| 155 |
>libdbi Concepts and Terminology</A |
| 156 |
></DT |
| 157 |
><DT |
| 158 |
>1.3. <A |
| 159 |
HREF="gnugpl.html" |
| 160 |
>Modifications and redistribution of libdbi</A |
| 161 |
></DT |
| 162 |
><DT |
| 163 |
>1.4. <A |
| 164 |
HREF="contact.html" |
| 165 |
>Contact Info</A |
| 166 |
></DT |
| 167 |
></DL |
| 168 |
></DD |
| 169 |
><DT |
| 170 |
>2. <A |
| 171 |
HREF="driverinfrastructure.html" |
| 172 |
>Driver Infrastructure</A |
| 173 |
></DT |
| 174 |
><DD |
| 175 |
><DL |
| 176 |
><DT |
| 177 |
>2.1. <A |
| 178 |
HREF="drivercaps.html" |
| 179 |
>Driver Capabilities</A |
| 180 |
></DT |
| 181 |
><DD |
| 182 |
><DL |
| 183 |
><DT |
| 184 |
>2.1.1. <A |
| 185 |
HREF="drivercaps.html#SETTINGDRIVERCAPS" |
| 186 |
>Setting driver capabilities</A |
| 187 |
></DT |
| 188 |
><DT |
| 189 |
>2.1.2. <A |
| 190 |
HREF="drivercaps.html#REQUIREDDRIVERCAPS" |
| 191 |
>Required driver capabilities</A |
| 192 |
></DT |
| 193 |
><DT |
| 194 |
>2.1.3. <A |
| 195 |
HREF="drivercaps.html#RECOMMENDEDDRIVERCAPS" |
| 196 |
>Recommended driver capabilities</A |
| 197 |
></DT |
| 198 |
></DL |
| 199 |
></DD |
| 200 |
><DT |
| 201 |
>2.2. <A |
| 202 |
HREF="databasedirectories.html" |
| 203 |
>Database directories</A |
| 204 |
></DT |
| 205 |
><DD |
| 206 |
><DL |
| 207 |
><DT |
| 208 |
>2.2.1. <A |
| 209 |
HREF="databasedirectories.html#DEFAULTDATABASEDIRECTORIES" |
| 210 |
>Default Database Directories</A |
| 211 |
></DT |
| 212 |
><DT |
| 213 |
>2.2.2. <A |
| 214 |
HREF="databasedirectories.html#CUSTOMDATABASEDIRECTORIES" |
| 215 |
>Custom Database Directories</A |
| 216 |
></DT |
| 217 |
></DL |
| 218 |
></DD |
| 219 |
><DT |
| 220 |
>2.3. <A |
| 221 |
HREF="driverdata.html" |
| 222 |
>Driver data</A |
| 223 |
></DT |
| 224 |
><DD |
| 225 |
><DL |
| 226 |
><DT |
| 227 |
>2.3.1. <A |
| 228 |
HREF="driverdata.html#DRIVERSPECIFICFUNCTIONS" |
| 229 |
>Driver specific functions</A |
| 230 |
></DT |
| 231 |
><DT |
| 232 |
>2.3.2. <A |
| 233 |
HREF="driverdata.html#AEN138" |
| 234 |
>Reserved words</A |
| 235 |
></DT |
| 236 |
></DL |
| 237 |
></DD |
| 238 |
></DL |
| 239 |
></DD |
| 240 |
><DT |
| 241 |
>3. <A |
| 242 |
HREF="driverfuncs.html" |
| 243 |
>Driver Functions</A |
| 244 |
></DT |
| 245 |
><DD |
| 246 |
><DL |
| 247 |
><DT |
| 248 |
>3.1. <A |
| 249 |
HREF="driverfuncs-infrastructure.html" |
| 250 |
>Driver Infrastructure Functions</A |
| 251 |
></DT |
| 252 |
><DD |
| 253 |
><DL |
| 254 |
><DT |
| 255 |
>3.1.1. <A |
| 256 |
HREF="driverfuncs-infrastructure.html#DBD-REGISTER-DRIVER" |
| 257 |
>dbd_register_driver</A |
| 258 |
></DT |
| 259 |
><DT |
| 260 |
>3.1.2. <A |
| 261 |
HREF="driverfuncs-infrastructure.html#DBD-INITIALIZE" |
| 262 |
>dbd_initialize</A |
| 263 |
></DT |
| 264 |
><DT |
| 265 |
>3.1.3. <A |
| 266 |
HREF="driverfuncs-infrastructure.html#DBD-CONNECT" |
| 267 |
>dbd_connect</A |
| 268 |
></DT |
| 269 |
><DT |
| 270 |
>3.1.4. <A |
| 271 |
HREF="driverfuncs-infrastructure.html#DBD-DISCONNECT" |
| 272 |
>dbd_disconnect</A |
| 273 |
></DT |
| 274 |
><DT |
| 275 |
>3.1.5. <A |
| 276 |
HREF="driverfuncs-infrastructure.html#DBD-GETERROR" |
| 277 |
>dbd_geterror</A |
| 278 |
></DT |
| 279 |
><DT |
| 280 |
>3.1.6. <A |
| 281 |
HREF="driverfuncs-infrastructure.html#DBD-GET-SOCKET" |
| 282 |
>dbd_get_socket</A |
| 283 |
></DT |
| 284 |
></DL |
| 285 |
></DD |
| 286 |
><DT |
| 287 |
>3.2. <A |
| 288 |
HREF="driverfuncs-dbquery.html" |
| 289 |
>Internal Database Query Functions</A |
| 290 |
></DT |
| 291 |
><DD |
| 292 |
><DL |
| 293 |
><DT |
| 294 |
>3.2.1. <A |
| 295 |
HREF="driverfuncs-dbquery.html#DBD-GOTO-ROW" |
| 296 |
>dbd_goto_row</A |
| 297 |
></DT |
| 298 |
><DT |
| 299 |
>3.2.2. <A |
| 300 |
HREF="driverfuncs-dbquery.html#DBD-FETCH-ROW" |
| 301 |
>dbd_fetch_row</A |
| 302 |
></DT |
| 303 |
><DT |
| 304 |
>3.2.3. <A |
| 305 |
HREF="driverfuncs-dbquery.html#DBD-FREE-QUERY" |
| 306 |
>dbd_free_query</A |
| 307 |
></DT |
| 308 |
></DL |
| 309 |
></DD |
| 310 |
><DT |
| 311 |
>3.3. <A |
| 312 |
HREF="driverfuncs-publicdbquery.html" |
| 313 |
>Public Database Query Functions</A |
| 314 |
></DT |
| 315 |
><DD |
| 316 |
><DL |
| 317 |
><DT |
| 318 |
>3.3.1. <A |
| 319 |
HREF="driverfuncs-publicdbquery.html#DBD-GET-ENCODING" |
| 320 |
>dbd_get_encoding</A |
| 321 |
></DT |
| 322 |
><DT |
| 323 |
>3.3.2. <A |
| 324 |
HREF="driverfuncs-publicdbquery.html#DBD-ENCODING-TO-IANA" |
| 325 |
>dbd_encoding_to_iana</A |
| 326 |
></DT |
| 327 |
><DT |
| 328 |
>3.3.3. <A |
| 329 |
HREF="driverfuncs-publicdbquery.html#DBD-ENCODING-FROM-IANA" |
| 330 |
>dbd_encoding_from_iana</A |
| 331 |
></DT |
| 332 |
><DT |
| 333 |
>3.3.4. <A |
| 334 |
HREF="driverfuncs-publicdbquery.html#DBD-GET-ENGINE-VERSION" |
| 335 |
>dbd_get_engine_version</A |
| 336 |
></DT |
| 337 |
><DT |
| 338 |
>3.3.5. <A |
| 339 |
HREF="driverfuncs-publicdbquery.html#DBD-LIST-DBS" |
| 340 |
>dbd_list_dbs</A |
| 341 |
></DT |
| 342 |
><DT |
| 343 |
>3.3.6. <A |
| 344 |
HREF="driverfuncs-publicdbquery.html#DBD-LIST-TABLES" |
| 345 |
>dbd_list_tables</A |
| 346 |
></DT |
| 347 |
><DT |
| 348 |
>3.3.7. <A |
| 349 |
HREF="driverfuncs-publicdbquery.html#DBD-QUOTE-STRING" |
| 350 |
>dbd_quote_string</A |
| 351 |
></DT |
| 352 |
><DT |
| 353 |
>3.3.8. <A |
| 354 |
HREF="driverfuncs-publicdbquery.html#DBD-CONN-QUOTE-STRING" |
| 355 |
>dbd_conn_quote_string</A |
| 356 |
></DT |
| 357 |
><DT |
| 358 |
>3.3.9. <A |
| 359 |
HREF="driverfuncs-publicdbquery.html#DBD-QUOTE-BINARY" |
| 360 |
>dbd_quote_binary</A |
| 361 |
></DT |
| 362 |
><DT |
| 363 |
>3.3.10. <A |
| 364 |
HREF="driverfuncs-publicdbquery.html#DBD-QUERY" |
| 365 |
>dbd_query</A |
| 366 |
></DT |
| 367 |
><DT |
| 368 |
>3.3.11. <A |
| 369 |
HREF="driverfuncs-publicdbquery.html#DBD-QUERY-NULL" |
| 370 |
>dbd_query_null</A |
| 371 |
></DT |
| 372 |
><DT |
| 373 |
>3.3.12. <A |
| 374 |
HREF="driverfuncs-publicdbquery.html#DBD-SELECT-DB" |
| 375 |
>dbd_select_db</A |
| 376 |
></DT |
| 377 |
><DT |
| 378 |
>3.3.13. <A |
| 379 |
HREF="driverfuncs-publicdbquery.html#DBD-GET-SEQ-LAST" |
| 380 |
>dbd_get_seq_last</A |
| 381 |
></DT |
| 382 |
><DT |
| 383 |
>3.3.14. <A |
| 384 |
HREF="driverfuncs-publicdbquery.html#DBD-GET-SEQ-NEXT" |
| 385 |
>dbd_get_seq_next</A |
| 386 |
></DT |
| 387 |
><DT |
| 388 |
>3.3.15. <A |
| 389 |
HREF="driverfuncs-publicdbquery.html#DBD-PING" |
| 390 |
>dbd_ping</A |
| 391 |
></DT |
| 392 |
></DL |
| 393 |
></DD |
| 394 |
><DT |
| 395 |
>3.4. <A |
| 396 |
HREF="helperfuncs.html" |
| 397 |
>DBD Helper Functions</A |
| 398 |
></DT |
| 399 |
><DD |
| 400 |
><DL |
| 401 |
><DT |
| 402 |
>3.4.1. <A |
| 403 |
HREF="helperfuncs.html#INTERNAL-DBD-RESULT-CREATE" |
| 404 |
>_dbd_result_create</A |
| 405 |
></DT |
| 406 |
><DT |
| 407 |
>3.4.2. <A |
| 408 |
HREF="helperfuncs.html#INTERNAL-DBD-RESULT-SET-NUMFIELDS" |
| 409 |
>_dbd_result_set_numfields</A |
| 410 |
></DT |
| 411 |
><DT |
| 412 |
>3.4.3. <A |
| 413 |
HREF="helperfuncs.html#INTERNAL-DBD-RESULT-ADD-FIELD" |
| 414 |
>_dbd_result_add_field</A |
| 415 |
></DT |
| 416 |
><DT |
| 417 |
>3.4.4. <A |
| 418 |
HREF="helperfuncs.html#INTERNAL-DBD-ROW-ALLOCATE" |
| 419 |
>_dbd_row_allocate</A |
| 420 |
></DT |
| 421 |
><DT |
| 422 |
>3.4.5. <A |
| 423 |
HREF="helperfuncs.html#INTERNAL-DBD-ROW-FINALIZE" |
| 424 |
>_dbd_row_finalize</A |
| 425 |
></DT |
| 426 |
><DT |
| 427 |
>3.4.6. <A |
| 428 |
HREF="helperfuncs.html#INTERNAL-DBD-INTERNAL-ERROR-HANDLER" |
| 429 |
>_dbd_internal_error_handler</A |
| 430 |
></DT |
| 431 |
><DT |
| 432 |
>3.4.7. <A |
| 433 |
HREF="helperfuncs.html#INTERNAL-DBD-RESULT-CREATE-FROM-STRINGARRAY" |
| 434 |
>_dbd_result_create_from_stringarray</A |
| 435 |
></DT |
| 436 |
><DT |
| 437 |
>3.4.8. <A |
| 438 |
HREF="helperfuncs.html#INTERNAL-DBD-REGISTER-DRIVER-CAP" |
| 439 |
>_dbd_register_driver_cap</A |
| 440 |
></DT |
| 441 |
><DT |
| 442 |
>3.4.9. <A |
| 443 |
HREF="helperfuncs.html#INTERNAL-DBD-REGISTER-CONN-CAP" |
| 444 |
>_dbd_register_conn_cap</A |
| 445 |
></DT |
| 446 |
><DT |
| 447 |
>3.4.10. <A |
| 448 |
HREF="helperfuncs.html#INTERNAL-DBD-PARSE-DATETIME" |
| 449 |
>_dbd_parse_datetime</A |
| 450 |
></DT |
| 451 |
><DT |
| 452 |
>3.4.11. <A |
| 453 |
HREF="helperfuncs.html#INTERNAL-DBD-ESCAPE-CHARS" |
| 454 |
>_dbd_escape_chars</A |
| 455 |
></DT |
| 456 |
><DT |
| 457 |
>3.4.12. <A |
| 458 |
HREF="helperfuncs.html#INTERNAL-DBD-ENCODE-BINARY" |
| 459 |
>_dbd_encode_binary</A |
| 460 |
></DT |
| 461 |
><DT |
| 462 |
>3.4.13. <A |
| 463 |
HREF="helperfuncs.html#INTERNAL-DBD-DECODE-BINARY" |
| 464 |
>_dbd_decode_binary</A |
| 465 |
></DT |
| 466 |
></DL |
| 467 |
></DD |
| 468 |
></DL |
| 469 |
></DD |
| 470 |
><DT |
| 471 |
>A. <A |
| 472 |
HREF="copying-fdl.html" |
| 473 |
>GNU Free Documentation License</A |
| 474 |
></DT |
| 475 |
></DL |
| 476 |
></DIV |
| 477 |
></DIV |
| 478 |
><DIV |
| 479 |
CLASS="NAVFOOTER" |
| 480 |
><HR |
| 481 |
ALIGN="LEFT" |
| 482 |
WIDTH="100%"><TABLE |
| 483 |
SUMMARY="Footer navigation table" |
| 484 |
WIDTH="100%" |
| 485 |
BORDER="0" |
| 486 |
CELLPADDING="0" |
| 487 |
CELLSPACING="0" |
| 488 |
><TR |
| 489 |
><TD |
| 490 |
WIDTH="33%" |
| 491 |
ALIGN="left" |
| 492 |
VALIGN="top" |
| 493 |
> </TD |
| 494 |
><TD |
| 495 |
WIDTH="34%" |
| 496 |
ALIGN="center" |
| 497 |
VALIGN="top" |
| 498 |
> </TD |
| 499 |
><TD |
| 500 |
WIDTH="33%" |
| 501 |
ALIGN="right" |
| 502 |
VALIGN="top" |
| 503 |
><A |
| 504 |
HREF="intro.html" |
| 505 |
ACCESSKEY="N" |
| 506 |
>Next</A |
| 507 |
></TD |
| 508 |
></TR |
| 509 |
><TR |
| 510 |
><TD |
| 511 |
WIDTH="33%" |
| 512 |
ALIGN="left" |
| 513 |
VALIGN="top" |
| 514 |
> </TD |
| 515 |
><TD |
| 516 |
WIDTH="34%" |
| 517 |
ALIGN="center" |
| 518 |
VALIGN="top" |
| 519 |
> </TD |
| 520 |
><TD |
| 521 |
WIDTH="33%" |
| 522 |
ALIGN="right" |
| 523 |
VALIGN="top" |
| 524 |
>Introduction</TD |
| 525 |
></TR |
| 526 |
></TABLE |
| 527 |
></DIV |
| 528 |
></BODY |
| 529 |
></HTML |
| 530 |
> |