planSelect method

Plan planSelect(
  1. SelectStmt stmt
)

Implementation

Plan planSelect(SelectStmt stmt) {
  if (stmt.join != null) {
    final leftPlan = _planTable(stmt.join!.leftTable, null);
    final rightPlan = _planTable(stmt.join!.rightTable, null);
    return JoinPlan(leftPlan, rightPlan, stmt);
  }

  final meta = catalog[stmt.table];
  if (meta == null) throw Exception('Table "${stmt.table}" not found');

  return _planTable(stmt.table, stmt.where);
}