pgroles-inspect
Database introspection, version detection, and privilege checks for pgroles.
This crate connects to PostgreSQL, inspects roles and privileges from
pg_catalog, and builds the current-state graph used by the pgroles diff
engine.
What It Includes
- Scoped inspection of managed roles, grants, memberships, and default privileges
- Unscoped inspection for brownfield manifest generation
- PostgreSQL server version detection (
server_version_num) - Managed-service privilege-level detection for supported providers
- Safety checks before dropping roles
Typical Use
use PgPool;
let pool = connect.await?;
let version = detect_pg_version.await?;
let privilege_level = detect_privilege_level.await?;
println!;
println!;
# Ok::
Notes
- This crate is intended to be paired with
pgroles-core. - Provider-aware privilege detection currently covers AWS RDS/Aurora, Google Cloud SQL, AlloyDB, and Azure Database for PostgreSQL. Other PostgreSQL-compatible managed services may still work, but warnings may be generic.
Related Crates
pgroles-core: desired-state model and SQL rendererpgroles-cli: CLI built on this crate
Full project documentation: https://github.com/hardbyte/pgroles