Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pgrest

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pgrest - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

test/dummy.js

3

History.md

@@ -0,1 +1,4 @@

0.1.1 / 2013-12-18
* update plv8x so --client is more reentrant-safe
0.1.0 / 2013-12-1

@@ -2,0 +5,0 @@ * plugin infrastructure

5

lib/cli.js

@@ -65,4 +65,2 @@ // Generated by LiveScript 1.2.0

cookiename: argv.cookiename || cfg.cookiename || null,
app: argv.app || cfg.appname || null,
websocket: argv.websocket || false,
argv: argv,

@@ -92,5 +90,2 @@ cfg: cfg

pgrest.initPlugins()(opts);
if (bootstrap == null && opts.app != null) {
bootstrap = require(opts.app);
}
if ('function' !== typeof bootstrap) {

@@ -97,0 +92,0 @@ bootstrap = (pkg = bootstrap)

@@ -16,3 +16,5 @@ // Generated by LiveScript 1.2.0

}
return plv8x['new'](conString, function(plx){
return plv8x['new'](conString, {
client: config.client
}, function(plx){
var doImport;

@@ -19,0 +21,0 @@ doImport = function(cb){

@@ -10,3 +10,3 @@ {

"description": "enable REST in postgres",
"version": "0.1.0",
"version": "0.1.1",
"main": "lib/index.js",

@@ -31,3 +31,3 @@ "bin": {

"trycatch": "1.0.x",
"plv8x": "0.6.x",
"plv8x": ">= 0.6.3",
"cors": "2.1.x",

@@ -34,0 +34,0 @@ "connect-csv": "0.0.x",

@@ -21,6 +21,16 @@ pgrest

PostgreSQL 9.0 is required; we recommend using 9.2 or later.
PostgreSQL 9.0 is required; we recommend using 9.2 or later, and nodejs `0.10.x`.
You need to install the `plv8js` extension for PostgreSQL. If you're on OS X, [Postgres.app](http://postgresapp.com) comes with it pre-installed. Otherwise, see [Installation](https://github.com/clkao/pgrest/wiki/Installation) for details.
After you install, create the `plv8` extension
psql -U <user> -c "create extension plv8"
If you got error message `Reason: image not found`
Please download the version after version `9.2.4.3`
[PostgresApp release notes](https://github.com/PostgresApp/PostgresApp/releases)
Once the extension is installed, simply use `npm` to install pgrest:

@@ -35,5 +45,5 @@

% psql test
test=# CREATE TABLE foo (id int, info json);
test=# CREATE TABLE foo (_id int, info json, tags text[]);
CREATE TABLE
test=# INSERT INTO foo VALUES (1, '{"f1":1,"f2":true,"f3":"Hi I''m \"Daisy\""}');
test=# INSERT INTO foo VALUES (1, '{"f1":1,"f2":true,"f3":"Hi I''m \"Daisy\""}', '{foo,bar}');
INSERT 0 1

@@ -48,9 +58,15 @@

curl http://127.0.0.1:3000/collections/foo?q={"id":1}
curl http://127.0.0.1:3000/collections/foo/1
curl -g 'http://127.0.0.1:3000/collections/foo?q={"_id":1}'
curl -g 'http://127.0.0.1:3000/collections/foo?q={"tags":{"$contains":"foo"}}'
The parameter is similar to [MongoLab's REST API](https://support.mongolab.com/entries/20433053-rest-api-for-mongodb) for listing documents.
Note that if you use `curl`, you should probably use `-g` to prevent curl from expanding `{}`.
## Writing:
echo '{"id": 5,"info": {"counter":5} }' | curl -D - -H 'Content-Type: application/json' -X POST -d @- http://localhost:3000/collections/foo
echo '{"_id": 5,"info": {"counter":5} }' | curl -D - -H 'Content-Type: application/json' -X POST -d @- http://localhost:3000/collections/foo

@@ -57,0 +73,0 @@ # Developing

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc