MYSQL.classes_from_tables

MYSQL.classes_from_tables — creates an array of Gamma classes from all tables.

Syntax

MYSQL.classes_from_tables (superclass, verbose?=nil)

Arguments

superclass

The superclass for the newly created class, or nil.

verbose

If non-nil, will cause each table name to be printed as it is processed.

Returns

An array of the classes created, or nil.

Description

This method of the MYSQL class queries the database represented by MYSQL for all of the table names, and creates a class corresponding to each table, with each table's column names mapped as instance variables for the corresponding class. It is possible for some of the entries in the return array to be nil if the creation of a particular class corresponding to a table fails.

This method is defined in the Gamma library /usr/cogent/require/MySQLSupport.g. It is made available to a Gamma program with the statement: require("MySQLSupport");.