updated readme & package for new version
This commit is contained in:
parent
9990dddd3e
commit
f815c990c3
@ -10,15 +10,15 @@ Non-blocking PostgreSQL client for node.js. Pure JavaScript and native libpq bi
|
|||||||
|
|
||||||
All examples will work with the pure javascript bindings (currently default) or the libpq native (c/c++) bindings (currently in beta)
|
All examples will work with the pure javascript bindings (currently default) or the libpq native (c/c++) bindings (currently in beta)
|
||||||
|
|
||||||
To use native libpq bindings replace `require('pg')` with `require(pg/native)`.
|
To use native libpq bindings replace `require('pg')` with `require('pg').native`.
|
||||||
|
|
||||||
The two share the same interface so __no other code changes should be required__. If you find yourself having to change code other than the require statement when switching from `pg` to `pg/native`, please report an issue.
|
The two share the same interface so __no other code changes should be required__. If you find yourself having to change code other than the require statement when switching from `pg` to `pg.native`, please report an issue.
|
||||||
|
|
||||||
### Simple, using built-in client pool
|
### Simple, using built-in client pool
|
||||||
|
|
||||||
var pg = require('pg');
|
var pg = require('pg');
|
||||||
//or native libpq bindings
|
//or native libpq bindings
|
||||||
//var pg = require('pg/native')
|
//var pg = require('pg').native
|
||||||
|
|
||||||
var conString = "tcp://postgres:1234@localhost/postgres";
|
var conString = "tcp://postgres:1234@localhost/postgres";
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ The two share the same interface so __no other code changes should be required__
|
|||||||
|
|
||||||
### Evented api
|
### Evented api
|
||||||
|
|
||||||
var pg = require('pg'); //native libpq bindings = `var pg = require('pg/native')`
|
var pg = require('pg'); //native libpq bindings = `var pg = require('pg').native`
|
||||||
var conString = "tcp://postgres:1234@localhost/postgres";
|
var conString = "tcp://postgres:1234@localhost/postgres";
|
||||||
|
|
||||||
var client = new pg.Client(conString);
|
var client = new pg.Client(conString);
|
||||||
|
@ -2,10 +2,12 @@ var EventEmitter = require('events').EventEmitter;
|
|||||||
var Client = require(__dirname+'/client');
|
var Client = require(__dirname+'/client');
|
||||||
var defaults = require(__dirname + '/defaults');
|
var defaults = require(__dirname + '/defaults');
|
||||||
var pool = require(__dirname + "/client-pool").init(Client);
|
var pool = require(__dirname + "/client-pool").init(Client);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Client: Client,
|
Client: Client,
|
||||||
Connection: require(__dirname + '/connection'),
|
Connection: require(__dirname + '/connection'),
|
||||||
connect: pool.connect,
|
connect: pool.connect,
|
||||||
end: pool.end,
|
end: pool.end,
|
||||||
defaults: defaults
|
defaults: defaults,
|
||||||
|
native: require(__dirname + '/native')
|
||||||
}
|
}
|
||||||
|
13
package.json
13
package.json
@ -1,14 +1,17 @@
|
|||||||
{ "name": "pg",
|
{ "name": "pg",
|
||||||
"version": "0.2.8",
|
"version": "0.3.0",
|
||||||
"description": "PostgreSQL client",
|
"description": "PostgreSQL client - pure javascript & libpq with the same API",
|
||||||
|
"keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"],
|
||||||
"homepage": "http://github.com/brianc/node-postgres",
|
"homepage": "http://github.com/brianc/node-postgres",
|
||||||
"repository" : {
|
"repository" : {
|
||||||
"type" : "git",
|
"type" : "git",
|
||||||
"url" : "git://github.com/brianc/node-postgres.git"
|
"url" : "git://github.com/brianc/node-postgres.git"
|
||||||
},
|
},
|
||||||
"author" : "Brian Carlson <brian.m.carlson@gmail.com>",
|
"author" : "Brian Carlson <brian.m.carlson@gmail.com>",
|
||||||
"main" : "./lib/index",
|
"main" : "./lib",
|
||||||
"directories" : { "lib" : "./lib" },
|
"scripts" : {
|
||||||
"scripts" : { "test" : "make test" },
|
"test" : "make test",
|
||||||
|
"install" : "node-waf configure build || true"
|
||||||
|
},
|
||||||
"engines" : { "node": ">= 0.2.2" }
|
"engines" : { "node": ">= 0.2.2" }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user