yutent 4d79480e72 update 2024-07-23 18:54:00 +08:00
docs 更新文档 2021-08-23 19:25:20 +08:00
lib update 2024-07-23 18:54:00 +08:00
.gitignore update config; support mysql 8.x 2020-11-24 21:11:45 +08:00
History.md 更新文档 2021-06-21 20:02:08 +08:00
LICENSE 完成3.0版的转变 2018-05-29 02:42:12 +08:00
Readme.md update 2021-08-23 19:27:09 +08:00
Readme_CN.md update 2021-08-23 19:30:30 +08:00
index.js update 2024-07-23 18:54:00 +08:00
package.json 更新文档 2021-08-23 19:25:20 +08:00

Readme.md

module info

中文说明

mysqli

This module is based on the node-mysql module and converts the SQL syntax to the API similar to MongoDB. Some simple APIs is provided for commonly used additions, deletions, and changes, and xss injection, which is very friendly to novices.

installation

# 3.x    recommend
npm i mysqli
# or
npm i mysqli@3.x


# 2.x old version
npm i mysqli@2.x

Quick Start

One or more configurations can be passed in for instantiation. When there is only one database, the default is the master library; when there is more than one database service, the first one is automatically used as the master library, and the other slave libraries. so, pay attention to the order when using.

let Mysqli = require('mysqli')

// one config
let conn = new Mysqli({
  host: '', // IP/domain  
  post: 3306, //port, default 3306  
  user: '', // username
  passwd: '', // password
  charset: '', // CHARSET of database, default to utf8 【optional】
  db: '' // the default database name  【optional】
})

// two or more configs
let conn = new Mysqli([
  {
    host: 'host1', // 
    ...
  },
  {
    host: 'host2', // 
    ...
  },
  ...
])

Document

MySQL tool
JavaScript 100%