analyzeNode method

AnalysisContext analyzeNode(
  1. AstNode node,
  2. String file, {
  3. AnalyzeStatementOptions? stmtOptions,
})

Analyzes the given node, which should be a CrudStatement. The AnalysisContext enhances the AST by reporting type hints and errors. The file should contain the full SQL source code that was used to parse the node.

The analyzer needs to know all the available tables to resolve references and result columns, so all known tables should be registered using registerTable before calling this method. The stmtOptions can be used to pass additional options used to analyze this statement only.

Implementation

AnalysisContext analyzeNode(AstNode node, String file,
    {AnalyzeStatementOptions? stmtOptions}) {
  final context = _createContext(node, file, stmtOptions);
  _analyzeContext(context);
  return context;
}