run method

FtsQ run(
  1. String input
)

Converts an input search query into a native SQLite FTS5 expression.

See SearchQueryConverter for an example and for a description of how the grammar of search queries accepted by this parser differs from the native SQLite FTS5 grammar. This method throws a ParserException if the input query has invalid syntax or refers to an undefined column alias.

Implementation

FtsQ run(String input) {
  try {
    return converter.parse(input).value;
  } on ParserException catch (xConverter) {
    Result<Object?> rAnalyzer;
    try {
      rAnalyzer = _analyzer.parse(input);
    } on ParserException catch (xAnalyzer) {
      rAnalyzer = xAnalyzer.failure;
    }
    if (rAnalyzer is Failure) ////
      throw ParserException(rAnalyzer);
    log.severe(
      "SearchQueryConverter failed (${xConverter.failure}), but "
      "_SearchQueryAnalyzer succeeded ($rAnalyzer); input query: "
      "${quoteWithSingleQuotes(input)}",
    );
    rethrow;
  }
}