extra-pg-english
Version:
Convert english query to informal SQL SELECT.
24 lines (21 loc) • 1.04 kB
TypeScript
/**
* Process a string of english text to generate an informal SQL-like query.
* [📘](https://github.com/nodef/extra-pg-english/wiki/convertToInformalSQL)
* @param txt english text to process
* @param fn entity test function `fn(words)`
* @param ths this argument
* @param opt optional parameters, including table name and column hints
* @returns generated SQL-like query string (promise)
*/
declare function convertToInformalSQL(txt: string, fn: Function, ths?: any, opt?: any): Promise<string>;
/**
* Convert informal SQL SELECT statements into formal SQL.
* [📘](https://github.com/nodef/extra-pg-english/wiki/convertToFormalSQL)
* @param txt SQL text to convert
* @param fn function to resolve references `fn(table, type, hint, from)`
* @param ths this argument for the function
* @param opt options for the conversion
* @returns converted SQL string (promise)
*/
declare function convertToFormalSQL(txt: string, fn: Function, ths?: any, opt?: any): Promise<any>;
export { convertToFormalSQL, convertToInformalSQL };