
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@slonik/pg-driver
Advanced tools
A Node.js PostgreSQL client with strict types, detailed logging and assertions.
pgimport { createPgDriverFactory, DatabaseError } from "@slonik/pg-driver";
All Slonik errors extend from SlonikError. SlonikError uses cause property to store the original error, which might be a DatabaseError from pg. Example:
pool.on("error", (error) => {
const cause = error.cause;
if (cause instanceof DatabaseError) {
console.log(cause.code);
}
});
This allows you to handle errors based on the lower-level error codes provided by pg driver.
Example of handling all errors that could warrant a fatal error:
const fatalErrorClasses = [
// Connection Exception
"08",
// Invalid Authorization Specification
"28",
];
pool.on("error", (error) => {
if (error.cause instanceof DatabaseError) {
const classCode = error.cause.code.slice(0, 2);
if (fatalErrorClasses.includes(classCode)) {
// Initiate shutdown due to unexpected connection state.
}
}
});
FAQs
A Node.js PostgreSQL client with strict types, detailed logging and assertions.
The npm package @slonik/pg-driver receives a total of 47,619 weekly downloads. As such, @slonik/pg-driver popularity was classified as popular.
We found that @slonik/pg-driver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.