diff --git a/debug-db/src/main/assets/app.js b/debug-db/src/main/assets/app.js index 77d1f99..0b3297e 100644 --- a/debug-db/src/main/assets/app.js +++ b/debug-db/src/main/assets/app.js @@ -87,6 +87,10 @@ function openDatabaseAndGetTableList(db) { result = JSON.parse(result); var tableList = result.rows; + var dbVersion = result.dbVersion; + if("APP_SHARED_PREFERENCES" != db) { + $("#selected-db-info").text("Export Selected Database : "+db +" Version : "+dbVersion); + } $('#table-list').empty() for(var count = 0; count < tableList.length; count++){ $("#table-list").append("" +tableList[count] + ""); diff --git a/debug-db/src/main/java/com/amitshekhar/model/Response.java b/debug-db/src/main/java/com/amitshekhar/model/Response.java index 147956f..0b76ef9 100644 --- a/debug-db/src/main/java/com/amitshekhar/model/Response.java +++ b/debug-db/src/main/java/com/amitshekhar/model/Response.java @@ -32,6 +32,7 @@ public class Response { public List columns = new ArrayList<>(); public boolean isSuccessful; public String error; + public int dbVersion; public Response() { diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 862d645..55c26af 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -465,7 +465,6 @@ public Response getDBList() { public Response getAllTableName() { Response response = new Response(); Cursor c = mDatabase.rawQuery("SELECT name FROM sqlite_master WHERE type='table'", null); - if (c.moveToFirst()) { while (!c.isAfterLast()) { response.rows.add(c.getString(0)); @@ -474,6 +473,11 @@ public Response getAllTableName() { } c.close(); response.isSuccessful = true; + try { + response.dbVersion = mDatabase.getVersion(); + } catch (Exception ignore) { + + } return response; }