sphinxql
Version:
SphinxQL query builder for Node.JS. Supports Sphinx search(2.x and 3.x) and Manticore search
17 lines (14 loc) • 368 B
text/typescript
import Expression from './Statements/Expression';
import * as sqlstring from 'sqlstring';
export function getExpressionCompare(value: any) {
if (value instanceof Expression) {
return value.getExpression();
}
if (typeof value === 'string') {
return sqlstring.escape(value);
}
if (typeof value === 'number') {
return value;
}
return value;
}