yamlling-node-mysql
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "yamlling-node-mysql", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "重新封装hyoga/mysql,一个MYSQL数据库的常用操作封装,操作方式类似THINKPHP的数据库操作", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
207
README.md
@@ -1,9 +0,9 @@ | ||
# hyoga-mysql | ||
[![NPM version][npm-image]][npm-url] | ||
[![npm download][download-image]][download-url] | ||
[npm-image]: https://img.shields.io/npm/v/@hyoga/mysql.svg?style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/@hyoga/mysql | ||
[download-image]: https://img.shields.io/npm/dm/@hyoga/mysql.svg?style=flat-square | ||
[download-url]: https://www.npmjs.com/package/@hyoga/mysql | ||
[npm-image]: https://img.shields.io/npm/v/.svg?style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/ | ||
[download-image]: https://img.shields.io/npm/dm/.svg?style=flat-square | ||
[download-url]: https://www.npmjs.com/package/ | ||
@@ -14,3 +14,3 @@ 一个MYSQL数据库的常用操作封装,使用连续点操作,实现语义化的数据库操作。 | ||
```javascriipt | ||
npm i @hyoga/mysql | ||
npm i yamlling-node-mysql | ||
``` | ||
@@ -20,3 +20,3 @@ ## 使用 | ||
```javascriipt | ||
const mysql = require('@hyoga/mysql'); | ||
const mysql = require('yamlling-node-mysql'); | ||
const inst = new mysql({ | ||
@@ -33,68 +33,65 @@ host: '127.0.0.1', | ||
### 更多操作方式 | ||
见下方[API](#module_@hyoga/mysql) | ||
见下方[API] | ||
## API | ||
<a name="module_@hyoga/mysql"></a> | ||
## @hyoga/mysql | ||
Mysql数据库实例,封装了常用操作方式 | ||
**Author**: <lq9328@126.com> | ||
* []() | ||
* [~Mysql](..Mysql) | ||
* [new Mysql(config)](#new_module_..Mysql_new) | ||
* [.query(sql)](..Mysql+query) ⇒ <code>Promise.<any></code> | ||
* [.table(tableName)](..Mysql+table) ⇒ <code>Mysql</code> | ||
* [.alias(tableAlias)](..Mysql+alias) ⇒ <code>Mysql</code> | ||
* [.field(fields)](..Mysql+field) ⇒ <code>Mysql</code> | ||
* [.group(columns)](..Mysql+group) ⇒ <code>Mysql</code> | ||
* [.where(where)](..Mysql+where) ⇒ <code>Mysql</code> | ||
* [.limit(limit)](..Mysql+limit) ⇒ <code>Mysql</code> | ||
* [.page(page, pageSize)](..Mysql+page) ⇒ <code>Mysql</code> | ||
* [.data(data)](..Mysql+data) ⇒ <code>Mysql</code> | ||
* [.order(order)](..Mysql+order) ⇒ <code>Mysql</code> | ||
* [.join(join)](..Mysql+join) ⇒ <code>Mysql</code> | ||
* [.find(where)](..Mysql+find) ⇒ <code>Promise.<any></code> | ||
* [.select(where)](..Mysql+select) ⇒ <code>Promise.<any></code> | ||
* [.update(column, where)](..Mysql+update) ⇒ <code>Promise.<any></code> | ||
* [.updateMany(columnList, where)](..Mysql+updateMany) ⇒ <code>Promise.<any></code> | ||
* [.increase(field, step)](..Mysql+increase) ⇒ <code>Promise.<any></code> | ||
* [.decrement(field, step)](..Mysql+decrement) ⇒ <code>Promise.<any></code> | ||
* [.add(column, duplicate)](..Mysql+add) ⇒ <code>Promise.<any></code> | ||
* [.addMany(columnList, duplicate)](..Mysql+addMany) ⇒ <code>Promise.<any></code> | ||
* [.delete(where)](..Mysql+delete) ⇒ <code>Promise.<any></code> | ||
* [._sql()](..Mysql+_sql) ⇒ <code>string</code> | ||
* [@hyoga/mysql](#module_@hyoga/mysql) | ||
* [~Mysql](#module_@hyoga/mysql..Mysql) | ||
* [new Mysql(config)](#new_module_@hyoga/mysql..Mysql_new) | ||
* [.query(sql)](#module_@hyoga/mysql..Mysql+query) ⇒ <code>Promise.<any></code> | ||
* [.table(tableName)](#module_@hyoga/mysql..Mysql+table) ⇒ <code>Mysql</code> | ||
* [.alias(tableAlias)](#module_@hyoga/mysql..Mysql+alias) ⇒ <code>Mysql</code> | ||
* [.field(fields)](#module_@hyoga/mysql..Mysql+field) ⇒ <code>Mysql</code> | ||
* [.group(columns)](#module_@hyoga/mysql..Mysql+group) ⇒ <code>Mysql</code> | ||
* [.where(where)](#module_@hyoga/mysql..Mysql+where) ⇒ <code>Mysql</code> | ||
* [.limit(limit)](#module_@hyoga/mysql..Mysql+limit) ⇒ <code>Mysql</code> | ||
* [.page(page, pageSize)](#module_@hyoga/mysql..Mysql+page) ⇒ <code>Mysql</code> | ||
* [.data(data)](#module_@hyoga/mysql..Mysql+data) ⇒ <code>Mysql</code> | ||
* [.order(order)](#module_@hyoga/mysql..Mysql+order) ⇒ <code>Mysql</code> | ||
* [.join(join)](#module_@hyoga/mysql..Mysql+join) ⇒ <code>Mysql</code> | ||
* [.find(where)](#module_@hyoga/mysql..Mysql+find) ⇒ <code>Promise.<any></code> | ||
* [.select(where)](#module_@hyoga/mysql..Mysql+select) ⇒ <code>Promise.<any></code> | ||
* [.update(column, where)](#module_@hyoga/mysql..Mysql+update) ⇒ <code>Promise.<any></code> | ||
* [.updateMany(columnList, where)](#module_@hyoga/mysql..Mysql+updateMany) ⇒ <code>Promise.<any></code> | ||
* [.increase(field, step)](#module_@hyoga/mysql..Mysql+increase) ⇒ <code>Promise.<any></code> | ||
* [.decrement(field, step)](#module_@hyoga/mysql..Mysql+decrement) ⇒ <code>Promise.<any></code> | ||
* [.add(column, duplicate)](#module_@hyoga/mysql..Mysql+add) ⇒ <code>Promise.<any></code> | ||
* [.addMany(columnList, duplicate)](#module_@hyoga/mysql..Mysql+addMany) ⇒ <code>Promise.<any></code> | ||
* [.delete(where)](#module_@hyoga/mysql..Mysql+delete) ⇒ <code>Promise.<any></code> | ||
* [._sql()](#module_@hyoga/mysql..Mysql+_sql) ⇒ <code>string</code> | ||
<a name="module_..Mysql"></a> | ||
<a name="module_@hyoga/mysql..Mysql"></a> | ||
### ~Mysql | ||
**Kind**: inner class of [<code></code>]() | ||
### @hyoga/mysql~Mysql | ||
**Kind**: inner class of [<code>@hyoga/mysql</code>](#module_@hyoga/mysql) | ||
* [~Mysql](..Mysql) | ||
* [new Mysql(config)](#new_module_..Mysql_new) | ||
* [.query(sql)](..Mysql+query) ⇒ <code>Promise.<any></code> | ||
* [.table(tableName)](..Mysql+table) ⇒ <code>Mysql</code> | ||
* [.alias(tableAlias)](..Mysql+alias) ⇒ <code>Mysql</code> | ||
* [.field(fields)](..Mysql+field) ⇒ <code>Mysql</code> | ||
* [.group(columns)](..Mysql+group) ⇒ <code>Mysql</code> | ||
* [.where(where)](..Mysql+where) ⇒ <code>Mysql</code> | ||
* [.limit(limit)](..Mysql+limit) ⇒ <code>Mysql</code> | ||
* [.page(page, pageSize)](..Mysql+page) ⇒ <code>Mysql</code> | ||
* [.data(data)](..Mysql+data) ⇒ <code>Mysql</code> | ||
* [.order(order)](..Mysql+order) ⇒ <code>Mysql</code> | ||
* [.join(join)](..Mysql+join) ⇒ <code>Mysql</code> | ||
* [.find(where)](..Mysql+find) ⇒ <code>Promise.<any></code> | ||
* [.select(where)](..Mysql+select) ⇒ <code>Promise.<any></code> | ||
* [.update(column, where)](..Mysql+update) ⇒ <code>Promise.<any></code> | ||
* [.updateMany(columnList, where)](..Mysql+updateMany) ⇒ <code>Promise.<any></code> | ||
* [.increase(field, step)](..Mysql+increase) ⇒ <code>Promise.<any></code> | ||
* [.decrement(field, step)](..Mysql+decrement) ⇒ <code>Promise.<any></code> | ||
* [.add(column, duplicate)](..Mysql+add) ⇒ <code>Promise.<any></code> | ||
* [.addMany(columnList, duplicate)](..Mysql+addMany) ⇒ <code>Promise.<any></code> | ||
* [.delete(where)](..Mysql+delete) ⇒ <code>Promise.<any></code> | ||
* [._sql()](..Mysql+_sql) ⇒ <code>string</code> | ||
* [~Mysql](#module_@hyoga/mysql..Mysql) | ||
* [new Mysql(config)](#new_module_@hyoga/mysql..Mysql_new) | ||
* [.query(sql)](#module_@hyoga/mysql..Mysql+query) ⇒ <code>Promise.<any></code> | ||
* [.table(tableName)](#module_@hyoga/mysql..Mysql+table) ⇒ <code>Mysql</code> | ||
* [.alias(tableAlias)](#module_@hyoga/mysql..Mysql+alias) ⇒ <code>Mysql</code> | ||
* [.field(fields)](#module_@hyoga/mysql..Mysql+field) ⇒ <code>Mysql</code> | ||
* [.group(columns)](#module_@hyoga/mysql..Mysql+group) ⇒ <code>Mysql</code> | ||
* [.where(where)](#module_@hyoga/mysql..Mysql+where) ⇒ <code>Mysql</code> | ||
* [.limit(limit)](#module_@hyoga/mysql..Mysql+limit) ⇒ <code>Mysql</code> | ||
* [.page(page, pageSize)](#module_@hyoga/mysql..Mysql+page) ⇒ <code>Mysql</code> | ||
* [.data(data)](#module_@hyoga/mysql..Mysql+data) ⇒ <code>Mysql</code> | ||
* [.order(order)](#module_@hyoga/mysql..Mysql+order) ⇒ <code>Mysql</code> | ||
* [.join(join)](#module_@hyoga/mysql..Mysql+join) ⇒ <code>Mysql</code> | ||
* [.find(where)](#module_@hyoga/mysql..Mysql+find) ⇒ <code>Promise.<any></code> | ||
* [.select(where)](#module_@hyoga/mysql..Mysql+select) ⇒ <code>Promise.<any></code> | ||
* [.update(column, where)](#module_@hyoga/mysql..Mysql+update) ⇒ <code>Promise.<any></code> | ||
* [.updateMany(columnList, where)](#module_@hyoga/mysql..Mysql+updateMany) ⇒ <code>Promise.<any></code> | ||
* [.increase(field, step)](#module_@hyoga/mysql..Mysql+increase) ⇒ <code>Promise.<any></code> | ||
* [.decrement(field, step)](#module_@hyoga/mysql..Mysql+decrement) ⇒ <code>Promise.<any></code> | ||
* [.add(column, duplicate)](#module_@hyoga/mysql..Mysql+add) ⇒ <code>Promise.<any></code> | ||
* [.addMany(columnList, duplicate)](#module_@hyoga/mysql..Mysql+addMany) ⇒ <code>Promise.<any></code> | ||
* [.delete(where)](#module_@hyoga/mysql..Mysql+delete) ⇒ <code>Promise.<any></code> | ||
* [._sql()](#module_@hyoga/mysql..Mysql+_sql) ⇒ <code>string</code> | ||
<a name="new_module_..Mysql_new"></a> | ||
<a name="new_module_@hyoga/mysql..Mysql_new"></a> | ||
#### new Mysql(config) | ||
@@ -108,3 +105,3 @@ 创建Mysql实例 | ||
<a name="module_@hyoga/mysql..Mysql+query"></a> | ||
<a name="module_..Mysql+query"></a> | ||
@@ -114,3 +111,3 @@ #### mysql.query(sql) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - sql执行结果 | ||
@@ -122,3 +119,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+table"></a> | ||
<a name="module_..Mysql+table"></a> | ||
@@ -128,3 +125,3 @@ #### mysql.table(tableName) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -136,3 +133,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+alias"></a> | ||
<a name="module_..Mysql+alias"></a> | ||
@@ -142,3 +139,3 @@ #### mysql.alias(tableAlias) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -150,3 +147,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+field"></a> | ||
<a name="module_..Mysql+field"></a> | ||
@@ -156,3 +153,3 @@ #### mysql.field(fields) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -171,3 +168,3 @@ | ||
``` | ||
<a name="module_@hyoga/mysql..Mysql+group"></a> | ||
<a name="module_..Mysql+group"></a> | ||
@@ -177,3 +174,3 @@ #### mysql.group(columns) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -185,3 +182,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+where"></a> | ||
<a name="module_..Mysql+where"></a> | ||
@@ -191,3 +188,3 @@ #### mysql.where(where) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -263,3 +260,3 @@ | ||
``` | ||
<a name="module_@hyoga/mysql..Mysql+limit"></a> | ||
<a name="module_..Mysql+limit"></a> | ||
@@ -269,3 +266,3 @@ #### mysql.limit(limit) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -277,3 +274,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+page"></a> | ||
<a name="module_..Mysql+page"></a> | ||
@@ -283,3 +280,3 @@ #### mysql.page(page, pageSize) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -292,3 +289,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+data"></a> | ||
<a name="module_..Mysql+data"></a> | ||
@@ -298,3 +295,3 @@ #### mysql.data(data) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -306,3 +303,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+order"></a> | ||
<a name="module_..Mysql+order"></a> | ||
@@ -312,3 +309,3 @@ #### mysql.order(order) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -328,3 +325,3 @@ | ||
``` | ||
<a name="module_@hyoga/mysql..Mysql+join"></a> | ||
<a name="module_..Mysql+join"></a> | ||
@@ -334,3 +331,3 @@ #### mysql.join(join) ⇒ <code>Mysql</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Mysql</code> - 实例 | ||
@@ -360,3 +357,3 @@ | ||
``` | ||
<a name="module_@hyoga/mysql..Mysql+find"></a> | ||
<a name="module_..Mysql+find"></a> | ||
@@ -366,3 +363,3 @@ #### mysql.find(where) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 查询结果 | ||
@@ -374,3 +371,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+select"></a> | ||
<a name="module_..Mysql+select"></a> | ||
@@ -380,3 +377,3 @@ #### mysql.select(where) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 查询结果 | ||
@@ -388,3 +385,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+update"></a> | ||
<a name="module_..Mysql+update"></a> | ||
@@ -394,3 +391,3 @@ #### mysql.update(column, where) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 更新结果 | ||
@@ -403,3 +400,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+updateMany"></a> | ||
<a name="module_..Mysql+updateMany"></a> | ||
@@ -409,3 +406,3 @@ #### mysql.updateMany(columnList, where) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 更新结果 | ||
@@ -418,3 +415,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+increase"></a> | ||
<a name="module_..Mysql+increase"></a> | ||
@@ -424,3 +421,3 @@ #### mysql.increase(field, step) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 更新结果 | ||
@@ -433,3 +430,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+decrement"></a> | ||
<a name="module_..Mysql+decrement"></a> | ||
@@ -439,3 +436,3 @@ #### mysql.decrement(field, step) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 更新结果 | ||
@@ -448,3 +445,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+add"></a> | ||
<a name="module_..Mysql+add"></a> | ||
@@ -454,3 +451,3 @@ #### mysql.add(column, duplicate) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 操作结果 | ||
@@ -463,3 +460,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+addMany"></a> | ||
<a name="module_..Mysql+addMany"></a> | ||
@@ -469,3 +466,3 @@ #### mysql.addMany(columnList, duplicate) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 操作结果 | ||
@@ -478,3 +475,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+delete"></a> | ||
<a name="module_..Mysql+delete"></a> | ||
@@ -484,3 +481,3 @@ #### mysql.delete(where) ⇒ <code>Promise.<any></code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>Promise.<any></code> - 操作结果 | ||
@@ -492,3 +489,3 @@ | ||
<a name="module_@hyoga/mysql..Mysql+_sql"></a> | ||
<a name="module_..Mysql+_sql"></a> | ||
@@ -498,4 +495,4 @@ #### mysql.\_sql() ⇒ <code>string</code> | ||
**Kind**: instance method of [<code>Mysql</code>](#module_@hyoga/mysql..Mysql) | ||
**Kind**: instance method of [<code>Mysql</code>](..Mysql) | ||
**Returns**: <code>string</code> - 生成的sql语句 | ||
85457
454