File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 MysqlQueryCompiler ,
1313 QueryCompiler ,
1414 QueryResult ,
15+ TransactionSettings ,
1516} from 'kysely'
1617
1718/**
@@ -89,8 +90,8 @@ class PlanetScaleDriver implements Driver {
8990 return new PlanetScaleConnection ( this . #client)
9091 }
9192
92- async beginTransaction ( conn : PlanetScaleConnection ) : Promise < void > {
93- return await conn . beginTransaction ( )
93+ async beginTransaction ( conn : PlanetScaleConnection , settings : TransactionSettings ) : Promise < void > {
94+ return await conn . beginTransaction ( settings )
9495 }
9596
9697 async commitTransaction ( conn : PlanetScaleConnection ) : Promise < void > {
@@ -159,8 +160,11 @@ class PlanetScaleConnection implements DatabaseConnection {
159160 }
160161 }
161162
162- async beginTransaction ( ) {
163+ async beginTransaction ( settings : TransactionSettings ) {
163164 this . #transactionConn = this . #transactionConn ?? this . #client. connection ( )
165+ if ( settings . isolationLevel ) {
166+ await this . #transactionConn. execute ( `SET TRANSACTION ISOLATION LEVEL ${ settings . isolationLevel } ` )
167+ }
164168 await this . #transactionConn. execute ( 'BEGIN' )
165169 }
166170
You can’t perform that action at this time.
0 commit comments