naive-model
simple js orm for pg
usage
const {Num, Str, Bool} = require('chkr')
const {hooks: [softDelete, timestamp, wrapLiteral, wrapCond, enableAttr, groupList]} = require('@waksana/naive-model')
const todo = {
table: 'todo',
hook: [softDelete, timestamp, wrapLiteral, wrapCond, enableAttr, groupList],
field: {
id: Num,
name: Str,
done: Bool,
user_id: Num,
}
}
module.exports = todo
TODO
- 增加relation