@@ -116,7 +116,7 @@ test('retrieves a cached pool', (t) => {
116
116
} )
117
117
} )
118
118
119
- test ( 'execution scope with promise' , ( t ) => {
119
+ test ( 'transact with promise' , ( t ) => {
120
120
t . plan ( 6 )
121
121
122
122
const fastify = Fastify ( )
@@ -126,7 +126,7 @@ test('execution scope with promise', (t) => {
126
126
t . error ( err )
127
127
t . ok ( fastify . oracle . pool )
128
128
129
- fastify . oracle . scope ( conn => {
129
+ fastify . oracle . transact ( conn => {
130
130
return conn . execute ( 'SELECT * FROM DUAL' )
131
131
} ) . then ( ( res , err ) => {
132
132
t . error ( err )
@@ -140,7 +140,7 @@ test('execution scope with promise', (t) => {
140
140
} )
141
141
} )
142
142
143
- test ( 'execution scope with callback' , ( t ) => {
143
+ test ( 'transact with callback' , ( t ) => {
144
144
t . plan ( 6 )
145
145
146
146
const fastify = Fastify ( )
@@ -150,7 +150,7 @@ test('execution scope with callback', (t) => {
150
150
t . error ( err )
151
151
t . ok ( fastify . oracle . pool )
152
152
153
- fastify . oracle . scope ( conn => {
153
+ fastify . oracle . transact ( conn => {
154
154
return conn . execute ( 'SELECT * FROM DUAL' )
155
155
} ,
156
156
function ( err , result ) {
@@ -164,7 +164,7 @@ test('execution scope with callback', (t) => {
164
164
} )
165
165
} )
166
166
167
- test ( 'execution scope with execute callback' , ( t ) => {
167
+ test ( 'transact with commit callback' , ( t ) => {
168
168
t . plan ( 6 )
169
169
170
170
const fastify = Fastify ( )
@@ -174,7 +174,7 @@ test('execution scope with execute callback', (t) => {
174
174
t . error ( err )
175
175
t . ok ( fastify . oracle . pool )
176
176
177
- fastify . oracle . scope ( ( conn , commit ) => {
177
+ fastify . oracle . transact ( ( conn , commit ) => {
178
178
conn . execute ( 'SELECT * FROM DUAL' , function ( err , result ) {
179
179
commit ( err , result )
180
180
} )
@@ -189,7 +189,7 @@ test('execution scope with execute callback', (t) => {
189
189
} )
190
190
} )
191
191
192
- test ( 'execution scope with promise (error)' , ( t ) => {
192
+ test ( 'transact with promise (error)' , ( t ) => {
193
193
t . plan ( 5 )
194
194
195
195
const fastify = Fastify ( )
@@ -199,7 +199,7 @@ test('execution scope with promise (error)', (t) => {
199
199
t . error ( err )
200
200
t . ok ( fastify . oracle . pool )
201
201
202
- fastify . oracle . scope ( conn => {
202
+ fastify . oracle . transact ( conn => {
203
203
return conn . execute ( 'SELECT * FROM ??' )
204
204
} ) . catch ( ( err ) => {
205
205
t . is ( err . message , 'ORA-00911: invalid character' )
@@ -212,7 +212,7 @@ test('execution scope with promise (error)', (t) => {
212
212
} )
213
213
} )
214
214
215
- test ( 'execution scope with callback (error)' , ( t ) => {
215
+ test ( 'transact with callback (error)' , ( t ) => {
216
216
t . plan ( 6 )
217
217
218
218
const fastify = Fastify ( )
@@ -222,7 +222,7 @@ test('execution scope with callback (error)', (t) => {
222
222
t . error ( err )
223
223
t . ok ( fastify . oracle . pool )
224
224
225
- fastify . oracle . scope ( conn => {
225
+ fastify . oracle . transact ( conn => {
226
226
return conn . execute ( 'SELECT * FROM ??' )
227
227
} ,
228
228
function ( err , res ) {
@@ -236,7 +236,7 @@ test('execution scope with callback (error)', (t) => {
236
236
} )
237
237
} )
238
238
239
- test ( 'execution scope with execute callback (error)' , ( t ) => {
239
+ test ( 'transact with commit callback (error)' , ( t ) => {
240
240
t . plan ( 6 )
241
241
242
242
const fastify = Fastify ( )
@@ -246,7 +246,7 @@ test('execution scope with execute callback (error)', (t) => {
246
246
t . error ( err )
247
247
t . ok ( fastify . oracle . pool )
248
248
249
- fastify . oracle . scope ( ( conn , commit ) => {
249
+ fastify . oracle . transact ( ( conn , commit ) => {
250
250
conn . execute ( 'SELECT * FROM ??' , function ( err , result ) {
251
251
commit ( err , result )
252
252
} )
@@ -261,7 +261,7 @@ test('execution scope with execute callback (error)', (t) => {
261
261
} )
262
262
} )
263
263
264
- test ( 'execution scope with callback + invalid connection pool' , ( t ) => {
264
+ test ( 'transact with callback + invalid connection pool' , ( t ) => {
265
265
t . plan ( 6 )
266
266
267
267
const fastify = Fastify ( )
@@ -271,7 +271,7 @@ test('execution scope with callback + invalid connection pool', (t) => {
271
271
t . error ( err )
272
272
t . ok ( fastify . oracle . pool )
273
273
274
- fastify . oracle . scope ( conn => {
274
+ fastify . oracle . transact ( conn => {
275
275
return conn . execute ( 'SELECT * FROM DUAL' )
276
276
} ,
277
277
function ( err , res ) {
@@ -285,7 +285,7 @@ test('execution scope with callback + invalid connection pool', (t) => {
285
285
} )
286
286
} )
287
287
288
- test ( 'execution scope with promise + invalid connection pool' , ( t ) => {
288
+ test ( 'transact with promise + invalid connection pool' , ( t ) => {
289
289
t . plan ( 5 )
290
290
291
291
const fastify = Fastify ( )
@@ -295,7 +295,7 @@ test('execution scope with promise + invalid connection pool', (t) => {
295
295
t . error ( err )
296
296
t . ok ( fastify . oracle . pool )
297
297
298
- fastify . oracle . scope ( conn => {
298
+ fastify . oracle . transact ( conn => {
299
299
return conn . execute ( 'SELECT * FROM DUAL' )
300
300
} ) . catch ( ( err ) => {
301
301
t . is ( err . message , 'ORA-24415: Missing or null username.' )
0 commit comments