Cross-platform client for PostgreSQL databases
Go to file
2014-11-05 18:01:10 -06:00
Godeps godeps 2014-10-30 17:35:27 -07:00
screenshots Update screenshots take 2 2014-10-26 18:28:51 -05:00
static Disable results cell cropping if running analyze query manually 2014-11-04 10:07:22 -06:00
.gitignore vendor in the bindata 2014-10-30 17:35:27 -07:00
.travis.yml Test on go tip 2014-10-30 16:46:14 -05:00
api.go Add favicon 2014-11-03 19:06:05 -06:00
app.json remove pvh 2014-10-31 13:52:41 -07:00
bindata.go Update assets 2014-11-05 18:01:10 -06:00
CHANGELOG.md Modify markdown format in changelog file 2014-10-29 19:55:32 -05:00
client.go Add API method to connect to server with given url 2014-10-31 22:37:58 -05:00
Dockerfile Use entrypoint, remove env vars 2014-10-29 19:21:03 -07:00
LICENSE License, readme 2014-10-13 21:02:04 -05:00
main.go Merge pull request #43 from pvh/master 2014-11-05 17:56:04 -06:00
Makefile Have only one target that specifies the asset bindata 2014-10-31 11:31:59 +00:00
Procfile binding snafu 2014-10-31 13:42:01 -07:00
README.md Merge pull request #56 from learn-linux-kernel/master 2014-11-05 17:56:34 -06:00
statements.go Move all SQL statements into a separate file 2014-10-29 22:53:29 -05:00

pgweb

Web-based PostgreSQL database browser written in Go.

Build Status

Overview

This is a web-based browser for PostgreSQL database server. Its written in Go and works on Mac OSX, Linux and Windows machines. Main idea behind using Go for the backend is to utilize language's ability for cross-compile source code for multiple platforms. This project is an attempt to create a very simple and portable application to work with PostgreSQL databases.

Features:

  • Connect to local or remote server
  • Browse tables and table rows
  • Get table details: structure, size, indices, row count
  • Execute SQL query and run analyze on it
  • Export query results to CSV
  • View query history

Installation

Please visit Github Releases to download a precompiled binary for your operating system.

Currently supported:

  • Mac OSX 64bit
  • Linux 32/64bit
  • Windows 32/64bit

Supported PostgreSQL versions:

  • 9.1
  • 9.2
  • 9.3

Older versions of PostgreSQL might also work but this project is not tested on 8.x branches.

Run on Heroku

Deploy

Usage

Start server:

pgweb --host localhost --user myuser --db mydb

You can also specify a connection URI instead of individual flags:

pgweb --url postgres://user:password@host:port/database

It works great with Heroku Postgres if you need to troubleshoot production database or simply run a few queries.

Full CLI options:

Usage:
  pgweb [OPTIONS]

Application Options:
  -v, --version    Print version
  -d, --debug      Enable debugging mode (false)
      --url=       Database connection string
      --host=      Server hostname or IP (localhost)
      --port=      Server port (5432)
      --user=      Database user (postgres)
      --pass=      Password for user
      --db=        Database name (postgres)
      --ssl=       SSL option (disable)
      --bind=      HTTP server host (localhost)
      --listen=    HTTP server listen port (8080)
      --auth-user= HTTP basic auth user
      --auth-pass= HTTP basic auth password
  -s, --skip-open  Skip browser open on start

Compile from source

Go 1.3+ is required. You can install Go with homebrew:

brew install go

To compile source code run the following command:

make setup
make dev

This will produce pgweb binary in the current directory.

There's also a task to compile binaries for other operating systems:

make build

Under the hood it uses gox. Compiled binaries will be stored into ./bin directory.

Use in Docker

Build the image. (Docker version 1.1)

docker build -t your-username/pgweb .

Run the container

docker run [OPTIONS of docker] your-username/pgweb [OPTIONS of pgweb]

demo:

postgresql container:

docker run	-d --name="postgresql" 	\
			-p 5432:5432 			\			
			-e USER="testuser" 		\
			-e DB="testdb" 			\
			-e PASS="test123" 		\
			paintedfox/postgresql

pgweb containers:

docker run -d -p 8082:8080 your-username/pgweb \
			--url postgres://testuser:test123@your-ip:5432/testdb  \
			--bind 0.0.0.0

Then open http://your-ip:8082 in your browser

Contributors

License

The MIT License (MIT)

Copyright (c) 2014 Dan Sosedoff, dan.sosedoff@gmail.com