Skip to content

Commit

Permalink
Add DB version
Browse files Browse the repository at this point in the history
  • Loading branch information
amitshekhariitbhu committed Jan 21, 2017
1 parent 3622173 commit 153ff4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions debug-db/src/main/assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("<a href='#' class='list-group-item' onClick='getData(\""+ tableList[count] + "\");'>" +tableList[count] + "</a>");
Expand Down
1 change: 1 addition & 0 deletions debug-db/src/main/java/com/amitshekhar/model/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class Response {
public List<String> columns = new ArrayList<>();
public boolean isSuccessful;
public String error;
public int dbVersion;

public Response() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -474,6 +473,11 @@ public Response getAllTableName() {
}
c.close();
response.isSuccessful = true;
try {
response.dbVersion = mDatabase.getVersion();
} catch (Exception ignore) {

}
return response;
}

Expand Down

0 comments on commit 153ff4f

Please sign in to comment.