File tree Expand file tree Collapse file tree 2 files changed +22
-35
lines changed Expand file tree Collapse file tree 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 {
154154 }
155155
156156 // send bind message
157- // "more" === true to buffer the message until flush() is called
158157 bind ( config ) {
159158 this . _send ( serialize . bind ( config ) )
160159 }
161160
162161 // send execute message
163- // "more" === true to buffer the message until flush() is called
164162 execute ( config ) {
165163 this . _send ( serialize . execute ( config ) )
166164 }
Original file line number Diff line number Diff line change @@ -176,30 +176,26 @@ class Query extends EventEmitter {
176176 }
177177
178178 _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+ } )
186183 connection . flush ( )
187184 }
188185
186+ // http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
189187 prepare ( connection ) {
190188 // prepared statements need sync to be called after each command
191189 // complete or when an error is encountered
192190 this . isPreparedStatement = true
191+
193192 // TODO refactor this poor encapsulation
194193 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+ } )
203199 }
204200
205201 if ( this . values ) {
@@ -211,24 +207,17 @@ class Query extends EventEmitter {
211207 }
212208 }
213209
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+ } )
232221
233222 this . _getRows ( connection , this . rows )
234223 }
You can’t perform that action at this time.
0 commit comments