mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-04 06:28:53 +00:00
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:
1 parent
8fe63bc88a
commit
b604a3c356
1 file changed
+11
@@ -72,6 +72,17 @@ export const connectionOptions = (() => {
|
|||||||
|
|
||||||
options.namedPlaceholders = options.namedPlaceholders === 'false' ? false : true;
|
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;
|
return options;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user