Skip to content

Commit 4048807

Browse files
authored
fix: export pool getter from rds client (ali-sdk#102)
1 parent ceb21c7 commit 4048807

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/client.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class RDSClient extends Operator {
2323
return await this.#pool.query(sql);
2424
}
2525

26+
get pool() {
27+
return this.#pool;
28+
}
29+
2630
get stats() {
2731
return {
2832
acquiringConnections: this.#pool._acquiringConnections.length,

test/client.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ describe('test/client.test.js', () => {
3030
});
3131

3232
describe('new RDSClient(options)', () => {
33+
it('should access pool', async () => {
34+
assert(db.pool.config.connectionConfig.database);
35+
});
36+
3337
it('should connect rds success', async () => {
3438
const rows = await db.query('show tables');
3539
// console.log(rows);

0 commit comments

Comments
 (0)