dbcli / dbcli/litecli

`--indent` with `.schema` doesnt work

未关闭
#179 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
3.3k
派生
95
PR 合并指标
30 天内没有已合并 PR

描述

Is there a way to get `--indent` option to work when printing the schema for a table?

In sqlite3 prompt:

```
sqlite> .schema runstats --indent
CREATE TABLE IF NOT EXISTS "runstats"(
"id" INTEGER NOT NULL PRIMARY KEY,
"run_id" INTEGER NOT NULL,
"crate_id" INTEGER NOT NULL,
"functions" INTEGER,
"functions_converted" INTEGER CHECK(functions >= functions_converted),
"instances" INTEGER,
"instances_converted" INTEGER CHECK(instances >= instances_converted),
"instance_types" INTEGER,
"instance_types_converted" INTEGER CHECK(instance_types >= instance_types_converted),
FOREIGN KEY("run_id") REFERENCES "run"("id"),
FOREIGN KEY("crate_id") REFERENCES "crate"("id")
);
CREATE INDEX "runstats_run_id" ON "runstats"("run_id");
CREATE INDEX "runstats_crate_id" ON "runstats"("crate_id");
```

In litecli:

```
❯ litecli aunor.db
LiteCli: 1.11.0 (SQLite: 3.45.3)
GitHub: https://github.com/dbcli/litecli
aunor.db> .schema runstats --indent
Time: 0.000s
```

贡献指南

打开贡献指南

调研方向

在 litecli 中针对 SQLite 重现 `.schema runstats --indent`,并将其与 issue 中显示的 sqlite3 提示符输出进行比较。首先跟踪 `.schema` 命令及其对 `--indent` 的处理;完成的标准是该命令输出带缩进的 schema,而不是不产生任何输出。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, sqlite
领域
cli, databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。