Tutorials & ManualsSQL YogaSQL Yoga Database ObjectsIntroduction to the Database Object and Database Schema

Introduction to the Database Object and Database Schema

The Database Object

The Database Object

The Database object is the base SQL Yoga object. Each Database object represents a one database schema but can connect to numerous databases that have that schema. If you have two different database schemas you will need two Database objects.

All other SQL Yoga objects are:

1) Stored within the Database object, or

2) Derived from information stored in the Database object.

Any objects that are stored within the Database object are saved when calling dbobject_save. Objects not stored within the Database object, such a a SQL Query object, will not be.

How A Database Object is Represented in Memory and Storing Them

Like all SQL Yoga objects, the Database object is stored as an array. Each Database object is stored in memory as part of a script local variable in the SQL Yoga library.

In order to permanently save the Database object array SQL Yoga allows you to specify a file or Revolution button where you can store the array. For more information please see the storage file and storage object properties in the dbobject_set API documentation.

When you need to load a Database object into memory from a file or button you can use the dbobject_createFromFile or dbobject_createFromObject commands.

The Database Schema

The Database Schema

A Database object stores the schema of the database in an internal Schema object. The information about the database tables and fields stored in the Schema object is what enables many of SQL Yoga's features.

The Schema object is created the first time you connect to a database. If the database schema changes at any time you will need to tell SQL Yoga to refresh the Schema object. This can be done by calling the command dbobject_reloadSchema.

Refer to the API documention for Database objects for all handlers and properties available.


Add your comment

E-Mail me when someone replies to this comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.