
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
larvitdb-pg
Advanced tools
image:https://travis-ci.org/larvit/larvitdb-pg.svg?branch=master[] image:https://coveralls.io/repos/github/larvit/larvitdb-pg/badge.svg?branch=master[]
= Database wrapper for pg (PostgreSQL)
Database wrapper for the pg npm package. Use this to add:
== Installation
npm i larvitdb-pg
== Usage
=== Initialization
import { Db } from 'larvitdb-pg';
// All parameters are optional
const db = new Db({ log: log, // Logging object. Will default to a simple console logger if not provided host: 'database.server.com', // Hostname of the server to connect to, can also be a socket, like this: '/cloudsql/myproject:zone:mydb' port: 3211, // Port, ignored if host is a socket user: 'dbuser', // Database account username password: 'secretpassword', // Database account password database: 'mydb', // Database name within the database server });
// OR
=== Querying
==== Simple query
A direct query to any connection in the pool
==== Simple query to specific connection
For example if you want to lock tables and run multiple queries on the samme connection.
==== Escape data
Either you use a database connection as in the example above, or you do like this:
=== Check if database connection is ready
To see when the database connection is ready to recieve commands. Will automatically connect if that is not done already.
However, a query can be ran before ready(), it will wait until the database connection is ready.
== Custom functions
Remove all tables from current database
This function will clean the current database from all tables, in the public schema, by removing and then recreating it.
== Version history
=== v1.0.0
=== v0.5.1
=== v0.5
=== v0.4
=== v0.2
=== v0.1
FAQs
Database wrapper for pg (PostgreSQL)
We found that larvitdb-pg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.