react-querybuilder
Version:
React Query Builder component for constructing queries and filters, with utilities for executing them in various database and evaluation contexts
33 lines (32 loc) • 1.4 kB
TypeScript
import type { ParserCommonOptions } from "../../types/import";
import type { DefaultRuleGroupType, DefaultRuleGroupTypeIC, Except } from "../../types/index.noReact";
/**
* Options object for {@link parseSQL}.
*/
export interface ParseSQLOptions extends ParserCommonOptions {
paramPrefix?: string;
params?: any[] | Record<string, any>;
}
/**
* Converts a SQL `SELECT` statement into a query suitable for the
* {@link index!QueryBuilder QueryBuilder} component's `query` or `defaultQuery` props
* ({@link index!DefaultRuleGroupType DefaultRuleGroupType}).
*/
declare function parseSQL(sql: string): DefaultRuleGroupType;
/**
* Converts a SQL `SELECT` statement into a query suitable for the
* {@link index!QueryBuilder QueryBuilder} component's `query` or `defaultQuery` props
* ({@link index!DefaultRuleGroupType DefaultRuleGroupType}).
*/
declare function parseSQL(sql: string, options: Except<ParseSQLOptions, "independentCombinators"> & {
independentCombinators?: false
}): DefaultRuleGroupType;
/**
* Converts a SQL `SELECT` statement into a query suitable for the
* {@link index!QueryBuilder QueryBuilder} component's `query` or `defaultQuery` props
* ({@link index!DefaultRuleGroupType DefaultRuleGroupType}).
*/
declare function parseSQL(sql: string, options: Except<ParseSQLOptions, "independentCombinators"> & {
independentCombinators: true
}): DefaultRuleGroupTypeIC;
export { parseSQL };