Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3350706
D4516.id14450.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4516.id14450.diff
View Options
diff --git a/keyserver/docker-compose.yml b/keyserver/docker-compose.yml
--- a/keyserver/docker-compose.yml
+++ b/keyserver/docker-compose.yml
@@ -20,6 +20,7 @@
- COMM_DATABASE_DATABASE
- COMM_DATABASE_USER
- COMM_DATABASE_PASSWORD
+ - COMM_DATABASE_TYPE=mariadb10.8
depends_on:
- cache
- database
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
@@ -19,7 +19,7 @@
return pool;
}
const scriptContext = getScriptContext();
- const dbConfig = await getDBConfig();
+ const { dbType, ...dbConfig } = await getDBConfig();
const options: PoolOptions = {
...dbConfig,
connectionLimit,
@@ -144,7 +144,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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 11:41 PM (17 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572840
Default Alt Text
D4516.id14450.diff (1 KB)
Attached To
Mode
D4516: [keyserver] Add dbType to DBConfig
Attached
Detach File
Event Timeline
Log In to Comment