dbcli / dbcli/litecli

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

Open
#179 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
3.3k
Forks
95
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

Open the contributing guide

Research direction

Reproduce `.schema runstats --indent` in litecli against SQLite and compare it with the sqlite3 prompt output shown in the issue. Start by tracing the `.schema` command and its `--indent` handling; done means the command prints the schema with indentation instead of producing no output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
cli, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.