tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
226 stars 32 forks source link

TRANSACTION_CLOSED issue with Prisma #124

Open penberg opened 11 months ago

penberg commented 11 months ago

Someone reported that with the following Prisma example, they're always getting TRANSACTION_CLOSED error on the first write:

https://www.prisma.io/blog/prisma-turso-ea-support-rXGd_Tmy3UXX

rlfrahm commented 11 months ago

This is the repo that I'm seeing the error on:

https://github.com/ruheni/fullstack-prisma-turso-embedded-db

My steps to reproduce are:

  1. npm i
  2. npx prisma migrate dev - For good measure, pretty sure you don't need to do this.
  3. turso db shell [db name] < prisma/migrations/20230922132717_innit/migration.sql
  4. turso db shell [db name] < prisma/migrations/20230924132455_password/migration.sql
  5. Add environment variables to .env:
    1. TURSO_AUTH_TOKEN=
    2. TURSO_DATABASE_URL=
    3. SESSION_SECRET=llkasjdflkjasdflnasdlkjnalsdf
    4. DATABASE_URL=file:./prisma/dev.db
  6. npm run dev
  7. Open localhost:3000 and try to signup
janpio commented 11 months ago

Related Discord thread: https://discord.com/channels/933071162680958986/1168952021064351886

And PR that will hopefully resolve this: https://github.com/tursodatabase/libsql/pull/559