PeekDatabase-V2


Simple way to peek your DB Sql without third party app.


Content List


Download

Add maven jitpack.io and dependencies in build.gradle (Project) :

// build.gradle project
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

// build.gradle app/module
dependencies {
  ...
  implementation 'com.github.gzeinnumer:PeekDatabase-V2:version'
}

Feature List


Tech stack and 3rd library


Usage

Show All Tables

Show All table for sqlite

Java

//with sqlite
SQLiteDatabase sqLiteDatabase = DBInstance.getDataBase(getApplicationContext());
//with room
//SQLiteDatabase appDatabase = AppDatabase.getDatabase(getApplicationContext()).getSQLiteDB(getApplicationContext());

btn.setOnClickListener(view -> {
    DialogTableBuilder
            .newInstanse(this, sqLiteDatabase)
            .build();
});
//spesial for Room
public SQLiteDatabase getSQLiteDB(Context context) {
    return SQLiteDatabase.openDatabase(context.getDatabasePath(dbName).getPath(),null,SQLiteDatabase.OPEN_READWRITE);
}

Show spesific

DialogTableBuilder
    .newInstanse(this, sqLiteDatabase)
    .addTable("table1")
    .build();
String[] tables = {
    "table1",
    "table2"
};
DialogTableBuilder
    .newInstanse(this, GblVariabel.myDb)
    .addTable(tables)
    .build();

Example Code/App

Sample Code


Version

  • 1.0.0
    • First Release

Contribution

You can sent your constibution to branch open-pull.

Fore More All My Library


Copyright 2022 M. Fadli Zein