/**
 * Copy of `acquireRawConnection` from knex codebase, but instead relies
 * on `getRuntimeConnectionSettings` vs `connectionSettings`
 */ export function acquireRawConnection ( ) { const client = this ; return new Promise ( function ( resolver , rejecter ) { const connection = new client . driver . Client ( client . getRuntimeConnectionSettings ( ) ) ; connection . connect ( function ( err , connection ) { if ( err ) { return rejecter ( err ) ; } connection . on ( 'error' , ( err ) => { connection . __knex__disposed = err ; } ) ; connection . on ( 'end' , ( err ) => { connection . __knex__disposed = err || 'Connection ended unexpectedly' ; } ) ; if ( ! client . version ) { return client . checkVersion ( connection ) . then ( function ( version ) { client . version = version ; resolver ( connection ) ; } ) ; } resolver ( connection ) ; } ) ; } ) . then ( function setSearchPath ( connection ) { client . setSchemaSearchPath ( connection ) ; return connection ; } ) ; }