const knex = require('knex')({ client: 'mysql2', connection: { host : process.env.DB_HOST, user : process.env.DB_USER, password : process.env.DB_PASS, database : process.env.DB_NAME, charset : 'utf8', typecast : function (field, next) { console.log(field.type) if (field.type == 'BLOB') { return field.string() } return next() } } }) const bookshelf = require('bookshelf')(knex) module.exports = { bookshelf: bookshelf, knex: knex, }