A helper library to help using Room with existing pre-populated database [].

Overview

Room now supports using a pre-packaged database out of the box, since version 2.2.0

https://developer.android.com/jetpack/androidx/releases/room#2.2.0

As the built-in Room support is limited here's a library that supports migration as well as keeping specified columns that eg contain userdata.

https://github.com/ueen/RoomAssetHelper

RoomAsset

An Android helper class to manage database creation and version management using an application's raw asset files.

This library provides developers with a simple way to ship their Android app with an existing SQLite database (which may be pre-populated with data) and to manage its initial creation and any upgrades required with subsequent version releases.

It is implemented as an extension to Room, providing an easy way to use Room with an existing SQLite database.


Gradle Dependency

Codacy Badge Android Arsenal License

Dependency

Add this to your module's build.gradle file (make sure the version matches the last release):

Add it in your root build.gradle at the end of repositories:

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

Add the dependency

dependencies {
    // ... other dependencies
    implementation 'com.github.humazed:RoomAsset:1.0.3'
}

RoomAsset is intended as a drop in alternative for the framework's Room.

You can use RoomAsset as you use Room but with two changes:

  1. Use RoomAsset.databaseBuilder() instead of Room.databaseBuilder()
  2. In @Database use version = 2 instead of version = 1
  val db = RoomAsset.databaseBuilder(applicationContext, AppDatabase::class.java, "chinook.db").build()
  val employees = db.chinookDao().employees

RoomAsset relies upon asset file and folder naming conventions. Your assets folder will either be under your project root, or under src/main if you are using the default gradle project structure. At minimum, you must provide the following:

  • A databases folder inside assets
  • A SQLite database inside the databases folder whose file name matches the database name you provide in code (including the file extension, if any)

For the example above, the project would contain the following:

assets/databases/chinook.db

The database will be extracted from the assets and copied into place within your application's private data directory. If you prefer to store the database file somewhere else (such as external storage) you can use the alternate constructor to specify a storage path. You must ensure that this path is available and writable whenever your application needs to access the database.

  val db = RoomAsset.databaseBuilder(applicationContext, AppDatabase::class.java, "chinook.db",
        applicationContext.getExternalFilesDir(null).absolutePath).build()

The library will throw a SQLiteAssetHelperException if you do not provide the appropriately named file.

Supported data types: TEXT, INTEGER, REAL, BLOB

The sample project demonstrates a simple database creation and usage example using the classic Chinook database.

License

Copyright (C) 2011 readyState Software Ltd
Copyright (C) 2007 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • RoomAsset does not seem to load Database [request for help]

    RoomAsset does not seem to load Database [request for help]

    Hello, first let me thank you for creating this package that I find really helpful. However I cannot seem to make it work. It seems to me that the database is not loaded, since any query returns nothing, although the database is populated. Furthermore, nothing in the console says that the database was loaded, and the same thing happens if I change the name parameter of RoomAsset.databaseBuilder() to a dummy name of a non-existent file. No exceptions are ever thrown and the app does not crash.

    TL;DR: regardless of the name of the DB I give to RoomAsset.databaseBuilder(), I get no exceptions but all queries return nothing as if the DB was not populated.

    This is my database class file in Java:

    package com.mypackage.myapp; 
    
    import android.arch.persistence.db.SupportSQLiteDatabase;
    import android.arch.persistence.room.Database;
    import android.arch.persistence.room.Room;
    import android.arch.persistence.room.RoomDatabase;
    import android.arch.persistence.room.migration.Migration;
    import android.content.Context;
    
    import com.huma.room_for_asset.RoomAsset;
    
    @Database(entities = {Task.class}, version = 2)
    public abstract class AppDatabase extends RoomDatabase {
        private static AppDatabase INSTANCE;
        public abstract TaskDao taskDao(); //TaskDao is my Dao interface
        public static AppDatabase getAppDatabase(Context context) {
            if (INSTANCE == null) {
                INSTANCE =
                        RoomAsset.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "tasksdb.db") .build(); //tasksdb.db is the name of the database file that is in src/main/assets/databases
            }
            return INSTANCE;
        }
        public static void destroyInstance() {
            INSTANCE = null;
        }
    

    This is how the DB is created and queried in an activity

    package com.mypackage.myapp;
    
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.TextView;
    
    import java.util.List;
    
    public class DBActivity extends AppCompatActivity {
        AppDatabase mDB;
        private TextView tvContent;
        private Button btnNext;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_db);
            mDB = AppDatabase.getAppDatabase(this);
            tvContent=(TextView) findViewById(R.id.tvContent);
            btnNext=(Button)findViewById(R.id.btnNext);
            btnNext.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            final List<Task> testlist = mDB.taskDao().loadAllTasks(); //loadAllTasks is a method defined in my Dao that returns a list of Task, which is my entity class representing one of the tables in the db
                            runOnUiThread(new Runnable() {
                                @Override
                                public void run() {
                                    tvContent.setText(String.valueOf(testlist.size()) );
                                }
                            });
                        }
                    }).start();
                }
            });
    
        }
    }
    

    In my build.gradle for the app module is:

    dependencies {
        //other dependencies unrelated to Room or RoomAsset
        //...
        compile 'android.arch.persistence.room:runtime:1.0.0'
        annotationProcessor 'android.arch.persistence.room:compiler:1.0.0'
        implementation 'com.github.humazed:RoomAsset:v1.0'
    }
    

    and in my root build.gradle I added maven to the repositories as you explained in the readme.

    What is wrong?

    help wanted 
    opened by giuliofoletto 9
  • Failed database migration validation

    Failed database migration validation

    When I try to open the database for the first time with RoomAsset, the migration validation fails. I see that the columns order is not the same between what is expected and what is found. I don't know how the columns order are determined.

    java.lang.IllegalStateException: Migration didn't properly handle products(com.garnier.garnier.manager.catalog.database.entities.Product).

    Expected: TableInfo{name='products', columns={description=Column{name='description', type='TEXT', notNull=false, primaryKeyPosition=0}, tutorialUrl=Column{name='tutorialUrl', type='TEXT', notNull=false, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=1}, eanBarcode=Column{name='eanBarcode', type='INTEGER', notNull=false, primaryKeyPosition=0}, brandId=Column{name='brandId', type='INTEGER', notNull=false, primaryKeyPosition=0}, name=Column{name='name', type='TEXT', notNull=false, primaryKeyPosition=0}, shadeId=Column{name='shadeId', type='INTEGER', notNull=false, primaryKeyPosition=0}}, foreignKeys=[], indices=[]}
    
    Found: TableInfo{name='products', columns={tutorialURL=Column{name='tutorialURL', type='TEXT', notNull=false, primaryKeyPosition=0}, description=Column{name='description', type='TEXT', notNull=false, primaryKeyPosition=0}, eanBarcode=Column{name='eanBarcode', type='INTEGER', notNull=false, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=1}, name=Column{name='name', type='TEXT', notNull=false, primaryKeyPosition=0}, brandId=Column{name='brandId', type='INTEGER', notNull=false, primaryKeyPosition=0}, shadeId=Column{name='shadeId', type='INTEGER', notNull=false, primaryKeyPosition=0}}, foreignKeys=[], indices=[]}
    
    help wanted 
    opened by MrLepage 7
  • Mapping Pre-populated database with column type NUMERIC

    Mapping Pre-populated database with column type NUMERIC

    Hello,

    I have a pre-populated database with a column type NUMERIC and it seems that I cannot find an appropriated java type to map it. Just wonder how do I define my entity class to map this column?

    This is the create statement:

    CREATE TABLE function01tree (
    fun_order NUMERIC,
    fun_type INTEGER,
    fun_no INTEGER PRIMARY KEY,
    fun_parent_no INTEGER,
    fun_descript TEXT,
    fun_level INTEGER)
    

    Thanks for the great library

    opened by cac-william 5
  • How can I do migration using this library

    How can I do migration using this library

    I have one app with some pre-filled data. now in-app update I need to replace the old DB file with the new one from the asset. Is it done by the library or I need to do extra effort?

    opened by a1993k 5
  • When storage path is specified, queries come back empty.

    When storage path is specified, queries come back empty.

    Repro steps: +) cloned your repo, builded successfully and verified the employers and customers are queried +) added a storage path (apps data directory) to the instantiation : /storage/emulated/0/Android/data/com.huma.roomforasset/files/db/ (both in java and kt) +) added READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permission +) after uninstall and reinstall i can see the db in the expected folder. employees and customers table are not empty as expected +) clicking on the buttons "employees" and "customers" now results in empty tables.

    Any ideas whats going on, did i miss sth.? Anyway thanks for your lib and your effort.

    opened by whatmattersmost 4
  • Problem with JAR Files

    Problem with JAR Files

    This is my dependencies:

    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
        implementation 'androidx.core:core-ktx:1.1.0-alpha03'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        implementation 'com.google.android.material:material:1.1.0-alpha02'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test:runner:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
        implementation 'com.github.humazed:RoomAsset:1.0.3'
        implementation 'android.arch.lifecycle:extensions:1.1.1'
        implementation 'android.arch.lifecycle:viewmodel:1.1.1'
        kapt "android.arch.lifecycle:compiler:1.1.1"
        implementation "android.arch.persistence.room:runtime:$arch_version"
        annotationProcessor "android.arch.persistence.room:compiler:$arch_version"
        kapt "android.arch.persistence.room:compiler:$arch_version"
    }
    

    This is the error message:

    w: /home/lobothijau/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar: kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
    

    screenshot from 2019-01-20 22-03-04

    I'm following the code from the sample, but it still doesn't work. I have tried to only use RommAsset dependecy, but it also didn't work. What probably I did wrong?

    opened by lobothijau 2
  • Exception on initializing database from assset

    Exception on initializing database from assset

    Hi i have a problem to use this library

    when i call RoomAsset.databaseBuilder(context.getApplicationContext(), AppDatabase.class, DB_NAME) .build();

    i get this RuntimeError: **java.lang.NoClassDefFoundError: Failed resolution of: Lcom/readystatesoftware/sqliteasset/SQLiteAssetHelper**; at com.huma.room_for_asset.RoomAsset$Companion.openDb(RoomAsset.kt:63) at com.huma.room_for_asset.RoomAsset$Companion.databaseBuilder(RoomAsset.kt:45) at com.huma.room_for_asset.RoomAsset$Companion.databaseBuilder$default(RoomAsset.kt:42) at com.huma.room_for_asset.RoomAsset.databaseBuilder(RoomAsset.kt)

    opened by nasrabadiAM 2
  • Hi.I addCallback like this,but it's not call onCreate(), But onOpen() .it's have.Please tell me why.Thanks a  lot

    Hi.I addCallback like this,but it's not call onCreate(), But onOpen() .it's have.Please tell me why.Thanks a lot

    return RoomAsset.databaseBuilder(appContext, AppDatabase.class, DATABASE_NAME) .addCallback(new Callback() { @Override public void onCreate(@NonNull SupportSQLiteDatabase db) { super.onCreate(db); Log.d("RoomAsset:------", "onCreate"); }

                    @Override
                    public void onOpen(@NonNull SupportSQLiteDatabase db) {
                        super.onOpen(db);
                        Log.d("RoomAsset:------", "onOpen");
                    }
                })
                .build();
    
    opened by HarryHaiVn 1
  • <Help Needed> Encrypted Database file support ?

    Encrypted Database file support ?

    This isn't an issue : i know Room doesn't support encryption , but this library https://github.com/commonsguy/cwac-saferoom does and it works perfectly . is it possible to use RoomAsset to load a a pre-populated Encrypted SQLite database file from the assets folder . any help with that ? thanks .

    opened by 0v3rfl00w 0
  • Compatibility with Room v 1.1.1 ?

    Compatibility with Room v 1.1.1 ?

    With this error:

    constructor RoomOpenHelper in class RoomOpenHelper cannot be applied to given types; required: DatabaseConfiguration,Delegate,String found: DatabaseConfiguration,,String,String reason: actual and formal argument lists differ in length

    and by this initialization:

    RoomAsset.databaseBuilder(context!!.applicationContext, MyDatabase::class.java, "appname.v4.db") .fallbackToDestructiveMigration() .build()

    I think there might be a difference between the constructor in Room and the one this lib is using.

    Thanks for the great work.

    opened by mrahimygk 4
  • Migration didn't properly handle <table_name>

    Migration didn't properly handle

    I have a stored sqlite file from an old android app that I am putting into a new android app. Part of the upgrade process I am upgrading it to use Room. I found this because I needed it to read from an existing file. The problem is, every time I try to run the app in an emulator I am getting the Migration failed error. Here is the error...

    java.lang.IllegalStateException: Migration didn't properly handle vegetables_table(com.androidtests.roomdemo.models.Vegetable).
                       Expected:
                      TableInfo{name='vegetables_table', columns={grams_in_cup=Column{name='grams_in_cup', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=0}, name=Column{name='name', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=1}, long_desc=Column{name='long_desc', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}, com_name=Column{name='com_name', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}}, foreignKeys=[], indices=[]}
                       Found:
                      TableInfo{name='vegetables_table', columns={}, foreignKeys=[], indices=[]}
    

    However, I can open the database in DB Browser for SQLite and it shows all of the columns and data in the vegetables_table schema, You can see from the screenshot that all of the columns are there. This is the exact file that is in my android project, but RoomAsset is saying there are no columns in the database, even though there are columns and data in the database. Any ideas? screen shot 2018-08-31 at 1 24 44 pm

    opened by danwguy 5
  • Can't downgrade read-only database from version 2 to 1

    Can't downgrade read-only database from version 2 to 1

    Hello! Trying to create pre-populated database. My Database @Database(entities = {Series.class}, version = 2, exportSchema = false) ... public static AppDatabase getDatabase(Context context) { if (INSTANCE == null) { synchronized (AppDatabase.class) { if (INSTANCE == null) { INSTANCE = RoomAsset.databaseBuilder(context, AppDatabase.class, DB_NAME) .allowMainThreadQueries() .build(); } } } return INSTANCE; }

    Problem is: `I/SQLiteAssetHelper: successfully opened database cymbalsbase.db

    W/SQLiteAssetHelper: Can't downgrade read-only database from version 2 to 1:

    Upgrading database cymbalsbase.db from version 2 to 1...

    missing database upgrade script: databases/cymbalsbase.db_upgrade_0-1.sql

    E/SQLiteAssetHelper: no upgrade script path from 2 to 1

    D/AndroidRuntime: Shutting down VM

    E/AndroidRuntime: FATAL EXCEPTION: main`

    What can i do?

    help wanted 
    opened by AlexSuvorov2k 5
  • RoomAsset will only properly initialize one database?

    RoomAsset will only properly initialize one database?

    I was having an issue with RoomAsset not migrating the contents of my pre-loaded database to the usable Room database, so I dug through the code and found what I believe to be the culprit:

    /**
    * Open the database and copy it to data folder using [SQLiteAssetHelper]
    */
    private fun openDb(context: Context, name: String, storageDirectory: String?, factory: SQLiteDatabase.CursorFactory?) {
        val instantiated = "instantiated"
        val sharedPref = context.defaultSharedPreferences
    
        if (!sharedPref.getBoolean(instantiated, false)) {
            SQLiteAssetHelper(context, name, storageDirectory, factory, 1).writableDatabase.close()
            sharedPref.edit().putBoolean(instantiated, true).apply()
            Log.w(TAG, "RoomAsset is ready ")
        }
    }
    

    This method checks if there's a boolean value stored in SharedPreferences with the key "instantiated", and only migrates the contents if that value is false or does not yet exist. Now, my problem did not technically arise from trying to use multiple pre-populated databases, but rather from trying to overwrite the old one with one with a different name. However, I plan to have multiple in the future and can see the same problem arising - namely, that the database simply does not get filled in because RoomAsset thinks its job is already done.

    I managed to work around it in my current situation by recording the name of my database myself in SharedPreferences, and resetting the "instantiated" key to false any time the name changes. However, it will become much more of a pain once I have multiple databases included, since I will have to keep resetting before initially migrating each one.

    The problem stems from the quite non-descriptive and entirely non-unique key used for recording whether RoomAsset has initialized the database yet. Rather than simply "instantiated", it should be changed to something unique (both to RoomAsset, to prevent potential conflicts form other non-unique key values, and to the database, to allow multiple pre-populated databases without janky workarounds). For example, particularly since the name of the database is already passed to the method, this line:

    val instantiated = "instantiated"
    

    could be changed to something like:

    val instantiated = "RoomAsset.instantiated." + name
    

    This would be a super easy change, and if I had the time I'd just do a pull request for it but I don't for now.

    opened by VerumCH 4
  • Initial database access fails; migration not properly handled due to difference in Indices

    Initial database access fails; migration not properly handled due to difference in Indices

    In the same vein as a couple of the other issues, I'm encountering a runtime error when attempting to open my database for the first time. However, my issue is that despite my own SQL-created database and my Room-generated database appearing to perfectly coincide, I get an error saying migration was not properly handled. And the problem is, I have no idea what the difference is because the "Found:" line in the error message is truncated part of the way through. I'm unsure if this is an actual real issue with the database representation being broken, or simply an issue with the error message for some reason.

    Here's what I see:

    Caused by: java.lang.IllegalStateException: Migration didn't properly handle Assist(<package name>).
                       Expected:
                      TableInfo{name='Assist', columns={effect=Column{name='effect', type='TEXT', notNull=true, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=1}, dance=Column{name='dance', type='INTEGER', notNull=true, primaryKeyPosition=0}, heal=Column{name='heal', type='INTEGER', notNull=true, primaryKeyPosition=0}, name=Column{name='name', type='TEXT', notNull=true, primaryKeyPosition=0}, range=Column{name='range', type='INTEGER', notNull=true, primaryKeyPosition=0}, predecessor=Column{name='predecessor', type='TEXT', notNull=false, primaryKeyPosition=0}, sp_cost=Column{name='sp_cost', type='INTEGER', notNull=true, primaryKeyPosition=0}}, foreignKeys=[ForeignKey{referenceTable='Assist', onDelete='NO ACTION', onUpdate='NO ACTION', columnNames=[predecessor], referenceColumnNames=[name]}], indices=[Index{name='index_Assist_predecessor', unique=false, columns=[predecessor]}, Index{name='index_Assist_name', unique=true, columns=[name]}]}
                       Found:
                      TableInfo{name='Assist', columns={effect=Column{name='effect', type='TEXT', notNull=true, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=1}, dance=Column{name='dance', type='INTEGER', notNull=true, primaryKeyPosition=0}, heal=Column{name='heal', type='INTEGER', notNull=true, primaryKeyPosition=0}, name=Column{name='name', type='TEXT', notNull=true, primaryKeyPositio
    

    Any ideas?

    For reference, the relevant portion of my SQL database generation:

    CREATE TABLE 'Assist' (
      'id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      'name' TEXT NOT NULL UNIQUE,
      'range' INTEGER NOT NULL DEFAULT 1,
      'effect' TEXT NOT NULL,
      'sp_cost' INTEGER NOT NULL,
      'heal' INTEGER NOT NULL DEFAULT 0,
      'dance' INTEGER NOT NULL DEFAULT 0,
      'predecessor' TEXT NULL,
    
      -- Foreign Keys
      FOREIGN KEY (predecessor) REFERENCES 'Assist' ('name')
    );
    

    and my Room entity class:

    @Entity (   indices = { @Index(value = "name", unique = true),
                            @Index(value = "predecessor")},
                foreignKeys = @ForeignKey(  entity = Assist.class,
                                            parentColumns = "name",
                                            childColumns = "predecessor"))
    public class Assist {
    
        @PrimaryKey (autoGenerate = true)
        public int id;
    
        @NonNull
        public String name;
    
        public int range;
    
        @NonNull
        public String effect;
    
        @ColumnInfo(name = "sp_cost")
        public int spCost;
    
        public int heal;
    
        public int dance;
    
        public String predecessor;
    
    }
    

    EDIT -- Running on a different virtual device (Pixel 2 API 26, was running Nexus 6 API 23) gives me the full error message. Here's what it shows now:

                       Expected:
                      TableInfo{name='Assist', columns={effect=Column{name='effect', type='TEXT', notNull=true, primaryKeyPosition=0}, name=Column{name='name', type='TEXT', notNull=true, primaryKeyPosition=0}, heal=Column{name='heal', type='INTEGER', notNull=true, primaryKeyPosition=0}, range=Column{name='range', type='INTEGER', notNull=true, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=1}, sp_cost=Column{name='sp_cost', type='INTEGER', notNull=true, primaryKeyPosition=0}, predecessor=Column{name='predecessor', type='TEXT', notNull=false, primaryKeyPosition=0}, dance=Column{name='dance', type='INTEGER', notNull=true, primaryKeyPosition=0}}, foreignKeys=[ForeignKey{referenceTable='Assist', onDelete='NO ACTION', onUpdate='NO ACTION', columnNames=[predecessor], referenceColumnNames=[name]}], indices=[Index{name='index_Assist_name', unique=true, columns=[name]}, Index{name='index_Assist_predecessor', unique=false, columns=[predecessor]}]}
                       Found:
                      TableInfo{name='Assist', columns={effect=Column{name='effect', type='TEXT', notNull=true, primaryKeyPosition=0}, name=Column{name='name', type='TEXT', notNull=true, primaryKeyPosition=0}, heal=Column{name='heal', type='INTEGER', notNull=true, primaryKeyPosition=0}, range=Column{name='range', type='INTEGER', notNull=true, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=1}, sp_cost=Column{name='sp_cost', type='INTEGER', notNull=true, primaryKeyPosition=0}, predecessor=Column{name='predecessor', type='TEXT', notNull=false, primaryKeyPosition=0}, dance=Column{name='dance', type='INTEGER', notNull=true, primaryKeyPosition=0}}, foreignKeys=[ForeignKey{referenceTable='Assist', onDelete='NO ACTION', onUpdate='NO ACTION', columnNames=[predecessor], referenceColumnNames=[name]}], indices=[]}
    

    So the difference is in the indices. However, Room needs those indices to work properly. How do I make equivalents via SQL?

    opened by VerumCH 7
Releases(1.0.3)
Owner
Ibrahim Eid
Mobile Developer (Flutter + Android). My Apps Apps: https://play.google.com/store/apps/developer?id=Humazed
Ibrahim Eid
A library for reading Shared Preferences and Database values within the application.

AppDataReader A library for reading and writing Shared Preferences and Database values of the application within the device. Advantages of using this

Anshul Jain 124 Nov 25, 2022
A quick and easy database manager plugin library for your DBFlow databases.

DBFlowManager A quick and easy database manager and viewer plugin library for your DBFlow databases to view, insert, delete, update the tables directl

Wajahat Karim 26 Oct 21, 2022
A small library to help with Realm.IO integration in Android apps

Android Realm Asset Helper A small library of methods to help with Realm.IO integration in Android apps Copies a realm database from a the assets fold

Quality Mobile Puzzle Apps 29 Dec 28, 2021
Realm is a mobile database: a replacement for SQLite & ORMs

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Java version of Realm

Realm 11.4k Jan 9, 2023
A key-value database for Android

SnappyDB SnappyDB is a key-value database for Android it's an alternative for SQLite if you want to use a NoSQL approach. It allows you to store and g

Nabil Hachicha 1.8k Dec 28, 2022
ObjectBox is a superfast lightweight database for objects

ObjectBox Java (Kotlin, Android) ObjectBox is a superfast object-oriented database with strong relation support. ObjectBox is embedded into your Andro

ObjectBox 4.1k Dec 30, 2022
Insanely easy way to work with Android Database.

Sugar ORM Insanely easy way to work with Android databases. Official documentation can be found here - Check some examples below. The example applicat

null 2.6k Dec 16, 2022
Android Database Performance Benchmarks

ℹ Check out our new performance test app that includes ObjectBox. Android Database Performance Benchmark This project evaluates Android databases and

Markus Junginger 80 Nov 25, 2022
Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS.

Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS. It is suited for client or mobile applications.

null 277 Dec 3, 2022
Test any type of cloud database on Android apps. No need of a dedicated backend.

Test any type of cloud database on Android apps. No need of a dedicated backend.

Arjun 9 May 9, 2022
Android with Real-time Database

Android with Real-time Database It was too much effort to build my own real-time database, but the result really satisfying, so it was worth it. Note

null 4 Jun 14, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
Android library for viewing and sharing in app databases.

DbInspector DbInspector provides a simple way to view the contents of the in-app database for debugging purposes. There is no need to pull the databas

Infinum 925 Dec 17, 2022
an android library for debugging what we care about directly in app.

EN | 中文 Pandora is a tool box that allows you to inspect and modify what includes networks, databases, UIs, etc. directly in your application. It is s

linjiang 1.5k Dec 30, 2022
Pref-DB - Android SharedPreferences alternative library

Pref-DB Android SharedPreferences alternative library.

M.Fakhri 5 Sep 14, 2022
Minimum-mvvm-room-database - MVVM With Simple Room Database

Minimum MVVM Koin (Kotlin Dependency Injection) Coroutines View Model Lifecycle

Faisal Amir 7 Oct 9, 2022
This is An Android Project. in which we use SqLite Database. We perform Insert,delete,update and Show The existing data. operations using SqLite.

SqLite Database Keywords : SqLite, Android, Database This is An Android Project. in which we use SqLite Database. We perform Insert,delete,update and

Rudra_deep 1 Nov 7, 2021
Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices.

PreLollipopTransition Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices. Download In your app build.gr

Takahiro Menju 1.3k Nov 28, 2022
An Android helper class to manage database creation and version management using an application's raw asset files

THIS PROJECT IS NO LONGER MAINTAINED Android SQLiteAssetHelper An Android helper class to manage database creation and version management using an app

Jeff Gilfelt 2.2k Jan 7, 2023
An Android helper class to manage database creation and version management using an application's raw asset files

THIS PROJECT IS NO LONGER MAINTAINED Android SQLiteAssetHelper An Android helper class to manage database creation and version management using an app

Jeff Gilfelt 2.2k Dec 23, 2022