const db = // connect to db
await db.execute('SET search_path=...')
try {
return await next({ ctx: { ...opts.ctx, db } })
} catch () {
// release connection
} finally {
// release connection
}
const db = // connect to db
await db.execute('SET search_path=...')
try {
return await next({ ctx: { ...opts.ctx, db } })
} catch () {
// release connection
} finally {
// release connection
}