EasySQL
Lightweight wrapper around SQLiteDatabase to interact with local databases without SQL boilerplate, using a colon-separated payload structure.
Methods
Creates a new table using structured array definitions if it does not already exist.
Returns true if the specified table exists in the database file, verified by executing an internal raw query test.
Inserts a single row of values. Each value element is formatted as "column:value". Allows values that contain nested colons.
Deletes matching records using a single key pair string (e.g. "id:5"). Automatically detects and formats type syntax differences for text values.
Retrieves all table records as a flat collection of "column:value" strings. Automatically formats text fields with enclosing single quotes.
Reads rows individually, returning them as mapped string array elements representing each database column.
Usage Example
Instead of manual queries, columns are expressed as "name:TYPE" strings. Input records follow a similar "column:value" pattern.
EasySQL db = new EasySQL(context);
String[] columns = {"id:INTEGER PRIMARY KEY", "name:TEXT", "score:REAL"};
db.createTable("game_db", "scores", columns);