Skip to content

Commit

Permalink
fix mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
bengl committed Aug 15, 2024
1 parent 919c2d0 commit 12a8da8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/datadog-instrumentations/src/mariadb.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function createWrapQueryCallback (options) {
}
}

function wrapConnection (Connection, promiseMethod) {
function wrapConnection (promiseMethod, Connection) {
return function (options) {
Connection.apply(this, arguments)

Expand Down Expand Up @@ -170,13 +170,13 @@ addHook({ name, file: 'lib/pool.js', versions: ['>=3'] }, (Pool) => {
})

addHook({ name, file: 'lib/connection.js', versions: ['>=2.5.2 <3'] }, (Connection) => {
return shimmer.wrap(Connection, wrapConnection(Connection, '_queryPromise'))
return shimmer.wrapFunction(Connection, wrapConnection.bind(null, '_queryPromise'))
})

addHook({ name, file: 'lib/connection.js', versions: ['>=2.0.4 <=2.5.1'] }, (Connection) => {
return shimmer.wrap(Connection, wrapConnection(Connection, 'query'))
return shimmer.wrapFunction(Connection, wrapConnection.bind(null, 'query'))
})

addHook({ name, file: 'lib/pool-base.js', versions: ['>=2.0.4 <3'] }, (PoolBase) => {
return shimmer.wrap(PoolBase, wrapPoolBase(PoolBase))
return shimmer.wrapFunction(PoolBase, wrapPoolBase)
})

0 comments on commit 12a8da8

Please sign in to comment.