Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
react-sql-query-builder
Advanced tools
Readme
An SQL Query Builder Based on React.
npm install react-sql-query-builder
or
yarn add react-sql-query-builder
<div id="wrap"></div>
import { QueryBuilder } from "react-sql-query-builder";
const queryBuilder = new QueryBuilder();
const rules = [{
condition: 'AND',
id: 0,
rules: [{
id: 3,
operator: 1,
value: 9
}, {
condition: 'OR',
id: 9,
rules: [{
id: 4,
operator: 2,
value: 'JAPAN'
}]
}]
}];
const fields = [
{ name: "ID", id: 1 },
{ name: "User", id: 2 },
{ name: "Age", id: 3 },
{ name: "Nation", id: 4 },
{ name: "Category", id: 8, type: "Category", categoryList: [{id: 100, name: 'toms'}, {id: 101, name: 'jerry'}] },
{ name: "Rate", id: 9, type: "Rate" },
{ name: "Date Picker", id: 5, type: "DatePicker" },
{ name: "Month Picker", id: 6, type: "MonthPicker" },
{ name: "Range Picker", id: 7, type: "RangePicker" }
];
const operators = [
{ name: 'equal', id: 1, symbol: '=' },
{ name: 'not equal', id: 2, symbol: '!=' },
{ name: 'is not null', id: 3, value: 'disabled', symbol: 'is not null' },
{ name: 'is null', id: 4, value: 'disabled', 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' },
{ name: 'between', id: 11, symbol: 'between' },
{ name: 'not between', id: 12, symbol: 'not between' }
];
queryBuilder.init({
rules,
fields,
operators,
id: "wrap",
handleChange: (rules) => {
// console.log(rules)
}
})
FAQs
React SQL Query Builder
The npm package react-sql-query-builder receives a total of 8 weekly downloads. As such, react-sql-query-builder popularity was classified as not popular.
We found that react-sql-query-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.