sqlmodel_postgres/protocol/mod.rs
1//! PostgreSQL wire protocol implementation.
2//!
3//! PostgreSQL uses a simple message format with a type byte and length prefix.
4//! This module provides encoding/decoding for all frontend and backend messages.
5//!
6//! # Message Format
7//!
8//! ## Standard Message (after startup)
9//! ```text
10//! +------+--------+------------------+
11//! | Type | Length | Payload |
12//! | 1B | 4B | (Length-4) bytes |
13//! +------+--------+------------------+
14//! ```
15//!
16//! Length includes itself (4 bytes) but not the type byte.
17//!
18//! ## Startup Message (first message from client)
19//! ```text
20//! +--------+------------------+
21//! | Length | Payload |
22//! | 4B | (Length-4) bytes |
23//! +--------+------------------+
24//! ```
25//!
26//! No type byte for startup message.
27
28mod messages;
29mod reader;
30mod writer;
31
32pub use messages::*;
33pub use reader::MessageReader;
34pub use writer::MessageWriter;