Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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)
The npm package larvitdb-pg receives a total of 11 weekly downloads. As such, larvitdb-pg popularity was classified as not popular.
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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.