@icon-solutions/balthazar-query-builder
v1.6.8
Published
This package is a query-builder used to convert data from the segment-builder into SQL-queries.
Downloads
25
Readme
Balthazar Query Builder
Balthazar Query Builder is a NPM package that provides functonality to convert data from Icon Segment Builder into SQL-queries.
How to use
Installation
The package is a private NPM package and is (so far) only available within the Icon Solutions development team.
npm install @icon-solutions/balthazar-query-builder
Functions
queryBuilder(queryData)
A function that takes queryData as input and returns an object containing a SQL-query providing matches on given input, a request status and a message.
countQueryBuilder(queryData)
A function that take queryData as input and returns a object containing a SQL-query providing number of matches on given input, a request status and a message.
Example usage
import { queryBuilder, countQueryBuilder, QueryData, QueryResult } from '@icon-solutions/balthazar-query-builder';
const buildQueryHandler = (queryData: QueryData) => {
const query: QueryResult = queryBuilder(queryData);
console.log("Query: ", query);
const count: QueryResult = countQueryBuilder(queryData);
console.log("Count: ", count);
};