Class R.storage.AbstractDBStorage
Extends
R.storage.AbstractStorage.
R.storage.AbstractStorage is the base class of all storage objects.
Currently, The Render Engine supports three types of storage,
all with the ability to export their data remotely
and to import data from a remote source.
Defined in: abstractdbstorage.js.
Constructor Attributes | Constructor Name and Description |
---|---|
This base class is considered abstract and should not be
instantiated directly.
|
Method Attributes | Method Name and Description |
---|---|
createTable(name, def)
Create a new table to store data in.
|
|
dropTable(name)
Drop a table by its given name
|
|
execSql(sqlString, bindings)
Execute SQL on the storage object, which may be one of SELECT,
UPDATE, INSERT, or DELETE.
|
|
flush()
[ABSTRACT] Finalize any pending storage requests.
|
|
Get the data storage schema from the storage object.
|
|
getTableData(name)
Get the data object, for the given table.
|
|
getTableDef(name)
Get the schema object, for the given table.
|
|
setSchema(schema)
Set the data storage schema for the storage object.
|
|
setTableData(name, data)
Set the data, for the given table, in the storage.
|
|
tableExists(name)
Returns true if the table with the given name exists
|
- Methods borrowed from class R.storage.AbstractStorage:
- destroy, getClassName, getStorageObject, initStorageObject, loadData, release, saveData, setStorageObject
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.storage.AbstractDBStorage(name)
This base class is considered abstract and should not be
instantiated directly. See R.storage.TransientStorage,
R.storage.PersistentStorage, or R.storage.IndexedStorage for
implementations.
- Parameters:
- name
- {String} The name of the object
Method Detail
{Boolean}
createTable(name, def)
Create a new table to store data in.
- Parameters:
- name
- {String} The name of the table
- def
- {Object} Table definition object
- Returns:
- {Boolean}
true
if the table was created.false
if the table already exists or couldn't be created for another reason.
dropTable(name)
Drop a table by its given name
- Parameters:
- name
- {String} The name of the table to drop
{Object}
execSql(sqlString, bindings)
Execute SQL on the storage object, which may be one of SELECT,
UPDATE, INSERT, or DELETE.
- Parameters:
- sqlString
- {String} The SQL to execute
- bindings
- {Array} An optional array of bindings
- Returns:
- {Object} If the SQL is a SELECT, the object will be the result of the statement, otherwise the result will be a Boolean if the statement was successful.
flush()
[ABSTRACT] Finalize any pending storage requests.
{Array}
getSchema()
Get the data storage schema from the storage object.
- Returns:
- {Array} An array of tables for the storage object
{Object}
getTableData(name)
Get the data object, for the given table.
- Parameters:
- name
- {String} The name of the table
- Returns:
- {Object} The data object, or null if no table with the given name exists
{Object}
getTableDef(name)
Get the schema object, for the given table.
- Parameters:
- name
- {String} The name of the table
- Returns:
- {Object} The data object, or null if no table with the given name exists
setSchema(schema)
Set the data storage schema for the storage object.
- Parameters:
- schema
{Number}
setTableData(name, data)
Set the data, for the given table, in the storage.
- Parameters:
- name
- {String} The name of the table
- data
- {Object} The table data to store
- Returns:
- {Number} 1 if the data was stored, or 0 if the table doesn't exist
{Boolean}
tableExists(name)
Returns true if the table with the given name exists
- Parameters:
- name
- {String} The name of the table
- Returns:
- {Boolean}