SequelSphereDB / jQuery Connector Overview

SequelSphere has created a "Connector" between jQuery and SequelSphereDB in the form of a jQuery plugin sqlExec . This connector enables SQL to be used for query the SequelSphereDB database in a form typical in a jQuery application.

sqlExec Plugin

The sqlExec . This partial wrapper for SequelSphereDB provides an interface that is more in line with how jQuery applications are developed. In particular, it supports the following capabilities:

  • supports all SequelSphereDB query operations and update/insert/delete operations.
  • smooth integration with jQuery .data(). The plugin supports executing a query and binding the results to the DOM objects matching the jQuery selector.
  • smooth integration with jQuery events. The plugin supports execting a query and triggering an event with the results on the DOM objects matching the jQuery selector
  • callback "success" function. The plugin supports executing a query and passing the results to a callback "success" function for each DOM object matching the jQuery selector
  • supports update, insert, save and delete operations.
Catalog operations, like create table, are not supported by the plugin. These operations are not likely to require an operation scoped to a DOM object, so can be invoked directly using the SequelSphereDB API.

The sqlExec Options

The plugin wraps the query operations using the following API:

The options argument is an object that controls
  • what database operation to perform
  • what SQL to execute
  • what to do with the results
  • what to do with errors
The following shows how the plugin is invoked:
	// specify the SequelSphereDB operation
	op: "query",
	// specify the SQL to be executed
	parameterizedSQL: "SELECT * FROM EMPL WHERE EMPL_ID={0}",
	args: [2],
	// specify what to do with the results
	success: function(selected, results, options) {},
	dataKey: "my-key", 
	eventKey: "my-event"
	// specify what to do with errors
	error: function(err, options) { }

See the Usage Notes for more information on how to use the plugin.