Closed vvizden closed 4 years ago
类似于knex官网:
var knex = require('knex')({
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'myapp_test'
}
});
抱歉,没仔细看egg api。最后发现,可使用以下代码动态创建
app.knex.createInstance({
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'myapp_test'
}
})
是否支持自主传入连接参数动态创建knex