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

@fitzy/jsql

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

@fitzy/jsql

A utility to allow using SQL statements on js arrays of objects

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

jSQL

This is a small utility to enable using SQL style queries on JavaScript arrays of objects. Essentially it boils down to doing a reduce and a sort, but it means you don't have to set them up each time and think about it.

Install

$ npm i @fitzy/jsql

Usage

import  *  as  jsql  from  '@fitzy/jsql';

jsql.select('SELECT * FROM myData', { myData: [{a: 1, b: 'foo'}, {a: 4, b: 'bar'}, ...], relatedData: [] });

The data is passed in as an array to: a) allow putting the key in the select statement, and b) allow me to expand this to have joins later

Supported Syntax

  • SELECT
  • FROM
  • WHERE (=, <=, >=, <, >, <>, like, in, between)
  • ORDER BY

Yet to Implement

  • GROUP BY
  • HAVING
  • Aggregate functions (avg, count, etc)
  • Dates
  • Aliasing (i.e. AS)

FAQs

Package last updated on 31 Oct 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