АГ
Size: a a a
АГ
БР
БР
АГ
АГ
find('select * from table where id = 11', function(result){
здесь мы получили данные в переменной result
});
АГ
БР
АГ
АГ
АГ
БР
chat_rooms
where `name`=:room_name))',АГ
knex('chat_rooms').where({name: ':room_name'});
АГ
БР
БР
АГ
function getChats (){
return knex('chat_rooms').where({name: ':room_name'});
}
function insertDataToSubscriptions(data) {
data = _.pick(data, ['login', 'room_id']);
return knex('subscriptions').insert(data);
}
getChats()
.then(insertDataToSubscriptions)
.then(() => { console.log('FINISH')})
.catch(() => { console.log('FAIL')})
АГ
АГ
БР