Oracle - get direct connection - stored proc


#1

Hello, I’m a grails (with Oracle) developer trying out Adonis JS with Oracle

I was able to get some things working on it, including using the Database.raw function to do direct queries. But, I had problems with calling stored procedures because of the issues described here:

So, for that and other reasons… I’d like to be able to get the “direct” connection object from the connection-pool that is available through the Database object. I tried following what was described here:

But could not get it to work… If I do something like this:
let knex = await Database.knex;
let myConnection = await knex.client;
myConnection.execute

It gives an error that myConnection is undefined

Could someone assist in helping me obtain the connection object from the pool?


#2

Hello!

Yes Database object is a proxy layer, so it may get confusing to read underlying properties.

What u need is following

Database.connection('name-from-config').knex

#3

Thanks for that! Got it working

Follow up question… The post at:

They show that after they call the stored-procedure, they do “releaseConnection”… Should I do that within the context of an Adonis app as well?