Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kysely transactions #162

Closed
roelandmoors opened this issue May 20, 2023 · 9 comments
Closed

Kysely transactions #162

roelandmoors opened this issue May 20, 2023 · 9 comments

Comments

@roelandmoors
Copy link

I found out the hard way that transactions are not yet supported in Kysely/Vercel
Is this on the roadmap?
Maybe add something in the readme that transactions are not yet supported?

  beginTransaction(): Promise<void> {
    throw new VercelPostgresKyselyError(
      'kysely_transactions_not_supported',
      'Transactions are not supported yet.',
    );
  }
@emirotin
Copy link

Yeah, this was much unexpected, after I've invested some time into tailoring my code to run with Vercel serverless functions and Vercel PG

@vvo
Copy link
Member

vvo commented Aug 25, 2023

Hey @roelandmoors and @emirotin have you tried to use the original transaction example from Kysely as seen here: https://kysely.dev/docs/examples/transactions/simple-transaction? Let me know how it goes

@emirotin
Copy link

@vvo nope, instantly switched to another PG provider, transactions are crucial for my use-case

@roelandmoors
Copy link
Author

Sorry, I don't remember. I'm using a different stack now.
But how could it work if it is not implemented? (kysely_transactions_not_supported)

@vvo
Copy link
Member

vvo commented Aug 25, 2023

Sorry, I don't remember. I'm using a different stack now.

Well I am just wondering if this was the right method (beginTransaction) to use versus the current kysely documentation which says to use .transaction. i.e. it might just works nowadays.

Closing, let's wait for someone else to come about this.

@vvo vvo closed this as completed Aug 25, 2023
@emirotin
Copy link

@vvo pretty sure I was following the Kysely docs, I believe beginTransaction is being called by the transaction method

@jswent
Copy link

jswent commented Nov 30, 2023

Is there still nothing done on this? This library is essentially useless to me if transactions are not supported.

@emirotin what provider did you switch to for Vercel PG?

@emirotin
Copy link

emirotin commented Nov 30, 2023 via email

@wskidmore
Copy link

wskidmore commented Mar 23, 2024

Adding another voice to the "vercel storage is a non-starter" as transactions are a necessity. It is such an unwelcome surprise after moving everything to vercel then blam, not supported, go find a different db provider.

The messages above about beginTransaction vs transaction doesnt really track as transaction calls beginTransaction AND vercel throws the same error that transactions are not supported when attempting either.

Vercel states that its because Neon doesnt support transactions.. but they do. And the un-official but still sorta official kysely adapter has them fully implemented: https://github.com/seveibar/kysely-neon/blob/main/src/neon-dialect.ts#L75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants