pgroles-core
Core manifest, diff, SQL rendering, and export primitives for pgroles.
This crate contains the pure data-model and planning logic behind the pgroles
CLI and operator. It does not connect to PostgreSQL itself.
What It Includes
- YAML manifest parsing and expansion
- Normalized role graph types
- Convergent diff planning
- Version-aware SQL rendering via
SqlContext - Export of live state back into a flat manifest
What It Does Not Include
- Database introspection
- CLI argument parsing
- Kubernetes reconciliation
Typical Use
use ;
let yaml = r#"
roles:
- name: analytics
login: true
"#;
let policy = parse_manifest?;
let expanded = expand_manifest?;
let desired = from_expanded?;
let current = default;
let changes = diff;
let sql = render_all_with_context;
assert!;
# Ok::
Related Crates
pgroles-inspect: build the currentRoleGraphfrom a live databasepgroles-cli: end-user CLI built on this crate
Full project documentation: https://github.com/hardbyte/pgroles