YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/yql/pggate/pg_delete.h
Line
Count
Source (jump to first uncovered line)
1
//--------------------------------------------------------------------------------------------------
2
// Copyright (c) YugaByte, Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
// in compliance with the License.  You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software distributed under the License
10
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
// or implied.  See the License for the specific language governing permissions and limitations
12
// under the License.
13
//--------------------------------------------------------------------------------------------------
14
15
#ifndef YB_YQL_PGGATE_PG_DELETE_H_
16
#define YB_YQL_PGGATE_PG_DELETE_H_
17
18
#include <memory>
19
#include <utility>
20
21
#include "yb/yql/pggate/pg_dml_write.h"
22
23
namespace yb {
24
namespace pggate {
25
26
//--------------------------------------------------------------------------------------------------
27
// DELETE
28
//--------------------------------------------------------------------------------------------------
29
30
class PgDelete : public PgDmlWrite {
31
 public:
32
  PgDelete(PgSession::ScopedRefPtr pg_session, const PgObjectId& table_id, bool is_single_row_txn)
33
116k
      : PgDmlWrite(std::move(pg_session), table_id, is_single_row_txn) {}
34
35
233k
  StmtOp stmt_op() const override { return StmtOp::STMT_DELETE; }
36
37
0
  void SetIsPersistNeeded(const bool is_persist_needed) {
38
0
    write_req_->set_is_delete_persist_needed(is_persist_needed);
39
0
  }
40
41
 private:
42
116k
  PgsqlWriteRequestPB::PgsqlStmtType stmt_type() const override {
43
116k
    return PgsqlWriteRequestPB::PGSQL_DELETE;
44
116k
  }
45
};
46
47
}  // namespace pggate
48
}  // namespace yb
49
50
#endif // YB_YQL_PGGATE_PG_DELETE_H_