PostgreSQL: Vercel Postgres, no transactions?

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


I had problems using Kysely on Vercel Postgres, with the @vercel/postgres and @vercel/postgres-kysely adapters.

Basically, transactions are not supported.

I had some code like this:

const data = await db.transaction().execute(async (trx) => {
  const somedata = await trx
    .selectFrom('table1')
    .selectAll()
    .where('id', '=', token)
    .executeTakeFirst()

  if (!somedata) throw new Error('Invalid data')

  await trx
    .deleteFrom('table2')
    .where('id', '=', token)
    .executeTakeFirst()

  return somedata
})

console.log(data)

and I had to remove the transaction, I just used the queries without the transaction:

const data = await db.selectFrom('table1')
  .selectAll()
  .where('id', '=', token)
  .executeTakeFirst()

if (!data) throw new Error('Invalid data')

await db.deleteFrom('table2')
  .where('id', '=', token)
  .executeTakeFirst()

console.log(data)

Hopefully transactions will be implemented.

If you absolutely need them you can still use a direct connection to the database using pg

Lessons in this unit:

0: Introduction
1: Introduction to PostgreSQL
2: How to install PostgreSQL on macOS
3: How to create a PostgreSQL database
4: Navigating Databases in PostgreSQL
5: PostgreSQL User Permissions
6: Tables and Data Types
7: Where to host a PostgreSQL database
8: PostgreSQL vs MySQL
9: Troubleshooting PostgreSQL
10: ▶︎ Vercel Postgres, no transactions?
11: Set up Lucia Auth for local Postgres DB vs Vercel Postgres
12: Connect to Postgres local vs Vercel Postgres with Kysely