MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
index_meta.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Wangyunlai on 2021/5/12.
13//
14
15#pragma once
16
17#include <string>
18#include "common/rc.h"
19
20class TableMeta;
21class FieldMeta;
22
23namespace Json {
24class Value;
25} // namespace Json
26
34{
35public:
36 IndexMeta() = default;
37
38 RC init(const char *name, const FieldMeta &field);
39
40public:
41 const char *name() const;
42 const char *field() const;
43
44 void desc(std::ostream &os) const;
45
46public:
47 void to_json(Json::Value &json_value) const;
48 static RC from_json(const TableMeta &table, const Json::Value &json_value, IndexMeta &index);
49
50protected:
51 std::string name_; // index's name
52 std::string field_; // field's name
53};
字段元数据
Definition: field_meta.h:31
描述一个索引
Definition: index_meta.h:34
表元数据
Definition: table_meta.h:30
属性的值
Definition: value.h:40