From cea371c90ce954ea08eb29c6a039dc476635e126 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:58:32 +1000 Subject: [PATCH] refactor(database/pool): warn if using multipleStatements --- src/database/pool.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/database/pool.ts b/src/database/pool.ts index 6b4b242..a6ecf27 100644 --- a/src/database/pool.ts +++ b/src/database/pool.ts @@ -22,6 +22,11 @@ export async function createConnectionPool() { dbVersion = `^5[${result[0].version}]`; console.log(`${dbVersion} ^2Database server connection established!^0`); + + if (config.multipleStatements) { + console.warn(`multipleStatements is enabled. Used incorrectly, this option may cause SQL injection.\nSee https://github.com/overextended/oxmysql/issues/102)`) + } + } catch (err: any) { const message = err.message.includes('auth_gssapi_client') ? `Server requests authentication using unknown plugin auth_gssapi_client.\nSee https://github.com/overextended/oxmysql/issues/213.`