wind-sql
Table of Contents
- Install
- Introduction
- QUERY
- INSERT
- UPDATE_BY_ID
- UPDATE_BY_COLUMN
- DELETE_BY_ID
- SELECT_BY_ID
- SELECT_ALL
- SELECT_BY_COLUMN
Install
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.6 or higher is required.
Installation is done using the
npm install
command:
$ npm install wind-sql
Introduction
This is a node.js framework for mysql. It is written in JavaScript, does not require compiling, and is 100% MIT licensed.
Here is an example on how to use it:
var windSQL = ;var mysql = ;var pool = mysql; windSQL;
QUERY
var windSQL = ;windSQL; await windSQL;
windSQL.query(sql, args);
- require sql type is String
- require args type is Array
INSERT
var windSQL = ;windSQL; let cat = name: 'Tom' age: 12;await windSQL;
windSQL.insert(model, table);
id cannot appear in attribute.- require model
- require table
UPDATE_BY_ID
var windSQL = ;windSQL; let cat = id: 1 name: 'Tom' age: 12;await windSQL;
windSQL.updateById(model, table);
- require model
- require table
UPDATE_BY_COLUMN
- developing
DELETE_BY_ID
var windSQL = ;windSQL; await windSQL;
windSQL.deleteById(id, table);
- require id
- require table
SELECT_BY_ID
var windSQL = ;windSQL; await windSQL;
windSQL.selectById(id, table);
- require id
- require table
SELECT_ALL
var windSQL = ;windSQL; await windSQL;
windSQL.selectAll(table);
- require table.
SELECT_BY_COLUMN
- developing