taosdata / taosdata/TDengine

support for running multi-line sql files in tdengine cli

Open
#28,735 2 comments 0 reactions 1 assignee View on GitHub

@yu285 is already working on this.

Since Feb 11, 2025.

enhancement
Dominant language
C
Stars
25.1k
Forks
5k
Avg merge
4d 59m
Merged PRs (30d)
7

Description

taos命令不支持多行形式的单个SQL语句
taos文档描述“-f FILE: 以非交互模式执行 SQL 脚本文件。文件中一个 SQL 语句只能占一行”
但是表和表字段比较多少时,不能每个字段一行,维护的SQL文件很不方便阅读
如下面的语句的SQL文件,taos命令无法用-f参数执行
CREATE STABLE IF NOT EXISTS ue_ping.s_dt_measdata (
col_ts TIMESTAMP,
rep_ts TIMESTAMP,
task_id INT,
sn INT,
rsrp INT,
rsrq INT,
sinr INT,
rssi INT,
tx_power INT,
nr_dl_band_width INT,
ul_speed INT,
dl_speed INT,
delay BIGINT UNSIGNED,
pa5g_thermal INT,
uptime INT,
cpu_usage INT,
mem_usage INT,
active TINYINT,
cell_id INT,
pcid INT,
arfcn INT,
band INT,
card_slot BINARY(16),
mac BINARY(18),
wan_ip BINARY(50),
rat BINARY(16),
mcc BINARY(3),
mnc BINARY(3),
) TAGS (imsi BINARY(36)) COMMENT '路测线路标记点表';

期望taos命令能支持多行SQL语句
期望taos命令能支持多行SQL语句
如果可以,期望TDEngine数据库表结构定义时只对列添加列注释

Describe your solutions/suggestions if you've any

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.