strapi/packages/generators/app/lib/utils/db-client-dependencies.js
Ben Irvin 892aeeee71
Update packages/generators/app/lib/utils/db-client-dependencies.js
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2023-03-27 08:55:33 +02:00

23 lines
430 B
JavaScript

'use strict';
const sqlClientModule = {
mysql: { mysql: '2.18.1' },
mysql2: { mysql2: '3.2.0' },
postgres: { pg: '8.8.0' },
sqlite: { 'better-sqlite3': '8.0.1' },
'sqlite-legacy': { sqlite3: '^5.0.2' },
};
/**
* Client dependencies
*/
module.exports = ({ client }) => {
if (client in sqlClientModule) {
return {
...sqlClientModule[client],
};
}
throw new Error(`Invalid client "${client}"`);
};