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

Support for setting transaction isolation level #35

Open
WiktorKryzia opened this issue Feb 10, 2025 · 0 comments
Open

Support for setting transaction isolation level #35

WiktorKryzia opened this issue Feb 10, 2025 · 0 comments

Comments

@WiktorKryzia
Copy link

WiktorKryzia commented Feb 10, 2025

Hello, this driver for Kysely currently does not support changing the isolation level, which can be done using Kysely's TransactionBuilder.setIsolationLevel() method.
The name of isolation level placed in the object { isolationLevel: '...' } is passed by Kysely to the method PlanetScaleDriver.beginTransaction as a second parameter (usually named "settings").
In this case, it should be further passed to the PlanetScaleConnection.beginTransaction and used there, for example, in such a way:

if (settings.isolationLevel) {
    await this.#transactionConn.execute(`SET TRANSACTION ISOLATION LEVEL ${settings.isolationLevel}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant