簡化 HTML5 Web 數據庫操作的JS模塊 - html5sql.js

fmms 12年前發布 | 41K 次閱讀 HTML5 JavaScript開發工具包

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.baiduhome.net/lib/view/home/1329610365765

 本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!