Skip to content

Commit 43e7933

Browse files
committed
reusable querys
1 parent e1030a9 commit 43e7933

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/pg/lib/query.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ class Query {
4747
get portal() {
4848
return this._config.portal || ''
4949
}
50+
get query_timeout(){
51+
return this._config.query_timeout
52+
}
53+
clear(){
54+
this._result.clear()
55+
}
5056

5157
requiresPreparation() {
5258
if (this.queryMode === 'extended') {

packages/pg/lib/result.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ class Result {
2323
this._prebuiltEmptyResultObject = null
2424
}
2525

26+
clear(){
27+
this.command = null
28+
this.rowCount = null
29+
this.oid = null
30+
this.rows = []
31+
this.fields = []
32+
this._parsers = undefined
33+
}
34+
2635
// adds a command complete message
2736
addCommandComplete(msg) {
2837
var match

0 commit comments

Comments
 (0)