Skip to content

Convert PostgreSQL's keyword/value connection strings to URI connection strings.

License

Notifications You must be signed in to change notification settings

c032/node-postgresql-keyword-value-to-uri

Repository files navigation

node-postgresql-keyword-value-to-uri

Convert PostgreSQL's keyword/value connection strings to URI connection strings.

Install

npm install \
  --ignore-scripts \
  --save \
  'github:c032/node-postgresql-keyword-value-to-uri#js'

Example

import { keywordValueToUri } from "postgresql-keyword-value-to-uri";

const connectionString = keywordValueToUri(
	`host=postgresql user=user_name password='correct horse battery staple' dbname=database_name sslmode=disable`
);

// `connectionString` is "postgresql://user_name:correct%20horse%20battery%20staple@postgresql/database_name?sslmode=disable".

F.A.Q.

Why not send PR to pg-connection-string?

See brianc/node-postgres#2125.

License

MPL 2.0.

About

Convert PostgreSQL's keyword/value connection strings to URI connection strings.

Topics

Resources

License

Stars

Watchers

Forks