execute method

Future<QueryResult> execute(
  1. Statement stmt
)

Implementation

Future<QueryResult> execute(Statement stmt) async {
  return switch (stmt) {
    SelectStmt s      => _select(s),
    InsertStmt s      => _insert(s),
    UpdateStmt s      => _update(s),
    DeleteStmt s      => _delete(s),
    CreateTableStmt s => _create(s),
    DropTableStmt s   => _drop(s),
    BeginStmt()       => _begin(),
    CommitStmt()      => _commit(),
    RollbackStmt()    => _rollback(),
    ExplainStmt s     => _explain(s),
    AnalyzeStmt s     => _analyze(s),
    _ => throw UnsupportedError(
            'Unknown statement type: ${stmt.runtimeType}'),
  };
}