File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
MysqlQueryCompiler ,
13
13
QueryCompiler ,
14
14
QueryResult ,
15
+ TransactionSettings ,
15
16
} from 'kysely'
16
17
17
18
/**
@@ -89,8 +90,8 @@ class PlanetScaleDriver implements Driver {
89
90
return new PlanetScaleConnection ( this . #client)
90
91
}
91
92
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 )
94
95
}
95
96
96
97
async commitTransaction ( conn : PlanetScaleConnection ) : Promise < void > {
@@ -159,8 +160,11 @@ class PlanetScaleConnection implements DatabaseConnection {
159
160
}
160
161
}
161
162
162
- async beginTransaction ( ) {
163
+ async beginTransaction ( settings : TransactionSettings ) {
163
164
this . #transactionConn = this . #transactionConn ?? this . #client. connection ( )
165
+ if ( settings . isolationLevel ) {
166
+ await this . #transactionConn. execute ( `SET TRANSACTION ISOLATION LEVEL ${ settings . isolationLevel } ` )
167
+ }
164
168
await this . #transactionConn. execute ( 'BEGIN' )
165
169
}
166
170
You can’t perform that action at this time.
0 commit comments