@@ -131,7 +131,7 @@ fastify.get('/db_data', async function (req, reply) {
131
131
132
132
If needed ` pool ` instance can be accessed via ` fastify.oracle[.dbname].pool `
133
133
134
- ## Use of scoped executions
134
+ ## Use of ` transact `
135
135
136
136
``` js
137
137
const fastify = require (' fastify' )
@@ -146,15 +146,15 @@ fastify.register(require('fastify-oracle'), {
146
146
147
147
fastify .post (' /user/:username' , (req , reply ) => {
148
148
// will return a promise, fastify will send the result automatically
149
- return fastify .oracle .scope (async conn => {
149
+ return fastify .oracle .transact (async conn => {
150
150
// will resolve to commit, or reject with an error
151
151
return conn .execute (` INSERT INTO USERS (NAME) VALUES('JIMMY')` )
152
152
})
153
153
})
154
154
155
- /* or with a scope callback
155
+ /* or with a transact callback
156
156
157
- fastify.oracle.scope (conn => {
157
+ fastify.oracle.transact (conn => {
158
158
return conn.execute('SELECT * FROM DUAL')
159
159
},
160
160
function onResult (err, result) {
@@ -166,7 +166,7 @@ fastify.oracle.scope(conn => {
166
166
167
167
/* or with a commit callback
168
168
169
- fastify.oracle.scope ((conn, commit) => {
169
+ fastify.oracle.transact ((conn, commit) => {
170
170
conn.execute('SELECT * FROM DUAL', (err, res) => {
171
171
commit(err, res)
172
172
});
0 commit comments