diff --git a/lib/client.js b/lib/client.js index f9802e0..3111367 100644 --- a/lib/client.js +++ b/lib/client.js @@ -23,6 +23,10 @@ class RDSClient extends Operator { return await this.#pool.query(sql); } + get pool() { + return this.#pool; + } + get stats() { return { acquiringConnections: this.#pool._acquiringConnections.length, diff --git a/test/client.test.js b/test/client.test.js index d125110..229b651 100644 --- a/test/client.test.js +++ b/test/client.test.js @@ -30,6 +30,10 @@ describe('test/client.test.js', () => { }); describe('new RDSClient(options)', () => { + it('should access pool', async () => { + assert(db.pool.config.connectionConfig.database); + }); + it('should connect rds success', async () => { const rows = await db.query('show tables'); // console.log(rows);