Skip to content

treble37/rustcmdpev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rustcmdpev

Build Status

A command-line Rust Postgres query visualizer, heavily inspired by the excellent (web-based) pev. It started out being ported from gocmdpev

Demo

rustcmdpev screenshot

Installation

Right now the installation process is manual and assumes you can compile the rust source to a binary executable for your system.

  1. Install Rust and clone the repo
  2. Build the binary executable
  3. Add the executable to your system $PATH variable

Overview

Usage

Generate a query plan with all the trimmings by prefixing your query with:

EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)

Then pipe the resulting query plan into rustcmdpev.

On MacOS you can just grab a query on your clipboard and run this one-liner:

pbpaste | sed '1s/^/EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) /' | psql -qXAt <DATABASE> | rustcmdpev

Local development

View sample output

cargo run -- '[{"Plan":{"Alias":"c0","Node Type":"Seq Scan","Parallel Aware":false,"Plan Rows":50,"Plan Width":1572,"Relation Name":"coaches","Startup Cost":0.0,"Total Cost":10.5}}]'

Testing

To see output from print statements, run with nocapture flag:

cargo test -- --nocapture

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages