New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zgo.at/pg_info

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zgo.at/pg_info

  • v0.0.0-20201217021255-048639cbc5d4
  • Go
  • Socket score

Version published
Created
Source

pg_info makes it a bit easier to access the various pg_stat_* informational tables in PostgreSQL for getting metrics and such.

This is really unfinished and very much work-in-progress. You almost certainly don't want to use this yet.

Usage

Compile from source with go get zgo.at/pg_info/cmd/pg_info; this will put the binary in ~/go/bin.

There are three ways to use this: as a web interface, a CLI program, or by plugging it in to an existing Go web app:

Run HTTP server

$ pg_info serve -db '...'

The -db flag:

-db "dbname=goatcounter_paths sslmode=disable"
-db "postgres://host/db"

See pg_info help serve for some more details and flags.

CLI

Note: this isn't really usable yet; most of the focus is on the web interface for now.

$ EXPORT PGINFO_DB='...'                # Set a default for the -db flag

$ pg_info tables                        # Table overview.
$ pg_info tables -table foo -detail     # List all columns for "foo".
$ pg_info activity                      # pg_stat_activity.

$ pg_info pev 'select 1'
$ pg_info pev < query.sql

See pg_info help for some more commands and options for various commands.

Add to Go app:

Right now it kind-of requires chi:

r := chi.NewRouter()
r.Mount("/admin/sql", pghandler.New(db))

FAQs

Package last updated on 17 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc