Giter Club home page Giter Club logo

flutter_boxer_sqflite's Introduction

flutter_boxer_sqflite

pub package

Actually I am a dart package :)

A Wrapper of package sqflite, support easy usage on query/insert/update/delete and batch/transaction

Features

  • 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.

How to use

Initialize

````
# 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> ...

About try-catch

  • Boxer sql api not wrapped by try-catch block, so caller should handle exceptions by yourself, upload to Sentry etc. But the BoxCacheTable in the example all open api are surround try-catch and feel free to use it.
  • Boxer catch some fatal error, so caller can handle these error log using properties logger & onFatalError of BoxerLogger.

For windows & linux

Just uncomment the codes under `/// For windows & linux` comments, there are 3 occurrences.

More demostrations

Run example/lib/main.dart on mobile device or PC for more example usage.

Features and bugs

Please feel free to: request new features and bugs at the issue tracker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.