Next: Accessing the API Up: MySQL occam- API Previous: Tests and examples Contents

# Documentation of the API

The MySQL occam- API, or MoA for short, is built around the C API for MySQL. The API is developed for version 5.1 of the MySQL server, and is not guaranteed to work with older versions. MoA allows applications written in occam- to communicate with a MySQL server. It consists mainly of a pre-defined process definition, `MySQL`, with which you can create processes for communicating with a MySQL server. This is done by sending and receiving messages in the protocols `MYSQL.CONTROL` and `MYSQL.RESULT`. In addition, there is an initialising and a finalizing process, which will be of interest if you are to have more than one connection to MySQL open at a time. Note that, at the present, only the core functionality of the C API is available in MoA.

Subsections

- Accessing the API
- Overview of the protocols
- An example program: `simple.occ`
- The `MySQL.init` process
  - Signature
  - Usage
    - Errors
- The `MySQL.end` process
  - Signature
  - Usage
- The `MySQL` process
  - Signature
  - Usage
    - Answer
    - Errors
- Communication with the `MySQL` process
  - `query; MOBILE []BYTE`
    - Answer
    - Errors
  - `query.row; MOBILE []BYTE`
    - Answer
    - Errors
  - `query.all; MOBILE []BYTE`
    - Answer
    - Errors
  - `next.row`
    - Answer
    - Errors
  - `remaining.rows`
    - Answer
    - Errors
  - `affected.rows`
    - Answer
    - Errors
  - `null.values`
    - Answer
    - Errors
  - `field.names`
    - Answer
    - Errors
  - `field.info; BYTE`
    - Answer
  - `reconnect`
    - Answer
    - Errors
  - `quit`
    - Answer
    - Errors