简化 HTML5 Web 数据库操作的JS模块 - html5sql.js

fmms 12年前

html5sql 是一个轻量级的 JS 模块用于简化处理 HTML5 Web 数据库操作。其主要功能就是提供一个 SEQUENTIAL 结构用来在单事务中处理 SQL 语句。它提供了以下一些功能特性:

  1. Provide the capability to sequentially process SQL in many different forms:
    • As a single SQL statement string.
    • As an array of SQL statement strings.
    • As an array of SQL statement objects (if you want to inject data into the SQL or get a callback after each SQL statement is processed)
    • As a string containing multiple SQL statements, each of which ends in a semicolon.
    • From a completely separate file containing SQL statements.
  2. Provide a framework for controlling the version of a database.

示例代码:

$.get('Setup-Tables.SQL',function(sqlStatements){      html5sql.process(          //This is the text data from the SQL file you retrieved          sqlStatements,          function(){              // After all statements are processed this function              //   will be called.          },          function(error){              // Handle any errors here          }      );  });

项目主页:http://www.open-open.com/lib/view/home/1329610365765