Giter Club home page Giter Club logo

The DBExplorer library helps you to preview content of SQL tables.

Download

API

The first step, add JitPack repository to your root build.gradle file (not module build.gradle file):

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

The second step, add the library to your module build.gradle:

dependencies {
    implementation 'com.github.vitoksmile:DBExplorer:1.0.0'
}

Usage

You can open a default table previewer or display this information inside your own UI.

Open DB preview via the library UI. Use the next methods to open DB file or show file picker to pick some file from device storage.

object DBExplorerUI {
    fun show(context: Context, localDbName: String)
	
    fun show(context: Context, file: File)
	
    fun show(context: Context, @RawRes resId: Int)
	
    fun showFilePicker(context: Context)
	
    fun showLocalDBPicker(context: Context)
}

Load data from DB and display inside your own UI.

object DBExplorer {
    suspend fun load(context: Context, config: DBConfig): DBResult
}

data class DBConfig(
    val resourceType: ResourceType
)

sealed class ResourceType {
    class LocalDB(val name: String) : ResourceType()

    class FileDB(val file: File) : ResourceType()

    class Stream(val stream: InputStream) : ResourceType()

    class RawResource(@RawRes val resId: Int) : ResourceType()
}

All loaded data will be returned inside DBResult object:

data class DBResult(
    /**
     * List of table names.
     */
    val tables: List<String>,

    /**
     * Map of table names and all columns for each table.
     */
    val tableColumns: Map<String, List<String>>,

    /**
     * Map of table names and all row's values for each table.
     */
    val tableRows: Map<String, List<List<String>>>
)

Victor Mykhailiv's Projects

ffmpeg-kit icon ffmpeg-kit

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.

healthkmp icon healthkmp

Wrapper for HealthKit on iOS and Google Fit and Health Connect on Android.

kotdil icon kotdil

The easy dependency injection framework for Kotlin developers.

pager icon pager

The Pager library makes it easier for you to load data gradually and gracefully within your app's RecyclerView.

secrets-vault-plugin icon secrets-vault-plugin

🛡️ Android Gradle plugin for enhanced secret management and protection. Keep app secrets secure and organized.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.