thinkjs不支持firebird,knex功能强大,集成到一起(未集成到model,单独做一个插件)
安装支持firebird的knex npm install --save knex-firebird
配置, /src/config/adapter.js
exportsknex = type: 'test' test: client: 'firebird' connection: host: '127.0.0.1' user: 'test' password: 'test' database: '/usr/db/test.fdb' ;
应用到app, /src/config/extend.js
...const knex = ; moduleexports = ... ;
控制器示例
const Base = ; moduleexports = async { let rows = await thisknex //.then( rows => { // rows.forEach( row => { // console.log(row); // }); //}) ; return thisbody = rows0; //return this.display(); };
1.05支持同一个系统多个数据库
moduleexports = Base { thism = this; } { await this; }