1.0.2 • Published 7 years ago

mysql.js v1.0.2

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

The most useful mysql library that everyone even a child can learn to use. npm install mysql.js ------------------------------------ var mysql=require("mysql.js"); let q=new mysql("localhost","root","XXXXXX","zhy"); q.setTable("table");//You are not enforced to input this line,but you should input it into the parameters of functions,and if you input the two sides,the parameter will be consider as this request the true table; q.getOne({name:"Wyatt"},'id') .then((line)=>{console.log(line);console.log(line.id);}); q.add("value1","value2","value3") .then((affectedlines)=>{console.log(affectedlines);}); //You can delete this line which is just used to callback the result if is success q.del({name:"Wyatt"}) .then((affectedlines)=>{console.log(affectedlines);}); -----------------------------------------------------------------------

Here's all the functions:

Promise query(sql); Promise select(filter,which,limits,table); Promise gets(filter,which,limits,table);//They are same Promise getOne(filter,which,table); Promise delete(filter,limits,table); Promise del(filter,limits,table);//They are same Promise deleteAll(filter,table); Promise insert(arr,table); Promise addIn(table,val1,val2,val3,...); Promise add(val1,val2,val3,...);

Useful and easy! Want a star!