postgres-chat

command module
v0.0.0-...-f2fd484 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

README

To write to table call users in a postgres database called chitchat

First create the database using command

CREATE DATABASE chitchat
  WITH OWNER = adrianjackson
       ENCODING = 'UTF8'
       TABLESPACE = pg_default
       LC_COLLATE = 'en_US.UTF-8'
       LC_CTYPE = 'en_US.UTF-8'
       CONNECTION LIMIT = -1;

Then create the table using

CREATE TABLE users
(
  id serial NOT NULL,
  uuid character varying(64) NOT NULL,
  name character varying(255),
  email character varying(255) NOT NULL,
  password character varying(255) NOT NULL,
  created_at timestamp without time zone NOT NULL,
  updated_at timestamp without time zone NOT NULL,
  CONSTRAINT users_pkey PRIMARY KEY (id),
  CONSTRAINT users_email_key UNIQUE (email),
  CONSTRAINT users_uuid_key UNIQUE (uuid)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE users
  OWNER TO adrianjackson;



Then you can add users like so

curl -i -v -X POST -d"name=Berry Bonds&email=househo@kreaft.com&password=ulancestance" http://localhost:3000/users/create

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL