fix(src/config): parse JSON objects in connection string

Some connection properties take an object/array (i.e. ssl, flags).
This commit is contained in:
Linden committed 2022-09-21 14:10:23 +10:00
1 parent 8fe63bc88a
commit b604a3c356
1 file changed
+11
+11
View File
@@ -72,6 +72,17 @@ export const connectionOptions = (() => {
options.namedPlaceholders = options.namedPlaceholders === 'false' ? false : true;
for (const key in options) {
const value = options[key];
if (typeof value === 'string') {
try {
options[key] = JSON.parse(value);
console.log(key, options[key]);
} catch {}
}
}
return options;
})();