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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! PostgreSQL driver for SQLModel Rust.
//!
//! `sqlmodel-postgres` is the **Postgres driver** for the SQLModel ecosystem. It
//! implements the PostgreSQL wire protocol from scratch using asupersync's TCP
//! primitives and exposes a `Connection` implementation for query execution.
//!
//! # Role In The Architecture
//!
//! - Implements `sqlmodel-core::Connection` for Postgres
//! - Provides authentication, protocol framing, and type conversions
//! - Powers `sqlmodel-query` execution and `sqlmodel-session` persistence
//!
//! This crate implements the PostgreSQL wire protocol from scratch using
//! asupersync's TCP primitives. It provides:
//!
//! - Message framing and parsing
//! - Authentication (cleartext, MD5, SCRAM-SHA-256)
//! - Simple and extended query protocols
//! - Connection management with state machine
//! - Type conversion between Rust and PostgreSQL types
//!
//! # Type System
//!
//! The `types` module provides comprehensive type mapping between PostgreSQL
//! and Rust types, including:
//!
//! - OID constants for all built-in types
//! - Text and binary encoding/decoding
//! - Type registry for runtime type lookup
//!
//! # Example
//!
//! ```rust,ignore
//! use sqlmodel_postgres::{PgConfig, PgConnection};
//!
//! let config = PgConfig::new()
//! .host("localhost")
//! .port(5432)
//! .user("postgres")
//! .database("mydb");
//!
//! let conn = PgConnection::connect(config)?;
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
// Console integration (feature-gated)
pub use ConnectionStage;
pub use ConsoleAware;