This repository has been archived by the owner on Mar 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Ricky Tobing edited this page May 2, 2014
·
40 revisions
This Wiki is not proof-read
DbQuery
is a library that extends the functionality of SQLiteOpenHelper
and SQLiteDatabase
to minimize the need to write SQL code inside your Java code
#Why The current way of querying in Android
Cursor cursor =
db.query("Customers", // table name
new String[] {"Id", "Address", "Age"}, // columns
"Id IN (?,?,?)", // whereClause
new String[]{"" + customerId1, "" + customerId2, "" + customerId3}, // whereArgs
null, // groupBy
null, // having
"Age"); // orderBy
The purpose of DbQuery
is to be able to write this query differently
Cursor cursor =
db.get("Customers")
.select("Id IN (?,?,?)", customerId1, customerId2, customerId3) // whereClause
.columns("Id", "Address", "Age") // columns
.orderBy("Age") // orderBy 'Age'
.query();
#Read On
-
IDatabase
Documentation onIDatabase
, best practices, configurations and essentials methods-
IConfig
Documentation on how to configure your database and best practices -
Naming Convention
Documentation aboutId
, its naming convention across all tables, patterns and how it will affect your SQL operations -
Migration
Documentation on migration (upgrade/downgrade) from previous, newer or starting from scratch. -
Transaction
Batch
of code to be executed using familiar pattern:BEGIN
,COMMIT
,ROLLBACK
andEND
.
-
-
ITable
Documentation onITable
, best practices and patterns and essentials methods -
IView
Documentation onIView
-
IEntity
Documentation on runtime 'serialization' process from database record to runtime object and vice versa. -
IEntityList
Documentation on runtime 'serialization' process from database records to a collection ofIEntity
and vice versa
-
ContentQuery
AllowsDbQuery
-style query toContentProvider
-
DataProvider
An extension library to help create aContentProvider
using existingIDatabase