1.1.13 • Published 4 years ago
medoo.js v1.1.13
medoo.js
medoo is js version of catfan/Medoo.
medoo write based on ES7 async/wait.
This version is based on mbossX/medoo for javascript.
Only works with MySQL.
Uses pools to query instead of standard.
Usage
Install
npm i medoo.js
Use
const Medoo = require('medoo'); const Setting = { host: 'localhost', port: 3306, database: 'database', user: 'user', password: 'password', waitForConnections: true, connectionLimit: 250, queueLimit: 0, charset: 'utf8mb4', debug_mode: true } let medoo = new Medoo(Setting); await medoo.setup(); // this code must call in a async function
method list
setup(option = null) release() select(table, join, columns = null, where = null) insert(table, datas) delete(table, where) update(table, data, where = null) get(table, join = null, columns = null, where = null) has(table, join, where = null) count(table, join, column, where = null) max(table, join, column = null, where = null) min(table, join, column = null, where = null) avg(table, join, column = null, where = null) sum(table, join, column = null, where = null) alter(table, action, column) action(actions)
Usage of medoo is simply like medoo.php, please read catfan/Medoo doc here is just a little dif. As in php, object is use [] to init, but in javascript it use {}. So just change [] to {} if nessesary.
Todo list
- support for other DBs