Page MenuHomePhabricator

D4516.diff
No OneTemporary

D4516.diff

diff --git a/keyserver/src/database/database.js b/keyserver/src/database/database.js
--- a/keyserver/src/database/database.js
+++ b/keyserver/src/database/database.js
@@ -29,7 +29,7 @@
return pool;
}
const scriptContext = getScriptContext();
- const dbConfig = await getDBConfig();
+ const { dbType, ...dbConfig } = await getDBConfig();
const options: PoolOptions = {
...dbConfig,
connectionLimit,
@@ -175,7 +175,7 @@
}
async function getMultipleStatementsConnection() {
- const dbConfig = await getDBConfig();
+ const { dbType, ...dbConfig } = await getDBConfig();
const options: ConnectionOptions = {
...dbConfig,
multipleStatements: true,
diff --git a/keyserver/src/database/db-config.js b/keyserver/src/database/db-config.js
--- a/keyserver/src/database/db-config.js
+++ b/keyserver/src/database/db-config.js
@@ -9,6 +9,7 @@
+user: string,
+password: string,
+database: string,
+ +dbType: 'mysql5.7' | 'mariadb10.8',
};
let dbConfig;
@@ -26,6 +27,10 @@
user: process.env.COMM_DATABASE_USER,
password: process.env.COMM_DATABASE_PASSWORD,
database: process.env.COMM_DATABASE_DATABASE,
+ dbType:
+ process.env.COMM_DATABASE_TYPE === 'mariadb10.8'
+ ? 'mariadb10.8'
+ : 'mysql5.7',
};
} else {
const importedDBConfig = await importJSON({
@@ -33,7 +38,11 @@
name: 'db_config',
});
invariant(importedDBConfig, 'DB config missing');
- dbConfig = importedDBConfig;
+ dbConfig = {
+ ...importedDBConfig,
+ dbType:
+ importedDBConfig.dbType === 'mariadb10.8' ? 'mariadb10.8' : 'mysql5.7',
+ };
}
return dbConfig;
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 8:18 PM (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572326
Default Alt Text
D4516.diff (1 KB)

Event Timeline