Class Index

Classes


v1.2.1

TableProvider

This is an "Interface" that can be implemented to provide user-defined (Non-SequelSphere) tables for the SequelSphereDB engine to include in SQL queries. The purpose for this most incredible interface is to allow 3rd party framework data storage mechanisms the ability to participate in SQL queries. Yes... It really is that cool.

Implementations of this class should return a custom IterableTable object that provides the data for a table in an Iterable manner. Please see the documentation for IterableTable for full details on how to implement.

If all you want to do is have your own tables, then use the SequelSphereDB API for creating tables: DBCatalog#createTable . If, however, you need to include tabular data stored in some other mechanism, then implementing this class and the associated IterableTable Interface will provide that capability.

"Implementing" this interface can be done by creating a single method #getIterableTable ():

	var myTableProvider = {
	    getIterableTable: function(tabName) {
	        if (tabName == "MYTABLE")
	            return new MyIterableTable();
	        return null;
	    }
	};
	

Adding it to the SequelSphereDB engine is as follows:

	db.addTableProvider(myTableProvider);
	

Implementation Notes

Summary
Constructor Attributes Constructor Name and Description
This "Interface" should be implemented to provide user-defined tables for the SequelSphereDB engine to include in SQL queries.
Method Summary
Method Attributes Method Name and Description
getIterableTable (tableName)
This method returns a custom implementation of the IterableTable class to provide the SequelSphereDB engine a manner for including 3rd party tabular data inside a query.
Detail
TableProvider ()
This "Interface" should be implemented to provide user-defined tables for the SequelSphereDB engine to include in SQL queries.
See:
IterableTable
DB#addTableProvider
Method Detail
{ IterableTable } getIterableTable (tableName)
This method returns a custom implementation of the IterableTable class to provide the SequelSphereDB engine a manner for including 3rd party tabular data inside a query.

	// Create your own IterableTable Object here
	function MyIterableTable() { ... }

	// Create a TableProvider to return your IterableTable
	var myTableProvider = {
	    getIterableTable: function(tabName) {
	        if (tabName == "MYTABLE")
	            return new MyIterableTable();
	        return null;
	    }
	};
	

Implementation Notes:

Parameters:
{string} tableName
The name of the table in ALL CAPS.
Returns:
{ IterableTable } A IterableTable object, for the provided tableName , or null if that table isn't supported.
See:
IterableTable
DB#addTableProvider

©2012 Sequel Sphere, LLC.