From 031cdd738aff89705b66ba9d06449c03bff4bacd Mon Sep 17 00:00:00 2001 From: PangeaCake Date: Wed, 7 Jan 2015 14:24:50 -0800 Subject: [PATCH 1/4] Add postgres information to README.md --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3acf6c..4715bf6 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Where `path` represents where you want the files stored ### Redis -To use redis storage you must install the redis package in npm +To use redis storage you must install the `redis` package in npm `npm install redis` @@ -106,6 +106,28 @@ Once you've done that, your config section should look like: } ``` +### Postgres + +To use postgres storage you must install the `pg` package in npm + +`npm install pg` + +Once you've done that, your config section should look like: + +``` json +{ + "type": "postgres", + "connectionUrl": "postgres://user:password@host:5432/database +} +``` + +You can also just set the environment variable for `DATABASE_URL` to your database connection url. + +Lastly, you will have to manually add a table to your postgres database: + +`create table entries (id serial primary key, key varchar(255) not null, value text not null, expiration int, unique(key));` + + You can also set an `expire` option to the number of seconds to expire keys in. This is off by default, but will constantly kick back expirations on each view or post. From 05cb051bc8160f96d5e02050b61d7ed26727477a Mon Sep 17 00:00:00 2001 From: PangeaCake Date: Wed, 7 Jan 2015 14:25:43 -0800 Subject: [PATCH 2/4] Tiny fix --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4715bf6..3753f0d 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,12 @@ Once you've done that, your config section should look like: } ``` +You can also set an `expire` option to the number of seconds to expire keys in. +This is off by default, but will constantly kick back expirations on each view +or post. + +All of which are optional except `type` with very logical default values. + ### Postgres To use postgres storage you must install the `pg` package in npm @@ -123,11 +129,10 @@ Once you've done that, your config section should look like: You can also just set the environment variable for `DATABASE_URL` to your database connection url. -Lastly, you will have to manually add a table to your postgres database: +You will have to manually add a table to your postgres database: `create table entries (id serial primary key, key varchar(255) not null, value text not null, expiration int, unique(key));` - You can also set an `expire` option to the number of seconds to expire keys in. This is off by default, but will constantly kick back expirations on each view or post. From e93f98112b17b13cdb2e2b82021e411e49c7bfc4 Mon Sep 17 00:00:00 2001 From: PangeaCake Date: Wed, 7 Jan 2015 14:27:46 -0800 Subject: [PATCH 3/4] Add `pg` as dependency and update node version One of the dependencies seemed to be broken with the previous node version, but this node version worked perfectly --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6bf128b..358297a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "redis-url": "0.1.0", "redis": "0.8.1", "uglify-js": "1.3.3", - "busboy": "0.2.4" + "busboy": "0.2.4", + "pg": "4.1.1" }, "devDependencies": { "mocha": "*", @@ -27,7 +28,7 @@ }, "bundledDependencies": [], "engines": { - "node": "0.8.10", + "node": "0.10.35", "npm": "1.1.49" }, "bin": { From 360b325cedba2266dc5329aebeba72c41e7a93d3 Mon Sep 17 00:00:00 2001 From: PangeaCake Date: Wed, 7 Jan 2015 14:30:12 -0800 Subject: [PATCH 4/4] Smaller typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3753f0d..1e14f26 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Once you've done that, your config section should look like: ``` json { "type": "postgres", - "connectionUrl": "postgres://user:password@host:5432/database + "connectionUrl": "postgres://user:password@host:5432/database" } ```