js/main.js
// construct the sidebar to display the tables in the current database

construct the sidebar to display the tables in the current database
construct the sidebar to display the tables in the current database
function showTables() {
    var html = "",
        results = db.exec("SELECT `tbl_name` FROM `sqlite_master` WHERE `type`='table'")
    for (var i = 0; i < results[0].values.length; i++) {
        var tbl_name = results[0].values[i][0];
        var count = db.exec("SELECT COUNT(*) FROM `" + tbl_name + "`");
        html = html + '<li data-tbl-name="' + tbl_name + '"><a>' + tbl_name + '<span class="badge pull-right">' + count[0].values[0][0] + '</span></a></li>'
    }
    $('#tables-SQL').html(html)
}
function showTables ( ) { var html = "" , results = db . exec ( "SELECT `tbl_name` FROM `sqlite_master` WHERE `type`='table'" ) for ( var i = 0 ; i < results [ 0 ] . values . length ; i ++ ) { var tbl_name = results [ 0 ] . values [ i ] [ 0 ] ; var count = db . exec ( "SELECT COUNT(*) FROM `" + tbl_name + "`" ) ; html = html + '<li data-tbl-name="' + tbl_name + '"><a>' + tbl_name + '<span class="badge pull-right">' + count [ 0 ] . values [ 0 ] [ 0 ] + '</span></a></li>' } $ ( '#tables-SQL' ) . html ( html ) }
construct the sidebar to display the tables in the current database
construct the sidebar to display the tables in the current database