MCPcopy Create free account
hub / github.com/erans/pgsqlite / send_query

Function send_query

tests/python/test_protocol_trace.py:22–25  ·  view source on GitHub ↗

Send simple query

(sock, query)

Source from the content-addressed store, hash-verified

20 return msg_type, msg_data
21
22def send_query(sock, query):
23 """Send simple query"""
24 msg = b'Q' + struct.pack('>I', 4 + len(query) + 1) + query.encode() + b'\x00'
25 sock.send(msg)
26
27# Connect
28sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

Callers 1

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected