I’m trying to use prisma js + vercel fluid compute, but without success, can anyone help?
in this link it says that is possible to use MariaDB / MySQL2 with attachDatabasePool
import { PrismaMariaDb } from '@prisma/adapter-mariadb'
import { attachDatabasePool } from '@vercel/functions'
import { PrismaClient } from 'generated/prisma/client'
import * as mariadb from 'mariadb'
const pool = mariadb.createPool(process.env.DATABASE_URL as string)
attachDatabasePool(pool)
const adapter = new PrismaMariaDb(pool as any)
export const prisma = new PrismaClient({ adapter })
with this code it returns: Error: Unsupported database pool type
I think this might be an integration mismatch between Prisma’s MariaDB adapter and how attachDatabasePool() detects supported pool objects.
From what I can see, @prisma/adapter-mariadb is designed to receive a connection string or config, not an already-created pool instance. So instead of passing a pool, I’d try initializing it like this:
import { PrismaMariaDb } from '@prisma/adapter-mariadb'
import { PrismaClient } from 'generated/prisma/client'
const adapter = new PrismaMariaDb(process.env.DATABASE_URL!)
export const prisma = new PrismaClient({ adapter })
The Unsupported database pool type error seems to come from attachDatabasePool(pool), which suggests it may not recognize the shape of the MariaDB pool being used here.
My guess is that Prisma itself is working fine, but attachDatabasePool() might not currently support this specific Prisma + MariaDB adapter setup (or expects a different pool format).
Might be worth confirming with Vercel whether this combination is officially supported