File tree 2 files changed +22
-35
lines changed
2 files changed +22
-35
lines changed Original file line number Diff line number Diff line change @@ -154,13 +154,11 @@ class Connection extends EventEmitter {
154
154
}
155
155
156
156
// send bind message
157
- // "more" === true to buffer the message until flush() is called
158
157
bind ( config ) {
159
158
this . _send ( serialize . bind ( config ) )
160
159
}
161
160
162
161
// send execute message
163
- // "more" === true to buffer the message until flush() is called
164
162
execute ( config ) {
165
163
this . _send ( serialize . execute ( config ) )
166
164
}
Original file line number Diff line number Diff line change @@ -176,30 +176,26 @@ class Query extends EventEmitter {
176
176
}
177
177
178
178
_getRows ( connection , rows ) {
179
- connection . execute (
180
- {
181
- portal : this . portal ,
182
- rows : rows ,
183
- } ,
184
- true
185
- )
179
+ connection . execute ( {
180
+ portal : this . portal ,
181
+ rows : rows ,
182
+ } )
186
183
connection . flush ( )
187
184
}
188
185
186
+ // http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
189
187
prepare ( connection ) {
190
188
// prepared statements need sync to be called after each command
191
189
// complete or when an error is encountered
192
190
this . isPreparedStatement = true
191
+
193
192
// TODO refactor this poor encapsulation
194
193
if ( ! this . hasBeenParsed ( connection ) ) {
195
- connection . parse (
196
- {
197
- text : this . text ,
198
- name : this . name ,
199
- types : this . types ,
200
- } ,
201
- true
202
- )
194
+ connection . parse ( {
195
+ text : this . text ,
196
+ name : this . name ,
197
+ types : this . types ,
198
+ } )
203
199
}
204
200
205
201
if ( this . values ) {
@@ -211,24 +207,17 @@ class Query extends EventEmitter {
211
207
}
212
208
}
213
209
214
- // http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
215
- connection . bind (
216
- {
217
- portal : this . portal ,
218
- statement : this . name ,
219
- values : this . values ,
220
- binary : this . binary ,
221
- } ,
222
- true
223
- )
224
-
225
- connection . describe (
226
- {
227
- type : 'P' ,
228
- name : this . portal || '' ,
229
- } ,
230
- true
231
- )
210
+ connection . bind ( {
211
+ portal : this . portal ,
212
+ statement : this . name ,
213
+ values : this . values ,
214
+ binary : this . binary ,
215
+ } )
216
+
217
+ connection . describe ( {
218
+ type : 'P' ,
219
+ name : this . portal || '' ,
220
+ } )
232
221
233
222
this . _getRows ( connection , this . rows )
234
223
}
You can’t perform that action at this time.
0 commit comments