smarm-pg 0.1.0: the Postgres client from the urus + smarm Conduit server

Extracted from rust-urus-markk116 (db/wire.rs, db/types.rs). Changes on the way:
- Config (was DbConfig) takes startup options; plan_cache_mode/jit are now the app's choice
- PgConn::query for single statements
- bool parameters and results; FromSql for time::OffsetDateTime (feature time)
  replaces the app-specific Timestamp
- a parameter count mismatch is refused before sending and leaves the connection usable
- lib denies unwrap/expect, as smarm does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011iFkM6QYfk9aJxpog3uuTj
This commit is contained in:
Mark Kalsbeek
2026-10-20 21:39:01 +02:00
co-authored by Claude Opus 5.5
commit 43adca39b5
11 changed files with 1681 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
[package]
name = "smarm-pg"
version = "0.1.0"
edition = "2021"
rust-version = "1.95"
description = "A small Postgres client for the smarm actor runtime: blocking calls that park on fd readiness"
license = "MIT"
[dependencies]
smarm = { git = "https://git.kalsbeek.dev/Markk116/smarm", tag = "v0.8.1" }
postgres-protocol = "0.6"
bytes = "1"
libc = "0.2"
time = { version = "0.3", optional = true }
[features]
default = ["time"]
# `FromSql` for `time::OffsetDateTime` (timestamptz).
time = ["dep:time"]
[lints.clippy]
# As in smarm: library code doesn't hide panics behind unwrap/expect.
unwrap_used = "deny"
expect_used = "deny"