如何将我的连接的SSL属性设置为true,当我使用一个连接字符串初始化knex? 同样如何设置调试为真? 我通常会传递一个连接对象,但在这种情况下,我必须使用从环境变量的连接字符串。
var database = {
client: 'pg',
connection: connstr //normally I would pass in the object below
//connection: {
// "host": config.get('database_host'),
// "user": config.get('database_user'),
// "password": config.get('database_password'),
// "database": config.get('database_name'),
// "debug": config.get('database_debug'),
// "ssl":config.get('database_ssl')
//}
};
var knex = require('knex')(database);
knex.connection.ssl = true; // this doesn't seem to do anything