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

sql-query-helper

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

sql-query-helper

Help build sql queries in an elegant way.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

sql-query-helper

Helper to write SQL queries efficiently. Supports Typescript.

Coverage Status Build Status npm version

Installation

npm i -S sql-query-helper

Usage

import sqlHelper from "sql-query-helper"

Select

sqlHelper().select({
  table: "MY_TABLE",
  fields: ["ID", "FIRST_NAME", "LAST_NAME"],
  where: {
    ID: 1
  }
});

Insert

sqlHelper().insert({
  table: "MY_TABLE",
  fields: {
    STRING_VAL: "MY_VALUE",
    NUMBER_VAL: 1,
    DATE_VAL: new Date(2019, 5, 18, 19, 50)
  }
});

Update

sqlHelper().update({
  table: "MY_TABLE",
  fields: {
    STRING_UPDATED: "MY_STRING",
    NUMBER_UPDATED: 1
  },
  where: {
    ID: 1
  }
});

Delete

sqlHelper().delete({
  table: "MY_TABLE",
  where: {
    ID: 1
  }
});

License

MIT

Keywords

FAQs

Package last updated on 19 Aug 2019

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