[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# How to use attachDatabasePool with prismajs and mariaDb?

11 views · 0 likes · 3 posts


Brnyza (@brnyza) · 2026-03-31

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

https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package#attachdatabasepool



```typescript
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**


Al441395 (@al441395-9679) · 2026-03-31

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


Al441395 (@al441395-9679) · 2026-03-31

Switching to `mysql2` is a practical solution here, since `attachDatabasePool` is compatible with that driver and works correctly with Fluid Compute