public class SimpleDatabase extends Object
SimpleDatabase.with(yourActivity) first.| Modifier and Type | Method and Description |
|---|---|
SimpleDatabase |
executeSqlFile(SQLiteDatabase db,
int id)
Reads the .sql file with the given resource ID and executes all SQL statements inside it
using the given database.
|
SimpleDatabase |
executeSqlFile(String name)
Reads the .sql file with the given name and executes all SQL statements inside it,
placing them into a database with the same name as the file.
|
static String[] |
getTableNames(SQLiteDatabase db)
Returns the names of all tables in the given database as an array.
|
static SimpleCursor |
rows(Cursor cursor)
Returns an object that can be used to iterate over the rows of a given
query cursor.
|
static SimpleDatabase |
setLogging(boolean logging)
Sets whether Log.d statements should print as queries are run.
|
static SimpleDatabase |
with(SimpleActivity context)
Returns a singleton SimpleDatabase instance bound to the given context.
|
public static SimpleDatabase with(SimpleActivity context)
public static SimpleDatabase setLogging(boolean logging)
public SimpleDatabase executeSqlFile(String name)
public SimpleDatabase executeSqlFile(SQLiteDatabase db, @RawRes int id)
public static String[] getTableNames(SQLiteDatabase db)
public static SimpleCursor rows(Cursor cursor)
for (SimpleRow row : SimpleDatabase.rows(myCursor)) { ... }