Skip to content

Commit 16d1453

Browse files
committed
added option to override max prepared statements cache
1 parent d702c72 commit 16d1453

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Connection (opts)
5252
this._paused_packets = new Queue();
5353

5454
this._statements = LRU({
55-
max: 1000,
55+
max: this.config.maxPreparedStatements,
5656
dispose: function (key, statement) { statement.close(); }
5757
});
5858

lib/connection_config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function ConnectionConfig (options) {
7070
options.flags || '');
7171

7272
this.connectAttributes = options.connectAttributes;
73+
this.maxPreparedStatements = options.maxPreparedStatements || 16000;
7374
}
7475

7576
ConnectionConfig.mergeFlags = function (default_flags, user_flags) {

0 commit comments

Comments
 (0)