Skip to content

Commit

Permalink
Merge pull request #171 from mjpieters/exclude_autoindexes
Browse files Browse the repository at this point in the history
Skip internal indexes in .schema output
  • Loading branch information
amjith authored Nov 19, 2023
2 parents f424629 + 76a6017 commit b8f712c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
of for every line of output ([#148](https://github.com/dbcli/litecli/issues/148)).
* Use the sqlite3 API to cancel a running query on interrupt
([#164](https://github.com/dbcli/litecli/issues/164)).
* Skip internal indexes in the .schema output
([#170](https://github.com/dbcli/litecli/issues/170)).


## 1.9.0 - 2022-06-06
Expand Down
3 changes: 2 additions & 1 deletion litecli/packages/special/dbcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ def show_schema(cur, arg=None, **_):
args = (arg,)
query = """
SELECT sql FROM sqlite_master
WHERE name==?
WHERE name==? AND sql IS NOT NULL
ORDER BY tbl_name, type DESC, name
"""
else:
args = tuple()
query = """
SELECT sql FROM sqlite_master
WHERE sql IS NOT NULL
ORDER BY tbl_name, type DESC, name
"""

Expand Down

0 comments on commit b8f712c

Please sign in to comment.