1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Postgres wire protocol message encoding and decoding.
//!
//! This module provides:
//!
//! - [`PgProtocol`] - Extension trait for writing frontend messages to any buffer
//! - [`backend`] - Backend message parsing and types
//! - [`frontend`] - Frontend message encoding and types
//!
//! # Example
//!
//! ```
//! use bytes::BytesMut;
//! use pg_stream::message::{PgProtocol, Bindable};
//!
//! let mut buf = BytesMut::new();
//!
//! // Simple query
//! buf.query("SELECT 1");
//!
//! // Extended query protocol
//! buf.parse(Some("stmt"))
//! .query("SELECT $1::int")
//! .finish()
//! .bind(Some("stmt"))
//! .finish(&[&42i32 as &dyn Bindable])
//! .execute(None, 0)
//! .sync();
//! ```
pub
pub
pub use ;
pub use ;