Giter Club home page Giter Club logo

minisql's Introduction

数据库插入语句

	sql.add([{a:1},{b:2}]).save()	支持
	sql.add([{a:1},{b:2}]).add([{c:3},{d:4}]).save()  支持
	sql.add([{a:1},{b:2}]).save().add([{c:3},{d:4}]).save();  支持

数据库单条查询语句

	sql.where("a","=",1).find();  支持 直接返回数据 不可在继续链式操作

数据库多条查询语句

	 sql.where("a","=",1).select();  //支持 直接返回数据 不可在继续链式操作

	where() 参数 最少2位  最多3位 where(key,[compare,]value) compare 可选

	compare 支持参数 =>    

	(1)= 等于  (2) != 不等于   (3) > 大于  (4) >= 大于等于  (5) < 小于  (6) <= 小于等于  (7) like 模糊查询

数据库排序

	order(key[,"desc"||"asc"])  key => 必要   默认 正序
	sql.where("a","like",1).order("a","desc")

数据库分页

	limit(start[,end]) 

	start 必填  end 可选

	使用前必须填写条件

	sql.where([条件]).limit(start[,end]).find()
	sql.where([条件]).limit(start[,end]).order(key[,"desc"||"asc"]).find()

	sql.where([条件]).limit(start[,end]).select()
	sql.where([条件]).limit(start[,end]).order(key[,"desc"||"asc"]).select()

删除数据项目 需要有筛选条件!! 最后还要配合 .save() 才可以达到删除数据的目的

	sql.where([条件]).del().save()

更新数据项 需要有筛选条件!! 最后还要配合 .save() 才可以达到更新数据的目的

	updata(Object) => 传入参数必须是一个对象!!
	sql.where([条件]).updata({...}).save()
支持链式操作的 API   (1) sql()   (2) add()   (3) del()   (4) where()  (5) limit()    (6)  order()

不支持链式操作的 API (1) find()  (2) select() 

minisql's People

Contributors

coderookie262 avatar

Stargazers

 avatar

Watchers

James Cloos 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.