Actually I am a dart
package :)
A Wrapper of package sqflite
, support easy usage on query/insert/update/delete
and batch/transaction
- Easy to
save/update
your variational models without create different struct tables - Easy to transform object between json/map model type using
toJson/fromJson
- Easy to get/set
bool
,int
,double
,string
etc from/to database - Offered the cache policy to you: if the request has not yet been returned, the cache will be used first.
````
# Create a boxer instance (generally it's a single instance)
BoxerDatabase boxer = BoxerDatabase(version: version, name: 'database.db');
# Register the tables
boxer.registerTable(BoxTableManager.cacheTableCommon);
boxer.registerTable(BoxTableManager.cacheTableStudents);
# Open the database establish connection
await boxer.open();
````
// Then use the api of table instance such as: get<T>/set<T>/list<T>/query<T>/delete<T> ...
Boxer
sql api not wrapped bytry-catch
block, so caller should handle exceptions by yourself, upload toSentry
etc. But theBoxCacheTable
in the example all open api are surroundtry-catch
and feel free to use it.Boxer
catch some fatal error, so caller can handle these error log using propertieslogger
&onFatalError
ofBoxerLogger
.
Just uncomment the codes under `/// For windows & linux` comments, there are 3 occurrences.
Run example/lib/main.dart
on mobile device or PC for more example usage.
Please feel free to: request new features and bugs at the issue tracker