From fca0b66fc89a03f78521c629f9121c879f97caf7 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 12 Aug 2022 18:54:32 +1000 Subject: [PATCH] tweak(config): accept a JSON array for mysql_debug --- src/config/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config/index.ts b/src/config/index.ts index 73a77a5..e9a547f 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,8 +1,15 @@ export const resourceName = GetCurrentResourceName(); -export const mysql_debug = GetConvar('mysql_debug', 'false') === 'true'; export const mysql_ui = GetConvar('mysql_ui', 'false') === 'true'; export const mysql_slow_query_warning = GetConvarInt('mysql_slow_query_warning', 200); export const mysql_connection_string = GetConvar('mysql_connection_string', ''); +export let mysql_debug: boolean | string[]; + +try { + const debug = GetConvar('mysql_debug', 'false'); + mysql_debug = debug === 'false' ? false : JSON.parse(debug); +} catch (e) { + mysql_debug = true; +} export const mysql_transaction_isolation_level = (() => { const query = 'SET TRANSACTION ISOLATION LEVEL';