{"name":"pg-connection-string","version":"0.1.2","description":"Functions for dealing with a PostgresSQL connection string","main":"index.js","scripts":{"test":"tap ./test"},"repository":{"type":"git","url":"https://github.com/iceddev/pg-connection-string"},"keywords":["pg","connection","string","parse"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/iceddev/pg-connection-string/issues"},"homepage":"https://github.com/iceddev/pg-connection-string","dependencies":{},"devDependencies":{"tap":"^0.4.11"},"gitHead":"245abd6daf838d6d2e0424debcfffc2e8b3e3508","_id":"pg-connection-string@0.1.2","_shasum":"a27c7888f8621c64bb0a2f0ea9d615e20cda4363","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"phated","email":"blaine@iceddev.com"},"maintainers":[{"name":"phated","email":"blaine@iceddev.com"}],"dist":{"shasum":"a27c7888f8621c64bb0a2f0ea9d615e20cda4363","tarball":"http://registry-npm.ywwl.com/pg-connection-string/download/pg-connection-string-0.1.2.tgz","integrity":"sha512-TLvTi/F7ynQNNpe9exMTx8ByOn4+/tdVDZ6yeQpDQ90GwHrlQHyqihbVYoV59quyZEAFh662sRaAlT/EXWMN6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDrG6JykWYd3ZV4KAVY9VWBVCch1XbM22Ueq9eclmXf8AiAF/W8JTty8shN/qzfeldmGe5kSjJXG78XrA3Sg8NWEyA=="}],"size":3235,"noattachment":false,"key":"/pg-connection-string/-/pg-connection-string-0.1.2.tgz"},"directories":{},"readme":"pg-connection-string\n====================\n\n[![NPM](https://nodei.co/npm/pg-connection-string.png?compact=true)](https://nodei.co/npm/pg-connection-string/)\n\n[![Build Status](https://travis-ci.org/iceddev/pg-connection-string.svg?branch=master)](https://travis-ci.org/iceddev/pg-connection-string)\n[![Coverage Status](https://coveralls.io/repos/github/iceddev/pg-connection-string/badge.svg?branch=master)](https://coveralls.io/github/iceddev/pg-connection-string?branch=master)\n\nFunctions for dealing with a PostgresSQL connection string\n\n`parse` method taken from [node-postgres](https://github.com/brianc/node-postgres.git)\nCopyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)\nMIT License\n\n## Usage\n\n```js\nvar parse = require('pg-connection-string').parse;\n\nvar config = parse('postgres://someuser:somepassword@somehost:381/somedatabase')\n```\n\nThe resulting config contains a subset of the following properties:\n\n* `host` - Postgres server hostname or, for UNIX domain sockets, the socket filename\n* `port` - port on which to connect\n* `user` - User with which to authenticate to the server\n* `password` - Corresponding password\n* `database` - Database name within the server\n* `client_encoding` - string encoding the client will use\n* `ssl`, either a boolean or an object with properties\n  * `rejectUnauthorized`\n  * `cert`\n  * `key`\n  * `ca`\n* any other query parameters (for example, `application_name`) are preserved intact.\n\n## Connection Strings\n\nThe short summary of acceptable URLs is:\n\n * `socket:<path>?<query>` - UNIX domain socket\n * `postgres://<user>:<password>@<host>:<port>/<database>?<query>` - TCP connection\n\nBut see below for more details.\n\n### UNIX Domain Sockets\n\nWhen user and password are not given, the socket path follows `socket:`, as in `socket:/var/run/pgsql`.\nThis form can be shortened to just a path: `/var/run/pgsql`.\n\nWhen user and password are given, they are included in the typical URL positions, with an empty `host`, as in `socket://user:pass@/var/run/pgsql`.\n\nQuery parameters follow a `?` character, including the following special query parameters:\n\n * `db=<database>` - sets the database name (urlencoded)\n * `encoding=<encoding>` - sets the `client_encoding` property\n\n### TCP Connections\n\nTCP connections to the Postgres server are indicated with `pg:` or `postgres:` schemes (in fact, any scheme but `socket:` is accepted).\nIf username and password are included, they should be urlencoded.\nThe database name, however, should *not* be urlencoded.\n\nQuery parameters follow a `?` character, including the following special query parameters:\n * `host=<host>` - sets `host` property, overriding the URL's host\n * `encoding=<encoding>` - sets the `client_encoding` property\n * `ssl=1`, `ssl=true`, `ssl=0`, `ssl=false` - sets `ssl` to true or false, accordingly\n * `sslmode=<sslmode>`\n   * `sslmode=disable` - sets `ssl` to false\n   * `sslmode=no-verify` - sets `ssl` to `{ rejectUnauthorized: false }`\n   * `sslmode=prefer`, `sslmode=require`, `sslmode=verify-ca`, `sslmode=verify-full` - sets `ssl` to true\n * `sslcert=<filename>` - reads data from the given file and includes the result as `ssl.cert`\n * `sslkey=<filename>` - reads data from the given file and includes the result as `ssl.key`\n * `sslrootcert=<filename>` - reads data from the given file and includes the result as `ssl.ca`\n\nA bare relative URL, such as `salesdata`, will indicate a database name while leaving other properties empty.\n","publish_time":1410625374349,"_cnpm_publish_time":1410625374349,"dist-tags":{"beta":"2.7.1-alpha.0","latest":"2.14.1"}}