/ never-odd-or-even / back / node_modules / pg-connection-string /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[TXT]README.md39 years ago3.1K 
[   ]index.js39 years ago2.6K 
[   ]package.json2 years ago2.0K 
[   ]LICENSE39 years ago1.1K 
[TXT]index.d.ts39 years ago363  
README.md

pg-connection-string

NPM

Build Status Coverage Status

Functions for dealing with a PostgresSQL connection string

parse method taken from node-postgres Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com) MIT License

Usage

var parse = require('pg-connection-string').parse;

var config = parse('postgres://someuser:somepassword@somehost:381/somedatabase')

The resulting config contains a subset of the following properties:

Connection Strings

The short summary of acceptable URLs is:

But see below for more details.

UNIX Domain Sockets

When user and password are not given, the socket path follows socket:, as in socket:/var/run/pgsql. This form can be shortened to just a path: /var/run/pgsql.

When 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.

Query parameters follow a ? character, including the following special query parameters:

TCP Connections

TCP connections to the Postgres server are indicated with pg: or postgres: schemes (in fact, any scheme but socket: is accepted). If username and password are included, they should be urlencoded. The database name, however, should not be urlencoded.

Query parameters follow a ? character, including the following special query parameters:

A bare relative URL, such as salesdata, will indicate a database name while leaving other properties empty.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80