mirror of https://github.com/Fabio286/antares.git
fix(MySQL): not every connection gets read-only option
This commit is contained in:
parent
2982b6cb96
commit
843c15e428
|
@ -225,6 +225,9 @@ export class MySQLClient extends AntaresCore {
|
|||
if (hasAnsiQuotes)
|
||||
await connection.query(`SET SESSION sql_mode = '${sqlMode.filter((m: string) => !['ANSI', 'ANSI_QUOTES'].includes(m)).join(',')}'`);
|
||||
|
||||
if (this._params.readonly)
|
||||
await connection.query('SET SESSION TRANSACTION READ ONLY');
|
||||
|
||||
connection.on('connection', conn => {
|
||||
if (this._params.readonly)
|
||||
conn.query('SET SESSION TRANSACTION READ ONLY');
|
||||
|
|
Loading…
Reference in New Issue