Every byte, cross-checked
The hard part of a wire-protocol driver is proving it without standing up a server. Conduit does it two ways, both run by cargo test: golden byte vectors assert each message against the exact bytes it must produce, and an in-process mock server on a real TcpListener runs the actual driver over TCP through a full session.
# cargo test, no database needed
golden byte vectors every FE/BE message asserted byte for byte; decode(encode(x)) == x
mock server over TCP handshake, MD5 + SCRAM-SHA-256 (right pw ok, wrong pw fails,
bad server signature fails), typed rows including a NULL,
parameterized query round-trip, multi-statement result sets,
ErrorResponse -> Error::Db { code: 42601, .. }
In the extended protocol a parameter travels in the Bind message as text, so a value like robert'); DROP TABLE students;-- is always data and never SQL. And a server-declared frame above the 64 MiB cap is rejected before a single body byte is buffered, so a hostile server cannot drive the client to OOM. The mock encodes backend messages by hand while the driver decodes them, and the reverse for frontend messages, so the two halves cross-check each other.