Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@postgres-queries/builder

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@postgres-queries/builder

Query builder for PostgreSQL in Node.js, built for async

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Queries Builder

All query factories function takes an object as a parameter, containing the following keys:

  • table: table name on which operate the query,
  • permanentFilters: query filters provided to each underlying queries, as a plain object

Count

Build a COUNT(*) query.

import { countAll } from "postgres-queries-builder";

const countQuery = countAll({
  table: "user",
  permanentFilters: {
    active: 1
  }
});

countQuery({
  filter: {
    department: "HR"
  }
});

// SELECT COUNT(*) FROM user WHERE active = 1 AND departement = "HR"

The countQuery takes an extra object parameter whose keys are:

  • filter: extra filter to apply to the query, as a plain object

FAQs

Package last updated on 12 Dec 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc