| Crates.io | diesel-pg-explain |
| lib.rs | diesel-pg-explain |
| version | 1.0.0 |
| created_at | 2025-05-14 18:49:57.632021+00 |
| updated_at | 2025-05-14 18:49:57.632021+00 |
| description | Wrap Diesel PostgreSQL queries in EXPLAIN and parse the plan into structured Rust types. |
| homepage | |
| repository | https://github.com/johnlepikhin/diesel-pg-explain |
| max_upload_size | |
| id | 1673835 |
| size | 11,521 |
A lightweight helper crate for wrapping Diesel PostgreSQL queries
in EXPLAIN (FORMAT JSON) and parsing the result into structured Rust types.
This crate is intended for diagnostics, performance analysis, query logging, and automated tooling that works with PostgreSQL query plans.
EXPLAIN (FORMAT JSON)ExplainPlan treeuse diesel::prelude::*;
use diesel_pg_explain::{ExplainWrapped, ExplainPlan};
let connection = &mut establish_connection();
let query = users::table.filter(users::age.gt(30));
// Wrap the query with EXPLAIN
let plan: ExplainPlan = query.wrap_explain().explain(connection)?;
// Print the query plan tree
println!("{:#?}", plan);