knex-model
小ORM。 它建立在之上
例子
var Model = require ( 'knex-model' ) ( knex ) ;
var Promise = require ( 'bluebird' ) ;
var User = Model . define ( 'User' , {
tableName : 'users' ,
hasMany : [
{
name : 'entries' ,
model : 'Entry' ,
key : 'user_id'
}
]
} , {
instanceMethod : function ( ) { }
} ) ;
var Entry = Model . define ( 'Entry' , {
tableName : 'entries' ,
bel
1