When using @prisma/adapter-mariadb package in combination with JSON fields, the adapter does not properly handle the JSON data for MariaDB databases.
This example demonstrates the bug and provides a verification that the bug is not present for MySQL databases.
docker compose build
docker compose run --rm backend yarn installdocker compose up -d mysql
docker compose run --rm backend-mysql yarn db:migrate
docker compose run --rm backend-mysql yarn db:seeddocker compose up -d mariadb
docker compose run --rm backend-mariadb yarn db:migrate
docker compose run --rm backend-mariadb yarn db:seedSyntaxError: "[object Object]" is not valid JSON
at JSON.parse (<anonymous>)
at deserializeTaggedValue (/usr/src/app/node_modules/@prisma/client-engine-runtime/src/json-protocol.ts:154:19)
at mapper (/usr/src/app/node_modules/@prisma/client-engine-runtime/src/json-protocol.ts:127:14)
at mapObjectValues (/usr/src/app/node_modules/@prisma/client-engine-runtime/src/json-protocol.ts:110:19)
at deserializeJsonResponse (/usr/src/app/node_modules/@prisma/client-engine-runtime/src/json-protocol.ts:135:12)
at pi.unpack (/usr/src/app/node_modules/@prisma/client/src/runtime/RequestHandler.ts:277:12)
at pi.mapQueryEngineResult (/usr/src/app/node_modules/@prisma/client/src/runtime/RequestHandler.ts:161:25)
at Object.singleLoader (/usr/src/app/node_modules/@prisma/client/src/runtime/RequestHandler.ts:118:21)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async pi.request (/usr/src/app/node_modules/@prisma/client/src/runtime/RequestHandler.ts:140:14) {
clientVersion: '6.16.2'
}