Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

pg 8.11.3

PostgreSQL client - pure javascript & libpq with the same API
Package summary
Share
0
issues
2
licenses
14
MIT
2
ISC
Package created
19 Dec 2010
Version published
16 Aug 2023
Maintainers
1
Total deps
16
Direct deps
8
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
14 Packages, Including:
buffer-writer@2.0.0
packet-reader@1.0.0
pg-cloudflare@1.1.1
pg-connection-string@2.6.4
pg-pool@3.6.2
pg-protocol@1.6.1
pg-types@2.2.0
pg@8.11.3
pgpass@1.0.5
postgres-array@2.0.0
postgres-bytea@1.0.0
postgres-date@1.0.7
postgres-interval@1.2.0
xtend@4.0.2

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
pg-int8@1.0.1
split2@4.2.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

8
All Dependencies CSV
β“˜ This is a list of pg 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
buffer-writer2.0.04.12 kBMIT
prod
packet-reader1.0.03.02 kBMIT
prod
pg-cloudflare1.1.15.13 kBMIT
prod optional
pg-connection-string2.6.48.88 kBMIT
prod
pg-pool3.6.268.12 kBMIT
prod
pg-protocol1.6.1183.15 kBMIT
prod
pg-types2.2.010.1 kBMIT
prod
pgpass1.0.54.18 kBMIT
prod

Visualizations

Frequently Asked Questions

What does pg do?

Pg, or node-postgres, is a non-blocking PostgreSQL client for Node.js. It provides pure JavaScript and optional native libpq bindings, enabling developers to create efficient, low-latency applications. The pg package is built with key features like connection pooling, extensible JavaScript to PostgreSQL data-type coercion, and support for notable PostgreSQL features such as parameterized queries, named statements with query plan caching, asynchronous notifications with 'LISTEN/NOTIFY', and bulk import and export with 'COPY TO/COPY FROM'.

How do you use pg?

To use pg in your Node.js application, start by installing it from npm using the command npm install pg. Once the package is installed, you can use it to connect to your PostgreSQL database and perform various operations. Here is a simple example of connecting to a PostgreSQL database and running a query:

const { Client } = require('pg');

const client = new Client({
  user: 'db_user',
  host: 'database_server',
  database: 'database_name',
  password: 'db_password',
  port: 5432,
});

client.connect()
  .then(() => console.log('Connected'))
  .then(() => client.query('SELECT * FROM my_table'))
  .then(results => console.table(results.rows))
  .catch(e => console.log(e))
  .finally(() => client.end())

Remember to replace 'db_user', 'database_server', 'database_name', and 'db_password' with your actual database credentials.

Where are the pg docs?

The complete and detailed documentation for node-postgres can be found at the official website https://node-postgres.com. This documentation provides a comprehensive guide on the pg package's API, different supported features, usage examples, and troubleshooting guides. You can also find additional resources on the project's GitHub wiki.