Socket
Socket
Sign inDemoInstall

react-sql-query-builder

Package Overview
Dependencies
0
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-sql-query-builder

React SQL Query Builder


Version published
Weekly downloads
7
decreased by-80%
Maintainers
1
Install size
3.07 MB
Created
Weekly downloads
 

Readme

Source

An SQL Query Builder Based on React. example

How To Use

npm install react-sql-query-builder

or

yarn add react-sql-query-builder
import Querybuilder from 'react-sql-query-builder'
  /**
   * Optional fields
    */
  const rightFields = [{ name: "OtherId", id: 1 }, { name: "OtherUser", id: 2 }];
  const fields = [
    { name: "ID", id: 119 },
    { name: "User", id: 2 },
    {
      name: "Age",
      id: 3,
      type: "SelectList",
      rightFields: rightFields
    },
    { name: "Nation", id: 4 },
    { name: "Date Picker", id: 5, type: "DatePicker" },
    { name: "Month Picker", id: 6, type: "MonthPicker" },
    { name: "Range Picker", id: 7, type: "RangePicker" }
  ];
  /**
   * Optional operators
    */
  const operators = [
        { name: 'equal', id: 1, symbol: '=' },
        { name: 'not equal', id: 2, symbol: '!=' },
        { name: 'is not null', id: 3, symbol: 'is not null' },
        { name: 'is null', id: 4, symbol: 'is null' },
        { name: 'in', id: 5, symbol: 'in' },
        { name: 'not in', id: 6, symbol: 'not in' },
        { name: 'less', id: 7, symbol: 'less' },
        { name: 'less or equal', id: 8, symbol: 'less or equal' },
        { name: 'greater', id: 9, symbol: 'greater' },
        { name: 'greater or equal', id: 10, symbol: 'greater or equal' }
      ];
  <Querybuilder 
    fields={fields} 
    operators={operators} 
    onChange={(data) => {console.log(data)}} 
  />

Keywords

FAQs

Last updated on 11 Apr 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc