Cross-platform client for PostgreSQL databases
Go to file
2014-10-27 15:49:43 -05:00
screenshots Update screenshots take 2 2014-10-26 18:28:51 -05:00
static Fix CSV export for multi-line queries 2014-10-26 18:21:35 -05:00
.gitignore Serve assets with bindata 2014-10-13 14:40:56 -05:00
.travis.yml Use make dev to build with travis 2014-10-26 12:13:18 -05:00
api.go Move table information pane into sidebar 2014-10-26 17:16:35 -05:00
client.go Set a correct content type header for CSV endpoint 2014-10-18 08:15:13 -07:00
LICENSE License, readme 2014-10-13 21:02:04 -05:00
main.go Use exit(0) when printing version 2014-10-27 15:49:43 -05:00
Makefile Add darwin/386 to build list 2014-10-27 15:26:14 -05:00
README.md Rename --httpPort flag to --listen 2014-10-26 18:43:33 -05:00
TODO.md Update todo 2014-10-26 18:55:29 -05:00

pgweb

Web-based PostgreSQL database browser written in Go.

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.

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            Print version
  -d            Enable debugging mode (false)
      --url=    Database connection string
      --host=   Server hostname or IP (localhost)
      --port=   Server port (5432)
      --user=   Database user (postgres)
      --db=     Database name (postgres)
      --ssl=    SSL option (disable)
      --listen= HTTP server listen port (8080)

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.

Contributors

License

The MIT License (MIT)

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