2019-06-19 19:02:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2020-04-06 17:39:48 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
2020-10-27 11:27:17 +01:00
|
|
|
const _ = require('lodash');
|
2019-06-19 19:02:36 +02:00
|
|
|
|
2020-04-21 18:24:15 +02:00
|
|
|
module.exports = ({ connection, client }) => {
|
2020-04-06 17:39:48 +02:00
|
|
|
const tmpl = fs.readFileSync(path.join(__dirname, 'database-templates', `${client}.template`));
|
|
|
|
const compile = _.template(tmpl);
|
|
|
|
|
|
|
|
return compile({
|
2021-06-29 16:27:35 +02:00
|
|
|
client: connection.client,
|
|
|
|
connection: {
|
|
|
|
...connection.connection,
|
|
|
|
ssl: connection.connection.ssl || false,
|
2019-06-19 19:02:36 +02:00
|
|
|
},
|
2020-04-06 17:39:48 +02:00
|
|
|
});
|
2019-06-19 19:02:36 +02:00
|
|
|
};
|