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.
The sqlExec Options
The plugin wraps the query operations using the following API:
$("#selector").sqlExec(options);The
- what database operation to perform
- what SQL to execute
- what to do with the results
- what to do with errors
$("#selector").sqlExec({ // specify the SequelSphereDB operation op: "query", // specify the SQL to be executed sql: "SELECT * FROM EMPL", -or- parameterizedSQL: "SELECT * FROM EMPL WHERE EMPL_ID={0}", args: [2], // specify what to do with the results success: function(selected, results, options) {}, -or- dataKey: "my-key", -or- 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.