MCPcopy
hub / github.com/dalibo/pev2

github.com/dalibo/pev2 @v1.22.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.22.0 ↗
160 symbols 438 edges 64 files 1 documented · 1%
README

PEV2: A VueJS component to show a graphical vizualization of a PostgreSQL execution plan.

PEV2 screenshot

Usage

To use the explain vizualizer you can choose one of the following options:

Dalibo service (recommended)

explain.dalibo.com

This service is provided by Dalibo and can help you to share your plans with colleagues or customers.

All-in-one local (no installation, no network)

PEV2 can be run locally without any external internet resource.

Simply download pev2.html, open it in your favorite internet browser.

Integrated in a web application

Without building tools

<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<script src="https://unpkg.com/pev2/dist/pev2.umd.js"></script>
<link
  href="https://unpkg.com/bootstrap@5/dist/css/bootstrap.min.css"
  rel="stylesheet"
/>
<link rel="stylesheet" href="https://unpkg.com/pev2/dist/pev2.css" />




  <pev2 :plan-source="plan" plan-query="" />




<script>
  const { createApp } = Vue

  const plan = `
    Aggregate  (cost=12.50..12.51 rows=1 width=8)
      ->  Seq Scan on employees  (cost=0.00..10.00 rows=1000 width=0)
  `;

  const app = createApp({
    data() {
      return {
        plan: plan,
      }
    },
  })
  app.component("pev2", pev2.Plan)
  app.mount("#app")
</script>

See it live.

With build tools

PEV2 can be integrated as a component in a web application.

Install it:

npm install pev2

Declare the PEV2 component and use it:

import { Plan } from "pev2"
import "pev2/dist/pev2.css"

export default {
  name: "PEV2 example",
  components: {
    pev2: Plan,
  },
  data() {
    return {
      plan: plan,
      query: query,
    }
  },
}

Then add the PEV2 component to your template:




  <pev2 :plan-source="plan" :plan-query="query"></pev2>



PEV2 requires Bootstrap (CSS) to work so don't forget to add the following in you header (or load them with your favorite bundler).

<link
  href="https://unpkg.com/bootstrap@5/dist/css/bootstrap.min.css"
  rel="stylesheet"
/>

See it live.

Disclaimer

This project is a rewrite of the excellent Postgres Explain Visualizer (pev). Kudos go to Alex Tatiyants.

The pev project was initialy written in early 2016 but seems to be abandoned since then. There was no activity at all for more than 3 years and counting though there are several issues open and relevant pull requests pending.

Extension points exported contracts — how you extend this code

Sample (Interface)
(no doc)
example/src/samples.ts
PaneProps (Interface)
(no doc)
src/splitpanes.d.ts
IPlan (Interface)
(no doc)
src/interfaces.ts
Store (Interface)
(no doc)
src/store.ts
FlexHierarchyPointLink (Interface)
(no doc)
src/d3-flextree.d.ts
EaseInOutQuadOptions (Interface)
(no doc)
src/services/help-service.ts
Window (Interface)
(no doc)
example/src/main.ts
SplitpanesProps (Interface)
(no doc)
src/splitpanes.d.ts

Core symbols most depended-on inside this repo

fromSource
called by 62
src/services/plan-service.ts
createPlan
called by 39
src/services/plan-service.ts
formatDuration
called by 24
src/filters.ts
formatBytes_
called by 20
src/filters.ts
formatNodeProp
called by 20
src/filters.ts
parse
called by 6
src/store.ts
formatRows
called by 6
src/filters.ts
formatBlocks
called by 6
src/filters.ts

Shape

Function 60
Method 45
Enum 28
Interface 21
Class 6

Languages

TypeScript100%

Modules by API surface

src/services/plan-service.ts48 symbols
src/filters.ts26 symbols
src/interfaces.ts19 symbols
src/enums.ts14 symbols
src/services/help-service.ts12 symbols
src/store.ts7 symbols
src/node.ts6 symbols
example/src/idb.ts6 symbols
src/d3-flextree.d.ts5 symbols
src/services/color-service.ts4 symbols
src/dragscroll.ts4 symbols
src/splitpanes.d.ts3 symbols

Dependencies from manifests, versioned

@eslint/eslintrc3.3.0 · 1×
@eslint/js9.21.0 · 1×
@fortawesome/fontawesome-svg-core6.7.2 · 1×
@fortawesome/free-solid-svg-icons6.7.2 · 1×
@fortawesome/vue-fontawesome3.1.3 · 1×
@types/d37.4.3 · 1×
@types/humanize-duration3.27.1 · 1×
@types/lodash4.14.202 · 1×
@types/node24.7.1 · 1×
@vitejs/plugin-vue6.0.7 · 1×
@vue/eslint-config-prettier10.2.0 · 1×
@vue/eslint-config-typescript14.4.0 · 1×

For agents

$ claude mcp add pev2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact