generator-egress
Version:
An egress-bootstrap generator for Yeoman
48 lines (47 loc) • 7.3 kB
JSON
{
"name": "pg",
"version": "2.11.1",
"description": "PostgreSQL client - pure javascript & libpq with the same API",
"keywords": [
"postgres",
"pg",
"libpq",
"postgre",
"database",
"rdbms"
],
"homepage": "http://github.com/brianc/node-postgres",
"repository": {
"type": "git",
"url": "git://github.com/brianc/node-postgres.git"
},
"author": {
"name": "Brian Carlson",
"email": "brian.m.carlson@gmail.com"
},
"main": "./lib",
"dependencies": {
"generic-pool": "2.0.3",
"buffer-writer": "1.0.0",
"pgpass": "0.0.1",
"nan": "~0.6.0"
},
"devDependencies": {
"jshint": "1.1.0",
"semver": "~1.1.4"
},
"scripts": {
"test": "make test-travis connectionString=postgres://postgres@localhost:5432/postgres",
"install": "node-gyp rebuild || (exit 0)"
},
"engines": {
"node": ">= 0.8.0"
},
"readme": "#node-postgres\n\n[](http://travis-ci.org/brianc/node-postgres)\n\nPostgreSQL client for node.js. Pure JavaScript and native libpq bindings.\n\n## Installation\n\n npm install pg\n \n## Examples\n\n### Simple\n\nConnect to a postgres instance, run a query, and disconnect.\n\n```javascript\nvar pg = require('pg'); \n//or native libpq bindings\n//var pg = require('pg').native\n\nvar conString = \"postgres://postgres:1234@localhost/postgres\";\n\nvar client = new pg.Client(conString);\nclient.connect(function(err) {\n if(err) {\n return console.error('could not connect to postgres', err);\n }\n client.query('SELECT NOW() AS \"theTime\"', function(err, result) {\n if(err) {\n return console.error('error running query', err);\n }\n console.log(result.rows[0].theTime);\n //output: Tue Jan 15 2013 19:12:47 GMT-600 (CST)\n client.end();\n });\n});\n\n```\n\n### Client pooling\n\nTypically you will access the PostgreSQL server through a pool of clients. node-postgres ships with a built in pool to help get you up and running quickly.\n\n```javascript\nvar pg = require('pg');\nvar conString = \"postgres://postgres:1234@localhost/postgres\";\n\npg.connect(conString, function(err, client, done) {\n if(err) {\n \treturn console.error('error fetching client from pool', err);\n }\n client.query('SELECT $1::int AS numbor', ['1'], function(err, result) {\n //call `done()` to release the client back to the pool\n done();\n \n if(err) {\n return console.error('error running query', err);\n }\n console.log(result.rows[0].numbor);\n //output: 1\n });\n});\n\n```\n\n## Documentation\n\nDocumentation is a work in progress primarily taking place on the github WIKI\n\n### [Documentation](https://github.com/brianc/node-postgres/wiki)\n\n## Native Bindings\n\nnode-postgres contains a pure JavaScript driver and also exposes JavaScript bindings to libpq. You can use either interface. I personally use the JavaScript bindings as the are quite fast, and I like having everything implemented in JavaScript.\n\nTo use native libpq bindings replace `require('pg')` with `require('pg').native`. If you __do not__ need or want the native bindings at all, consider using [node-postgres-pure](https://github.com/brianc/node-postgres-pure) instead which does not include them.\n\nThe 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` or `pg.js`, please report an issue.\n\n## Features\n\n* pure JavaScript client and native libpq bindings share _the same api_\n* optional connection pooling\n* extensible js<->postgresql data-type coercion\n* supported PostgreSQL features\n * parameterized queries\n * named statements with query plan caching\n * async notifications with `LISTEN/NOTIFY`\n * bulk import & export with `COPY TO/COPY FROM`\n\n## Contributing\n\n__I love contributions.__\n\nYou are welcome contribute via pull requests. If you need help getting the tests running locally feel free to email me or gchat me.\n\nI will __happily__ accept your pull request if it:\n- _has tests_\n- looks reasonable\n- does not break backwards compatibility\n- satisfies jshint\n\nInformation about the testing processes is in the [wiki](https://github.com/brianc/node-postgres/wiki/Testing).\n\nIf you need help or have questions about constructing a pull request I'll be glad to help out as well.\n\n## Support\n\nIf at all possible when you open an issue please provide\n- version of node\n- version of postgres\n- smallest possible snippet of code to reproduce the problem\n\nUsually I'll pop the code into the repo as a test. Hopefully the test fails. Then I make the test pass. Then everyone's happy!\n\n\nIf you need help or run into _any_ issues getting node-postgres to work on your system please report a bug or contact me directly. I am usually available via google-talk at my github account public email address.\n\nI usually tweet about any important status updates or changes to node-postgres. \nFollow me [@briancarlson](https://twitter.com/briancarlson) to keep up to date.\n\n\n## Extras\n\nnode-postgres is by design _low level_ with the bare minimum of abstraction. These might help out:\n\n- https://github.com/brianc/node-pg-query-stream\n- https://github.com/brianc/node-pg-cursor\n- https://github.com/brianc/node-pg-copy-streams\n- https://github.com/grncdr/node-any-db\n- https://github.com/brianc/node-sql\n\n\n## Production Use\n* [yammer.com](http://www.yammer.com)\n* [bayt.com](http://bayt.com)\n* [bitfloor.com](https://bitfloor.com)\n* [Vendly](http://www.vend.ly)\n* [SaferAging](http://www.saferaging.com)\n* [CartoDB](http://www.cartodb.com)\n* [Heap](https://heapanalytics.com)\n* [zoomsquare](http://www.zoomsquare.com/)\n* [WhenToManage](http://www.whentomanage.com)\n\n_If you use node-postgres in production and would like your site listed here, fork & add it._\n\n\n## License\n\nCopyright (c) 2010 Brian Carlson (brian.m.carlson@gmail.com)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/brianc/node-postgres/issues"
},
"_id": "pg@2.11.1",
"_from": "pg@2.x"
}