Socket
Book a DemoInstallSign in
Socket

npm-json2sql

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-json2sql

This package is used for building SQL from JSON (specially build for PrimeNG)

npmnpm
Version
1.0.4
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Purpose

This package can be use to build a mysql query from json.

Usage:


myjson = {
    "filters": {
        "transaction_number": {
            "value": 56,
            "matchMode": "contains"
        },
        "supplier_id": {
            "value": 2,
            "matchMode": "equal"
        }
    },
    "first": 0,
    "rows": 10,
    "sortField": "total_amount",
    "sortOrder": 1
};
mytable = "ph_outgoing_payment";
console.log(myfunction(myjson, mytable));

Output:

Select * from ph_outgoing_payment WHERE transaction_number LIKE '%56%' AND supplier_id = '2' ORDER BY total_amount ASC limit 10 OFFSET 0

Keywords

json

FAQs

Package last updated on 05 Jul 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