Socket
Socket
Sign inDemoInstall

quick-pg

Package Overview
Dependencies
42
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    quick-pg

📦 A key value postgres database


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
2.57 MB
Created
Weekly downloads
 

Readme

Source

Quick Postgres

A fast & simple key | value storage for postgres.

Inspired by quick.db

Features

  • Typed
  • Incredibly similar to quick.db
  • Beginner Friendly

All issues are welcomed!

Usage


import QuickPg from 'quick-postgres';

const db = new QuickPg({
    table:"test",
    poolOptions: {
   host: 'localhost',
   user: 'postgres',
   password: '1234',
   database: 'myDatabase'
    }
})

console.log(db.set<number>("sword", 2))
console.log(db.get("sword"))

API Reference

Classes

QuickPg

QuickPg This is the main class for the QuickPostgres library.

Functions

exists Checks if a key exists or not.(key)
set Sets a value to a key in the table. Returns void or boolean depending on the success.(key, value)
get Returns the value of the specified key. The value maybe of any type depending upon the set type.(key)
delete Deletes a key and value from the table.(key)
all Returns all the contents in a table. Specifically key value pairs.()

QuickPg

QuickPg This is the main class for the QuickPostgres library.

Kind: global class

new QuickPg(qpOps)

ParamDescription
qpOpsSpecifies the QuickPostgres Options. Check out https://node-postgres.com/api/pool for pool configurations.

exists

Checks if a key exists or not.(key) ⇒ Kind: global function
Returns: boolean

ParamDescription
keythe key that you want to check if exists.

set

Sets a value to a key in the table. Returns void or boolean depending on the success.(key, value) ⇒ Kind: global function
Returns: void | boolean

ParamDescription
keyThe key you want to set the value in.
valueThe value of the key.

get

Returns the value of the specified key. The value maybe of any type depending upon the set type.(key) ⇒ Kind: global function
Returns: Promise

ParamDescription
keyThe key from where you want to get the value.

delete

Deletes a key and value from the table.(key) ⇒ Kind: global function
Returns: Promise

ParamDescription
keyThe key who's content is to be deleted.

all

Returns all the contents in a table. Specifically key value pairs.() ⇒ Kind: global function
Returns: Promise

Maintainer

rhydderchc

Keywords

FAQs

Last updated on 06 Nov 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc