Socket
Book a DemoInstallSign in
Socket

qsql

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qsql

# An Express middleware to convert query parameters to SQL query.

1.0.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Attention: not for a usage in current status. In deep development! Please, don't install it for now. Wait for the future versions.

An Express middleware to convert query parameters to SQL query.

Features

  • Provide a simple language on-top of url query parameters format to constructing SQL queries.
  • Automatically construct knex builder object based on query parameters.
  • Provide ability to get raw SQL query as string or with bindings to use anywhere.

Install

npm i qsql --save

Usage

Configuration

const qsql = require('qsql');
const express = require('express');

const app = express();

app.use(qsql({
    client: 'pg'
}));

app.get('/products', (req, res, next) => {
    // req.qsql - ready to use `knex` builder
    // use req.qsql.toString() to get SQL query as string
    // use req.qsql.toSQL() to get SQL query with bindings
});

app.listen(process.env.PORT);

FAQs

Package last updated on 27 Apr 2022

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.