From a7516314e6ddbadd343f5a84b4f26fa4f2f5935d Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 29 Jul 2022 18:12:51 +0200 Subject: [PATCH] fix #172 force mariadb sequelize dialect to not re-parse JSON field (mariadb >= 10.5.2 required) https://github.com/sequelize/sequelize/pull/14800 --- server/api/models/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/api/models/index.js b/server/api/models/index.js index ffa72560..09d533b5 100644 --- a/server/api/models/index.js +++ b/server/api/models/index.js @@ -1,4 +1,9 @@ const Sequelize = require('sequelize') + +// this is an hack: https://github.com/sequelize/sequelize/pull/14800 +const livePatchMariaDBDialect = require('sequelize/lib/dialects/mariadb/query') +livePatchMariaDBDialect.prototype.handleJsonSelectQuery = () => null + const Umzug = require('umzug') const path = require('path') const config = require('../../config') @@ -14,7 +19,7 @@ const db = { }, connect (dbConf = config.db) { log.debug(`Connecting to DB: ${JSON.stringify(dbConf)}`) - dbConf.dialectOptions = { autoJsonMap: false } + // dbConf.dialectOptions = { autoJsonMap: false } if (dbConf.dialect === 'sqlite') { dbConf.retry = { match: [