A command-line GO Postgres query visualizer, heavily inspired by pev (https://github.com/AlexTatiyants/pev)
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pev
pybindings Do not buffer JSON data, use Reader instead Aug 10, 2017
vendor Add vendored dependencies Aug 11, 2017
.gitignore
LICENSE
README.md
main.go

README.md

gocmdpev

A command-line GO Postgres query visualizer, heavily inspired by the excellent (web-based) pev

image

Usage

go get -u github.com/simon-engledew/gocmdpev

or via Homebrew:

brew tap simon-engledew/gocmdpev
brew install gocmdpev

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 gocmdpev.

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> | gocmdpev

Python 3 Bindings

Tested on python 3.4.2 built with golang:1.8.3-jessie.

Build:

go build -buildmode=c-shared -o pycmdpev.so pybindings/*
import pycmdpev

pycmdpev.visualize("<JSON EXPLAIN STRING>")

Using with Ruby on Rails

Try the pg-eyeballs gem