mirror of
https://github.com/strapi/strapi.git
synced 2025-07-29 11:58:29 +00:00
22 lines
527 B
JavaScript
22 lines
527 B
JavaScript
'use strict';
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const _ = require('lodash');
|
|
|
|
module.exports = ({ connection, client, useTypescript }) => {
|
|
const language = useTypescript ? 'ts' : 'js';
|
|
const tmpl = fs.readFileSync(
|
|
path.join(__dirname, language, 'database-templates', `${client}.template`)
|
|
);
|
|
const compile = _.template(tmpl);
|
|
|
|
return compile({
|
|
client: connection.client,
|
|
connection: {
|
|
...connection.connection,
|
|
ssl: connection.connection.ssl || false,
|
|
},
|
|
});
|
|
};
|