Cross-platform client for PostgreSQL databases
Go to file
2014-10-10 18:56:02 -05:00
bin Update binary 2014-10-09 22:43:29 -05:00
static Add static dir 2014-10-09 19:05:51 -05:00
.gitignore Initial 2014-10-08 21:26:57 -05:00
api.go Convers query results to CSV with format flag 2014-10-10 18:56:02 -05:00
client.go Convers query results to CSV with format flag 2014-10-10 18:56:02 -05:00
main.go Update readme, fix options parsing 2014-10-10 17:20:14 -05:00
Makefile Make clean 2014-10-10 17:32:47 -05:00
README.md Update readme, fix options parsing 2014-10-10 17:20:14 -05:00

pgweb

Experiments with PostgreSQL and GO

Usage

CLI options:

-h, --host= Server hostname or IP (localhost)
-p, --port= Server port (5432)
-u, --user= Database user (postgres)
-d, --db=   Database name (postgres)

Compile

Go 1.3+ is required. To complire source execute:

go get
go build

This will produce pgweb binary in the current workdir.

API

Get current database tables:

GET /tables

Get table details:

GET /tables/:name

Execute select query:

POST /select?query=SQL
 GET /select?query=SQL

Response formats

Successful response:

{
  "columns": [
    "column_name1",
    "column_name2",
    "column_name3"
  ],
  "rows": [
    [
      "column 1 value",
      "column 2 value",
      "column 3 value" 
    ]
  ]
}

Error response:

{
  "error": "Error message"
}