coal
v0.3.0
Published
Mysql ORM base on knexjs
Downloads
21
Readme
coal
Base on knexjs
Install
npm install coal --save
Getting start
database configure
config.js
exports.database = {
client: "mysql",
connection:{
host : 'localhost',
user : 'root',
password : '12345678',
database : 'page-monitor'
},
debug: false
}
schema:
exports.schema = {
id: "increments primary",
name: "string",
url:"string",
}
init tables
Coal = require('coal')
config = require('./config')
await Coal.init(_config.database)
await Coal.createTable([schema])
Get knexjs instance
Coal.get()