Skip to content

Commit fcd4f62

Browse files
committed
Update readme
1 parent 450d96a commit fcd4f62

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fastify.get('/db_data', async function (req, reply) {
131131

132132
If needed `pool` instance can be accessed via `fastify.oracle[.dbname].pool`
133133

134-
## Use of scoped executions
134+
## Use of `transact`
135135

136136
```js
137137
const fastify = require('fastify')
@@ -146,15 +146,15 @@ fastify.register(require('fastify-oracle'), {
146146

147147
fastify.post('/user/:username', (req, reply) => {
148148
// will return a promise, fastify will send the result automatically
149-
return fastify.oracle.scope(async conn => {
149+
return fastify.oracle.transact(async conn => {
150150
// will resolve to commit, or reject with an error
151151
return conn.execute(`INSERT INTO USERS (NAME) VALUES('JIMMY')`)
152152
})
153153
})
154154

155-
/* or with a scope callback
155+
/* or with a transact callback
156156
157-
fastify.oracle.scope(conn => {
157+
fastify.oracle.transact(conn => {
158158
return conn.execute('SELECT * FROM DUAL')
159159
},
160160
function onResult (err, result) {
@@ -166,7 +166,7 @@ fastify.oracle.scope(conn => {
166166

167167
/* or with a commit callback
168168
169-
fastify.oracle.scope((conn, commit) => {
169+
fastify.oracle.transact((conn, commit) => {
170170
conn.execute('SELECT * FROM DUAL', (err, res) => {
171171
commit(err, res)
172172
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fastify-oracle",
3-
"version": "3.1.1",
3+
"version": "3.2.0",
44
"description": "A plugin for Fastify to provide Oracle DB connections",
55
"main": "plugin.js",
66
"scripts": {

0 commit comments

Comments
 (0)