15.6.0-8 • Published 1 month ago

postgresql-dist v15.6.0-8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

postgresql-dist

Use postgresql as an npm module for tighter integration with node apps (e.g. test fixtures).

Usage

npm install postgresql-dist

import postgresql from 'postgresql-dist'
import pg from 'pg'

const postgresqlServer = await postgresql()
const client = new pg.Client({
  host: postgresqlServer.socketDir,
  database: 'postgres',
})
await client.connect()
console.log((await client.query('SELECT NOW()')).rows)
await client.end()
await postgresqlServer.stop()