Public | Automated Build

Last pushed: 2 years ago
Short Description
Postgrest example
Full Description

Luke's Postgrest Example

I created this as I tried out Postgrest. It's a simple example of Postgrest,
which uses Docker containers for a PostgreSQL database and Postgrest.

Steps

  1. Get PostgreSQL up and running in a docker image: run-pg.sh

  2. Create a database, and user:

    • Run psql.sh to get into your database.
    • Create a database, user and table:
      • CREATE DATABASE pgrest;
      • CREATE USER pgrest WITH PASSWORD 'password1';
      • GRANT ALL PRIVILEGES ON DATABASE pgrest TO pgrest;
      • CREATE TABLE foo (at timestamptz default ('now'::text)::timestamptz);
      • INSERT INTO foo VALUES ('now');
  3. Start up Postgrest using run.sh

  4. Connect via curl or browser to the postgrest container ip, port 3000 at /foo

    • you should see the value we inserted above
Docker Pull Command
Owner
lukec
Source Repository

Comments (0)