biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / video / epgstation / use-mysql-over-domain-socket.patch
blob178ec455ef62b96e33bb03945293333682a95f97
1 diff --git a/ormconfig.js b/ormconfig.js
2 index 5591853b..838c06cb 100644
3 --- a/ormconfig.js
4 +++ b/ormconfig.js
5 @@ -38,8 +38,6 @@ switch (config.dbtype) {
7 case 'mysql':
8 ormConfig.type = 'mysql';
9 - ormConfig.host = config.mysql.host;
10 - ormConfig.port = config.mysql.port;
11 ormConfig.username = config.mysql.user;
12 ormConfig.password = config.mysql.password;
13 ormConfig.database = config.mysql.database;
14 @@ -49,6 +47,12 @@ switch (config.dbtype) {
15 } else {
16 ormConfig.charset = config.mysql.charset;
18 + if (config.mysql.socketPath) {
19 + ormConfig.extra = { socketPath: config.mysql.socketPath };
20 + } else {
21 + ormConfig.host = config.mysql.host;
22 + ormConfig.port = config.mysql.port;
23 + }
24 break;
26 case 'postgres':
27 diff --git a/src/model/IConfigFile.ts b/src/model/IConfigFile.ts
28 index 6a502e83..ba84a423 100644
29 --- a/src/model/IConfigFile.ts
30 +++ b/src/model/IConfigFile.ts
31 @@ -61,12 +61,13 @@ export default interface IConfigFile {
32 regexp?: boolean;
34 mysql?: {
35 - host: string;
36 + host?: string;
37 user: string;
38 - port: number;
39 + port?: number;
40 password: string;
41 database: string;
42 charset?: string;
43 + socketPath?: string;
45 postgres?: {
46 host: string;