tencent cloud

游戏数据库 TcaplusDB

产品动态
产品简介
产品概述
产品优势
应用场景
产品架构
地域介绍
购买指南
产品定价
欠费说明
快速入门
了解基本概念
创建集群
创建表格组
创建表格
获取连接信息
访问 TcaplusDB
操作指南
管理集群与表格组
管理表格
监控与告警
访问管理
标签
任务列表
使用 TcaplusDB client
使用 client 工具访问数据
client 工具命令参考
使用 TcaplusDB SDK
变更历史
SDK 下载
SDK for C++ 接口说明
TcaplusDB 错误码
SDK 安装
PB 表 C++SDK 操作方法
TDR 表 C++SDK 操作方法
使用 TcaplusDB RESTful API
RESTful API 接口说明
Go RESTful API 接口说明
Java RESTful API 接口说明
PHP RESTful API 接口说明
Python RESTful API 接口说明
RESTful API 各语言示例下载
实践教程
表结构设计
数据库交互
常见问题
信息咨询类
数据库使用类
数据库原理类
API 文档
History
Introduction
API Category
Making API Requests
Table Group APIs
Other APIs
Table APIs
Cluster APIs
Data Types
Error Codes
相关协议
服务等级协议
服务条款
词汇表
联系我们

help

PDF
聚焦模式
字号
最后更新时间: 2024-12-04 09:56:31

简介

获取指令使用方法。

语法

## 获取所有指令及其说明
help;

## 获取指定指令名的详细说明
help [指令名];

示例

tcaplus> help;
--------------------------------------------------------------------------------
help: show usage of commands, example: "help select;".
show: get server status related information. executing "help show;" for details.
exit/quit: exit the client.
count: print record number in the database.

desc: print table field name and type.
select: query records from database.
insert: insert a new record into database.
replace: replace a record into the database.
update: update a record in the database.
delete: delete record(s) from database.

dump: dump records from database.
load: load records into the database.

setttl: set ttl for a record
getttl: get ttl for a record

--------------------------------------------------------------------------------

tcaplus> help select;
--------------------------------------------------------------------------------
example: select key1, key2, key3, value1, value2 [into result.csv] from table where key1 = 1 and key2 = "abc" [and -index = 1] [\\P] [\\G];
query records from database, you can specify part of the fields or whole fields (select *), and you can write the result to a file, which can be used by "insert" and "load"
for generic table, if the key in where clause is not complete, then it will send "GetByPartkey"
for list table, if "-index" is not specified in where clause, then it will send "ListGetAll", otherwise it will send "ListGet"
\\P: print time usage in detail
\\G: print fields in column
Note: "-index" only used for list table

example: select * [into result.xml] from table where key1 = 1 and key2 = "abc" [and -index = 1] using tdr [\\P];
if you specify "using tdr", then the records will be parsed by tdr file and print in xml format. you can write the result into a file, which can be used by "load"
it only support "select *" instead of select part of the fields when specify "using tdr"
Note: "-index" only used for list table

globle index query:
example: select * from table where key1 > 1 and value1 > 100;
example: select * from table where value1 like "test";
example: select field1, field2 from table where key1 > 1 or value1 > 100;
example: select * from table where value1 between 100 and 200;
example: select * from table where value1 > 100 limit 100 offset 0;
example: select sum(value2), max(value2), min(value2), avg(value2), count(*) from table where value1 > 100;
Note: globle index query is only support generic table;
Note: current support: =,!=,>,>=,<,<=, like, not like, betwwen, in, not in, and, or, limit offset;
Note: current support aggregation: count, sum, max, min, avg;
Note: for protobuf table, it support: "select field1.field2 from test where value1 > 100";
Note: limit must be used with offset, lack offset will query failed;
Note: the fields in where condition and in aggregation must had already created index;
Note: it not support: store the result to a file, such as "select * into file XXX" is not support;
Note: it not support: "select * from table"; which means to traverse table, you can used api traverse method to traverse table;
Note: it not support: order by, group by, having, join, union and so on;
Note: it not support: select a+b XXX; select * from table where a+b>0; select sum(XX),field1 from XXX; select *,field1 from XXX; ......;
--------------------------------------------------------------------------------

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈