File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ cdef class CoreProtocol:
144
144
145
145
cdef _ensure_connected(self )
146
146
147
+ cdef WriteBuffer _build_parse_message(self , str stmt_name, query)
147
148
cdef WriteBuffer _build_bind_message(self , str portal_name,
148
149
str stmt_name,
149
150
WriteBuffer bind_data)
Original file line number Diff line number Diff line change @@ -684,6 +684,17 @@ cdef class CoreProtocol:
684
684
if self .con_status != CONNECTION_OK:
685
685
raise apg_exc.InternalClientError(' not connected' )
686
686
687
+ cdef WriteBuffer _build_parse_message(self , str stmt_name, query):
688
+ cdef WriteBuffer buf
689
+
690
+ buf = WriteBuffer.new_message(b' P' )
691
+ buf.write_str(stmt_name, self .encoding)
692
+ buf.write_str(query, self .encoding)
693
+ buf.write_int16(0 )
694
+
695
+ buf.end_message()
696
+ return buf
697
+
687
698
cdef WriteBuffer _build_bind_message(self , str portal_name,
688
699
str stmt_name,
689
700
WriteBuffer bind_data):
@@ -762,11 +773,7 @@ cdef class CoreProtocol:
762
773
763
774
packet = WriteBuffer.new()
764
775
765
- buf = WriteBuffer.new_message(b' P' )
766
- buf.write_str(stmt_name, self .encoding)
767
- buf.write_str(query, self .encoding)
768
- buf.write_int16(0 )
769
- buf.end_message()
776
+ buf = self ._build_parse_message(stmt_name, query)
770
777
packet.write_buffer(buf)
771
778
772
779
buf = WriteBuffer.new_message(b' D' )
You can’t perform that action at this time.
0 commit comments