mirror of
https://github.com/strapi/strapi.git
synced 2025-07-19 23:16:47 +00:00
31 lines
615 B
JavaScript
31 lines
615 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
const sqlClientModule = {
|
||
|
sqlite: 'sqlite3',
|
||
|
postgres: 'pg',
|
||
|
mysql: 'mysql',
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Client dependencies
|
||
|
*/
|
||
|
module.exports = ({ scope, client }) => {
|
||
|
switch (client) {
|
||
|
case 'sqlite':
|
||
|
case 'postgres':
|
||
|
case 'mysql':
|
||
|
return {
|
||
|
'strapi-hook-bookshelf': scope.strapiVersion,
|
||
|
'strapi-hook-knex': scope.strapiVersion,
|
||
|
knex: 'latest',
|
||
|
[sqlClientModule[client]]: 'latest',
|
||
|
};
|
||
|
case 'mongo':
|
||
|
return {
|
||
|
'strapi-hook-mongoose': scope.strapiVersion,
|
||
|
};
|
||
|
default:
|
||
|
throw new Error(`Invalid client ${client}`);
|
||
|
}
|
||
|
};
|