Git Product home page Git Product logo

sqldb's Introduction

SQLdb

A new Flutter application. sqflite based packaging

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

数据库表名
final String table;

【more】true 此模式的数据表会自动创建一个自增字段"_id"作为数据插入索引。此模式创建的表,当调用【insert】时,旧数据不会被替换

【more】false 默认模式。被创建的表会按表传入的json原样进入字段以及类型复制,每一次调用【insert】时,新数据会替换旧数据。

final bool more;


var data = {
  "id": 14,
  "level": "A,B,C,E",
  "mobile": "13800138000",
  "uid": "admin",
  "name": "kkk",
  "step": 2
};

初始化

//TODO:初始化自动创建db文件。
SQLdb.init("member_check_login", json: data);

//TODO: 增加数据
SQLdb.init("member_check_login", json: data).insert(data);

//TODO: 更新数据
SQLdb.init("member_check_login").update(json, where: "id = 3",onChanged: (count){
  print("更新数据库:${count}");
});

//TODO: 查询数据
SQLdb.init("member_check_login").getList((list){
  print("查询数据:${list}");
});

//TODO:删除数据
SQLdb.init("member_check_login").deleteList(onChanged: (count){
  print("删除数据:${count}");
});

查询所有表

SQLdb.init("member_check_login").getTableAll(onChanged: (map){
    print("查询所有表:${map}");
});

查询某表是否存在

SQLdb.init("member_check_login").queryTable(onChanged: (map){
    print("查询所有表:${map}");
});

sqldb's People

Contributors

muzilee avatar

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.