systable.h 2.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifdef __cplusplus
extern "C" {
#endif

#include "os.h"

#ifndef TDENGINE_SYSTABLE_H
#define TDENGINE_SYSTABLE_H

#define TSDB_INFORMATION_SCHEMA_DB            "information_schema"
#define TSDB_INS_TABLE_DNODES                 "dnodes"
#define TSDB_INS_TABLE_MNODES                 "mnodes"
#define TSDB_INS_TABLE_MODULES                "modules"
#define TSDB_INS_TABLE_QNODES                 "qnodes"
#define TSDB_INS_TABLE_BNODES                 "bnodes"
#define TSDB_INS_TABLE_SNODES                 "snodes"
#define TSDB_INS_TABLE_CLUSTER                "cluster"
#define TSDB_INS_TABLE_USER_DATABASES         "user_databases"
#define TSDB_INS_TABLE_USER_FUNCTIONS         "user_functions"
#define TSDB_INS_TABLE_USER_INDEXES           "user_indexes"
#define TSDB_INS_TABLE_USER_STABLES           "user_stables"
#define TSDB_INS_TABLE_USER_STREAMS           "user_streams"
#define TSDB_INS_TABLE_USER_TABLES            "user_tables"
#define TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED "user_table_distributed"
#define TSDB_INS_TABLE_USER_USERS             "user_users"
#define TSDB_INS_TABLE_LICENCES               "grants"
#define TSDB_INS_TABLE_VGROUPS                "vgroups"
#define TSDB_INS_TABLE_VNODES                 "vnodes"
#define TSDB_INS_TABLE_CONFIGS                "configs"

46 47 48 49 50 51 52 53 54 55 56
#define TSDB_PERFORMANCE_SCHEMA_DB     "performance_schema"
#define TSDB_PERFS_TABLE_SMAS          "smas"
#define TSDB_PERFS_TABLE_SUBSCRIBES    "subscribes"
#define TSDB_PERFS_TABLE_CONNECTIONS   "connections"
#define TSDB_PERFS_TABLE_QUERIES       "queries"
#define TSDB_PERFS_TABLE_TOPICS        "topics"
#define TSDB_PERFS_TABLE_CONSUMERS     "consumers"
#define TSDB_PERFS_TABLE_SUBSCRIPTIONS "subscriptions"
#define TSDB_PERFS_TABLE_OFFSETS       "offsets"
#define TSDB_PERFS_TABLE_TRANS         "trans"
#define TSDB_PERFS_TABLE_STREAMS       "streams"
57 58

typedef struct SSysDbTableSchema {
59
  const char*   name;
60 61 62 63 64
  const int32_t type;
  const int32_t bytes;
} SSysDbTableSchema;

typedef struct SSysTableMeta {
65 66
  const char*              name;
  const SSysDbTableSchema* schema;
67 68 69 70 71 72 73 74 75 76 77
  const int32_t            colNum;
} SSysTableMeta;

void getInfosDbMeta(const SSysTableMeta** pInfosTableMeta, size_t* size);
void getPerfDbMeta(const SSysTableMeta** pPerfsTableMeta, size_t* size);

#ifdef __cplusplus
}
#endif

#endif  // TDENGINE_SYSTABLE_H