Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

connectPg

import { connectPg } from "https://raw.githubusercontent.com/jakajancar/pgc4d/master/src/mod.ts";

Opens a new connection to a PostgreSQL server and resolves to the connection (PgConn) once authenticated and ready to accept queries.

Usage:

const db1 = await connectPg('postgres://username:password@hostname/database', { ... more opts ... });
const db2 = await connectPg({ hostname, username, password, database });
const db3 = await connectPg({ transport: 'unix', path: '/foo/bar.sock', username });

Requirements:

  • tcp with ssl (default) requires --allow-net and --unstable
  • tcp without ssl requires --allow-net
  • unix requires --allow-read and --unstable
async function connectPg(url: string, options?: ConnectPgOptions): Promise<PgConn>;
async function connectPg(options: ConnectPgOptions): Promise<PgConn>;
async function connectPg(...args: any[]): Promise<PgConn>;
§
connectPg(url: string, options?: ConnectPgOptions): Promise<PgConn>
[src]

Opens a new connection to a PostgreSQL server and resolves to the connection (PgConn) once authenticated and ready to accept queries.

Usage:

const db1 = await connectPg('postgres://username:password@hostname/database', { ... more opts ... });
const db2 = await connectPg({ hostname, username, password, database });
const db3 = await connectPg({ transport: 'unix', path: '/foo/bar.sock', username });

Requirements:

  • tcp with ssl (default) requires --allow-net and --unstable
  • tcp without ssl requires --allow-net
  • unix requires --allow-read and --unstable

§Parameters

§
url: string
[src]
§
options?: ConnectPgOptions optional
[src]

§Return Type

§
Promise<PgConn>
[src]
§
connectPg(options: ConnectPgOptions): Promise<PgConn>
[src]

§Parameters

§Return Type

§
Promise<PgConn>
[src]
§
connectPg(...args: any[]): Promise<PgConn>
[src]

§Parameters

§
...args: any[] optional
[src]

§Return Type

§
Promise<PgConn>
[src]