-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public class ReactDatabaseSupplier extends SQLiteOpenHelper
Database supplier of the database used by react native. This creates, opens and deletes the database as necessary.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringDATABASE_NAME
-
Method Summary
Modifier and Type Method Description static ReactDatabaseSuppliergetInstance(Context context)voidonCreate(SQLiteDatabase db)voidonUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)synchronized SQLiteDatabaseget()Create and/or open the database. synchronized voidclearAndCloseDatabase()synchronized voidsetMaximumSize(long size)Sets the maximum size the database will grow to. static voiddeleteInstance()-
Methods inherited from class android.database.sqlite.SQLiteOpenHelper
close, getDatabaseName, getReadableDatabase, getWritableDatabase, onConfigure, onCreate, onDowngrade, onOpen, onUpgrade, setIdleConnectionTimeout, setLookasideConfig, setOpenParams, setWriteAheadLoggingEnabled -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInstance
static ReactDatabaseSupplier getInstance(Context context)
-
onCreate
void onCreate(SQLiteDatabase db)
-
onUpgrade
void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
-
get
synchronized SQLiteDatabase get()
Create and/or open the database.
-
clearAndCloseDatabase
synchronized void clearAndCloseDatabase()
-
setMaximumSize
synchronized void setMaximumSize(long size)
Sets the maximum size the database will grow to. The maximum size cannot be set below thecurrent size.
-
deleteInstance
static void deleteInstance()
-
-
-
-