You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@ambassify/aql-postgres

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ambassify/aql-postgres

AQL postgres utilities

0.3.1
Source
npmnpm
Version published
Weekly downloads
8
Maintainers
1
Weekly downloads
 
Created
Source

aql-postgres

Uitilities to run AQL queries on postgres databases. Currently it only supports building the condition part of the query.

More information about AQL can be found in the spec.

Note that this utility builds raw SQL strings based on your input. You yourself are responsible for making sure identifiers en values are properly escaped before feeding the AQL query to this utility.

Usage

npm install --save @ambassify/aql-postgres
const pgAQL = require('@ambassify/aql-postgres');

const condition = {
    operator: 'and',
    value: [
        { key: 'e.type', operator: 'in', value: [ 'video', 'image' ] },
        { key: 'e.likes', operator: 'gte', value: 10 },
    ]
};

const query = `
    SELECT *
    FROM engagement e
    WHERE ${pgAQL.condition(condition)}
`;

// use your favorite driver to execure the query
const results = await knex().raw(query);

FAQs

Package last updated on 13 Oct 2020

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.