/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/ptree/pt_alter_keyspace.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 | | // Tree node definitions for ALTER KEYSPACE statement. |
16 | | //-------------------------------------------------------------------------------------------------- |
17 | | |
18 | | #ifndef YB_YQL_CQL_QL_PTREE_PT_ALTER_KEYSPACE_H_ |
19 | | #define YB_YQL_CQL_QL_PTREE_PT_ALTER_KEYSPACE_H_ |
20 | | |
21 | | #include "yb/yql/cql/ql/ptree/tree_node.h" |
22 | | #include "yb/yql/cql/ql/ptree/pt_keyspace_property.h" |
23 | | |
24 | | namespace yb { |
25 | | namespace ql { |
26 | | |
27 | | //-------------------------------------------------------------------------------------------------- |
28 | | // ALTER KEYSPACE statement. |
29 | | |
30 | | class PTAlterKeyspace : public TreeNode { |
31 | | public: |
32 | | //------------------------------------------------------------------------------------------------ |
33 | | // Public types. |
34 | | typedef MCSharedPtr<PTAlterKeyspace> SharedPtr; |
35 | | typedef MCSharedPtr<const PTAlterKeyspace> SharedPtrConst; |
36 | | |
37 | | //------------------------------------------------------------------------------------------------ |
38 | | // Constructor and destructor. |
39 | | PTAlterKeyspace(MemoryContext *memctx, |
40 | | YBLocationPtr loc, |
41 | | const MCSharedPtr<MCString>& name, |
42 | | const PTKeyspacePropertyListNode::SharedPtr& keyspace_properties); |
43 | | virtual ~PTAlterKeyspace(); |
44 | | |
45 | | template<typename... TypeArgs> |
46 | 44 | inline static PTAlterKeyspace::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) { |
47 | 44 | return MCMakeShared<PTAlterKeyspace>(memctx, std::forward<TypeArgs>(args)...); |
48 | 44 | } |
49 | | |
50 | | // Node type. |
51 | 104 | virtual TreeNodeOpcode opcode() const override { |
52 | 104 | return TreeNodeOpcode::kPTAlterKeyspace; |
53 | 104 | } |
54 | | |
55 | | // Node semantics analysis. |
56 | | virtual CHECKED_STATUS Analyze(SemContext *sem_context) override; |
57 | | void PrintSemanticAnalysisResult(SemContext *sem_context); |
58 | | |
59 | | // Keyspace name. |
60 | 85 | const char* name() const { |
61 | 85 | return name_->c_str(); |
62 | 85 | } |
63 | | |
64 | 0 | PTKeyspacePropertyListNode::SharedPtr keyspace_properties() const { |
65 | 0 | return keyspace_properties_; |
66 | 0 | } |
67 | | |
68 | | private: |
69 | | MCSharedPtr<MCString> name_; |
70 | | const PTKeyspacePropertyListNode::SharedPtr keyspace_properties_; |
71 | | }; |
72 | | |
73 | | } // namespace ql |
74 | | } // namespace yb |
75 | | |
76 | | #endif // YB_YQL_CQL_QL_PTREE_PT_ALTER_KEYSPACE_H_ |