Team LiB
Previous Section Next Section

Appendix G. C API Reference

This appendix describes the C language application programming interface for the MySQL client library. The API consists of a set of functions for communicating with MySQL servers and accessing databases, and a set of data types used by those functions. The client library functions may be classified into the following categories:

  • Connection management routines to establish and terminate connections to the server

  • Error-reporting routines to get error codes and messages

  • Statement construction and execution routines to construct SQL statements and send them to the server

  • Result set processing routines to handle results from queries that return data

  • Information routines that provide information about the client, server, protocol version, and the current connection

  • Transaction control routines

  • Routines for processing multiple result sets

  • Routines for server-side prepared statements

  • Administrative routines for controlling server operation

  • Thread routines for writing threaded clients

  • Routines for communicating with the embedded MySQL server, libmysqld

  • Routines for generating debugging information

Earlier editions of this book covered several routines that now are considered obsolete. These routines now are described in the Web addendum that is mentioned in the Introduction.

Unless otherwise indicated, the data types and functions listed here have been present in the client library at least as early as MySQL 4.1.0. Changes made since then are so noted.

This appendix serves as a reference, so it includes only brief code fragments illustrating use of the client library. For complete client programs and instructions for writing them, see Chapter 6, "Writing MySQL Programs Using C."

    Team LiB
    Previous Section Next Section