pginspect

lightweight Go library for inspecting pgSQL database in a browser.
where it provides a simple UI to view schemas, tables, and table data via REST endpoints
Installation
go get github.com/epxhsid/pginspect
go mod tidy # needed to retrieve other dependencies
How to use
- Configuration example
eng, err := engine.NewConn(context.Background(), &engine.Options{
Addr: os.Getenv("DATABASE_URL"),
MaxRows: 100,
ReadOnly: true,
})
- Mount endpoint example
mux := http.NewServeMux()
httpui.Mount(mux, "/__db", eng)
- Access it via your defined endpoint, in this case:
http://ADDRESS:PORT/__db
Note
Note: engine.NewConn creates its own connection pool internally.
If you already have a *pgxpool.Pool, you can still use it by passing its connection string; this library will open a separate pool without affecting your existing connections.