/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/ptree/pt_dml_using_clause_element.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #ifndef YB_YQL_CQL_QL_PTREE_PT_DML_USING_CLAUSE_ELEMENT_H |
15 | | #define YB_YQL_CQL_QL_PTREE_PT_DML_USING_CLAUSE_ELEMENT_H |
16 | | |
17 | | #include "yb/yql/cql/ql/ptree/tree_node.h" |
18 | | |
19 | | namespace yb { |
20 | | namespace ql { |
21 | | |
22 | | // USING clause for INSERT, UPDATE and DELETE statements. |
23 | | class PTDmlUsingClauseElement : public TreeNode { |
24 | | public: |
25 | | //------------------------------------------------------------------------------------------------ |
26 | | // Public types. |
27 | | typedef MCSharedPtr<PTDmlUsingClauseElement> SharedPtr; |
28 | | typedef MCSharedPtr<const PTDmlUsingClauseElement> SharedPtrConst; |
29 | | |
30 | | //------------------------------------------------------------------------------------------------ |
31 | | // Constructors and destructor. |
32 | | PTDmlUsingClauseElement(MemoryContext *memctx, |
33 | | YBLocationPtr loc, |
34 | | const MCSharedPtr<MCString>& name, |
35 | | const PTExprPtr& value); |
36 | | |
37 | | virtual ~PTDmlUsingClauseElement(); |
38 | | |
39 | | // Node type. |
40 | 0 | virtual TreeNodeOpcode opcode() const override { |
41 | 0 | return TreeNodeOpcode::kPTDmlUsingClauseElement; |
42 | 0 | } |
43 | | |
44 | | template<typename... TypeArgs> |
45 | | inline static PTDmlUsingClauseElement::SharedPtr MakeShared(MemoryContext *memctx, |
46 | 217 | TypeArgs&&... args) { |
47 | 217 | return MCMakeShared<PTDmlUsingClauseElement>(memctx, std::forward<TypeArgs>(args)...); |
48 | 217 | } |
49 | | |
50 | | // Node semantics analysis. |
51 | | virtual CHECKED_STATUS Analyze(SemContext *sem_context) override; |
52 | | |
53 | 194 | const PTExprPtr value() { |
54 | 194 | return value_; |
55 | 194 | } |
56 | | |
57 | | bool IsTTL() const; |
58 | | |
59 | | bool IsTimestamp() const; |
60 | | |
61 | | private: |
62 | | const MCSharedPtr<MCString> name_; |
63 | | const PTExprPtr value_; |
64 | | }; |
65 | | |
66 | | } // namespace ql |
67 | | } // namespace yb |
68 | | |
69 | | #endif // YB_YQL_CQL_QL_PTREE_PT_DML_USING_CLAUSE_ELEMENT_H |