mirror of
https://github.com/strapi/strapi.git
synced 2025-07-19 07:02:26 +00:00
29 lines
375 B
JavaScript
29 lines
375 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
class Dialect {
|
||
|
useReturning() {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class PGDialect {
|
||
|
useReturning() {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const getDialect = connection => {
|
||
|
const { client } = connection.client.config;
|
||
|
|
||
|
switch (client) {
|
||
|
case 'postgres':
|
||
|
return new PGDialect();
|
||
|
default:
|
||
|
return new Dialect();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
module.exports = {
|
||
|
getDialect,
|
||
|
};
|