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

Function send_startup

tests/python/test_protocol_trace.py:6–11  ·  view source on GitHub ↗

Send startup message

(sock)

Source from the content-addressed store, hash-verified

4from datetime import datetime
5
6def send_startup(sock):
7 """Send startup message"""
8 params = b'user\x00postgres\x00database\x00main\x00\x00'
9 msg_len = 4 + 4 + len(params)
10 msg = struct.pack('>II', msg_len, 196608) + params
11 sock.send(msg)
12
13def read_message(sock):
14 """Read a backend message"""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected