1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * 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 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SCHEMA_CONSTANT_H 17 #define SCHEMA_CONSTANT_H 18 19 #include <cstdint> 20 #include <string> 21 22 // This header is supposed to be included only in source files. Do not include it in any header files. 23 namespace DistributedDB { 24 class SchemaConstant final { 25 public: 26 static const std::string KEYWORD_SCHEMA_VERSION; 27 static const std::string KEYWORD_SCHEMA_MODE; 28 static const std::string KEYWORD_SCHEMA_DEFINE; 29 static const std::string KEYWORD_SCHEMA_INDEXES; 30 static const std::string KEYWORD_SCHEMA_SKIPSIZE; 31 static const std::string KEYWORD_SCHEMA_TYPE; 32 static const std::string KEYWORD_SCHEMA_TABLE; 33 static const std::string KEYWORD_INDEX; // For FlatBuffer-Schema 34 static const std::string KEYWORD_TABLE_MODE; 35 36 static const std::string KEYWORD_MODE_STRICT; 37 static const std::string KEYWORD_MODE_COMPATIBLE; 38 39 static const std::string KEYWORD_TYPE_BOOL; 40 static const std::string KEYWORD_TYPE_INTEGER; 41 static const std::string KEYWORD_TYPE_LONG; 42 static const std::string KEYWORD_TYPE_DOUBLE; 43 static const std::string KEYWORD_TYPE_STRING; 44 static const std::string KEYWORD_TYPE_BOOLEAN; 45 46 static const std::string KEYWORD_ATTR_NOT_NULL; 47 static const std::string KEYWORD_ATTR_DEFAULT; 48 static const std::string KEYWORD_ATTR_VALUE_NULL; 49 static const std::string KEYWORD_ATTR_VALUE_TRUE; 50 static const std::string KEYWORD_ATTR_VALUE_FALSE; 51 52 static const std::string KEYWORD_TABLE_SPLIT_DEVICE; 53 static const std::string KEYWORD_TABLE_COLLABORATION; 54 55 static const std::string KEYWORD_TYPE_RELATIVE; 56 static const std::string SCHEMA_SUPPORT_VERSION; 57 static const std::string SCHEMA_SUPPORT_VERSION_V2; 58 static const std::string SCHEMA_SUPPORT_VERSION_V2_1; 59 static const std::string SCHEMA_CURRENT_VERSION; 60 61 static constexpr const char *REFERENCE_PROPERTY = "REFERENCE_PROPERTY"; 62 static constexpr const char *SOURCE_TABLE_NAME = "SOURCE_TABLE_NAME"; 63 static constexpr const char *TARGET_TABLE_NAME = "TARGET_TABLE_NAME"; 64 static constexpr const char *COLUMNS = "COLUMNS"; 65 static constexpr const char *SOURCE_COL = "SOURCE_COL"; 66 static constexpr const char *TARGET_COL = "TARGET_COL"; 67 68 static const uint32_t SCHEMA_META_FEILD_COUNT_MAX; 69 static const uint32_t SCHEMA_META_FEILD_COUNT_MIN; 70 static const uint32_t SCHEMA_FEILD_NAME_LENGTH_MAX; 71 static const uint32_t SCHEMA_FEILD_NAME_LENGTH_MIN; 72 static const uint32_t SCHEMA_FEILD_NAME_COUNT_MAX; 73 static const uint32_t SCHEMA_FEILD_NAME_COUNT_MIN; 74 static const uint32_t SCHEMA_FEILD_PATH_DEPTH_MAX; 75 static const uint32_t SCHEMA_INDEX_COUNT_MAX; 76 static const uint32_t SCHEMA_STRING_SIZE_LIMIT; 77 static const uint32_t SCHEMA_DEFAULT_STRING_SIZE_LIMIT; 78 static const uint32_t SCHEMA_SKIPSIZE_MAX; 79 80 static const uint32_t SECURE_BYTE_ALIGN; 81 }; 82 } // namespace DistributedDB 83 #endif // SCHEMA_CONSTANT_H