YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/client/schema-internal.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
//
18
// The following only applies to changes made to this file as part of YugaByte development.
19
//
20
// Portions Copyright (c) YugaByte, Inc.
21
//
22
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
23
// in compliance with the License.  You may obtain a copy of the License at
24
//
25
// http://www.apache.org/licenses/LICENSE-2.0
26
//
27
// Unless required by applicable law or agreed to in writing, software distributed under the License
28
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
29
// or implied.  See the License for the specific language governing permissions and limitations
30
// under the License.
31
//
32
#ifndef YB_CLIENT_SCHEMA_INTERNAL_H
33
#define YB_CLIENT_SCHEMA_INTERNAL_H
34
35
#include <string>
36
37
#include "yb/client/schema.h"
38
39
namespace yb {
40
namespace client {
41
42
// Helper functions that convert between client-facing and internal PB enums.
43
class YBColumnSpec::Data {
44
 public:
45
  explicit Data(std::string name)
46
      : name(std::move(name)),
47
        has_type(false),
48
        has_order(false),
49
        sorting_type(SortingType::kNotSpecified),
50
        has_nullable(false),
51
        primary_key(false),
52
        hash_primary_key(false),
53
        static_column(false),
54
        is_counter(false),
55
        pg_type_oid(kPgInvalidOid),
56
23.4k
        has_rename_to(false) {
57
23.4k
  }
58
59
23.4k
  ~Data() {
60
23.4k
  }
61
62
  const std::string name;
63
64
  bool has_type;
65
  std::shared_ptr<QLType> type;
66
67
  bool has_order;
68
  int32_t order;
69
70
  SortingType sorting_type;
71
72
  bool has_nullable;
73
  bool nullable;
74
75
  bool primary_key;
76
  bool hash_primary_key;
77
78
  bool static_column;
79
80
  bool is_counter;
81
82
  int32_t pg_type_oid;
83
  bool has_pg_type_oid;
84
85
  // For ALTER
86
  bool has_rename_to;
87
  std::string rename_to;
88
};
89
90
} // namespace client
91
} // namespace yb
92
#endif // YB_CLIENT_SCHEMA_INTERNAL_H