/Users/deen/code/yugabyte-db/src/yb/yql/pggate/pg_truncate_colocated.h
Line | Count | Source |
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_TRUNCATE_COLOCATED_H_ |
16 | | #define YB_YQL_PGGATE_PG_TRUNCATE_COLOCATED_H_ |
17 | | |
18 | | #include "yb/yql/pggate/pg_dml_write.h" |
19 | | #include "yb/yql/pggate/pg_env.h" |
20 | | #include "yb/yql/pggate/pg_session.h" |
21 | | #include "yb/yql/pggate/pg_statement.h" |
22 | | |
23 | | namespace yb { |
24 | | namespace pggate { |
25 | | |
26 | | //-------------------------------------------------------------------------------------------------- |
27 | | // Colocated TRUNCATE |
28 | | //-------------------------------------------------------------------------------------------------- |
29 | | |
30 | | class PgTruncateColocated : public PgDmlWrite { |
31 | | public: |
32 | | PgTruncateColocated( |
33 | | PgSession::ScopedRefPtr pg_session, |
34 | | const PgObjectId& table_id, |
35 | | const bool is_single_row_txn = false) |
36 | 19 | : PgDmlWrite(std::move(pg_session), table_id, is_single_row_txn) {} |
37 | | |
38 | 19 | StmtOp stmt_op() const override { return StmtOp::STMT_TRUNCATE; } |
39 | | |
40 | | private: |
41 | 19 | PgsqlWriteRequestPB::PgsqlStmtType stmt_type() const override { |
42 | 19 | return PgsqlWriteRequestPB::PGSQL_TRUNCATE_COLOCATED; |
43 | 19 | } |
44 | | }; |
45 | | |
46 | | } // namespace pggate |
47 | | } // namespace yb |
48 | | |
49 | | #endif // YB_YQL_PGGATE_PG_TRUNCATE_COLOCATED_H_ |