Skip to main content

uqa_pg_wire/
lib.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! `PostgreSQL` wire protocol 3.0 through 3.2 primitives for UQA-compatible servers.
8//!
9//! This crate intentionally stops at protocol parsing and message encoding.
10//! It does not own sockets, tasks, TLS, authentication storage, query
11//! planning, or SQL execution. Integrators feed byte slices into the frontend
12//! decoders and translate decoded protocol messages into their own server and
13//! engine logic.
14//!
15//! Consequently this crate preserves cancellation requests, explicit error
16//! responses, and failed-transaction status bytes, but it cannot decide when
17//! an engine error or rollback must produce them. That mapping is a required
18//! responsibility of the embedding server; there is no query-execution bridge
19//! in this crate that could turn an execution failure into an empty success.
20
21pub mod auth;
22pub mod backend;
23mod codec;
24pub mod frontend;
25pub mod protocol;
26
27pub use auth::{AuthenticationExchange, AuthenticationResponse, AuthenticationResponseKind};
28pub use backend::{
29    encode_all, encode_all_for_protocol, Authentication, BackendKeyData, BackendMessage,
30    CopyResponse, ErrorOrNotice, FieldDescription, GSSEncResponse, NoticeSeverity,
31    NotificationResponse, SSLResponse,
32};
33pub use frontend::{
34    decode_frontend, decode_frontend_with_max, decode_startup, decode_startup_with_max, Bind,
35    CloseTarget, DescribeTarget, Execute, FrontendMessage, FunctionCall, Parse, PasswordMessage,
36    StartupFrame, StartupMessage, StartupNegotiation,
37};
38pub use protocol::{
39    CancelKey, DecodeError, DecodeOutcome, FormatCode, PgWireError, ProtocolVersion,
40    TransactionStatus, CANCEL_REQUEST_CODE, GSSENC_REQUEST_CODE, MAX_CANCEL_KEY_LEN,
41    MIN_BACKEND_KEY_DATA_KEY_LEN, MIN_CANCEL_REQUEST_KEY_LEN, PROTOCOL_VERSION_3_0,
42    PROTOCOL_VERSION_3_2, SSL_REQUEST_CODE,
43};