Gamma/MySQL

Using Gamma™ with MySQL, Version 1.1

March 27, 2008

Gamma binds a useful subset of MySQL functions, and gives object-oriented access to a MySQL database. The Gamma/MySQL bindings and this document are being made available as a beta release.

Cogent software is source-code compatible among the Linux, QNX 6, and QNX 4 operating systems.
Go to the Cogent Web Site.
Copyright, trademark, and software license information.

Table of Contents


1. Introduction
1.1. System Requirements
1.2. Cogent Product Integration
1.3. Where can I get help?

2. Tutorials
2.1. Tutorial 1: Interactive Session
2.2. Tutorial 2: create_pets.g
2.3. Tutorial 3: create_foodsinc.g
2.4. Example function: table_list.g
2.5. Example function: query_table.g

3. Classes
MYSQL - the connection to the database.
MYSQL_FIELD - information about a field.
MYSQL_OPTIONS - available options.
MYSQL_RES - the result of a query.
MYSQL_ROWS - rows of data.

4. Methods and Functions Unique to Gamma
MYSQL.add_column - adds a new column to a table.
MYSQL.classes_from_tables - creates an array of Gamma classes from all tables.
MYSQL.class_from_table - creates a Gamma class from a table.
MYSQL.create_table - creates a new, single-column table.
MYSQL.delete - deletes a row from a table.
MYSQL.drop_table - deletes a table from the database.
MYSQL.insert - inserts a new row into a table.
MYSQL.query_and_store - queries a database and stores the results.
MYSQL.query_to_class - maps query results to class instances.
MYSQL.query_to_temp_class - maps query results to instance variables of a temporary class.
MYSQL.requery - updates a row by querying the database.
MYSQL.update - updates the database with the values in a row.
MYSQL_RES.Data - replaces the MYSQL_RES.data field.
mysql_class_from_fields - creates a class to hold data of future SQL queries.
mysql_pretty_print - prints a table of rows from a query.
mysql_map_class - maps fields and data onto an existing Gamma class.
mysql_value_string - converts a Gamma value into a string for use in an SQL statement.

5. Functions that Access Global Variables
max_allowed_packet functions - get or set the maximum data packet size.
port functions - get or set the port number.
net_buffer_length functions - get or set the net buffer length.

6. See MySQL Documentation
6.1. Gamma Functions for MySQL C API Functions
6.2. Gamma Methods for MySQL C API Functions
6.3. Other Functions and Methods

A. GNU General Public License
B. GNU Lesser General Public License
Index