From 0725b88358cee9ac6ab219bab498edb6bcf70bd3 Mon Sep 17 00:00:00 2001 From: Amjith Ramanujam Date: Sat, 23 Mar 2024 19:22:06 -0700 Subject: [PATCH 1/4] Improve \d to show list of tables. --- CHANGELOG.md | 8 ++++++++ TODO | 3 --- TODO.md | 6 ++++++ litecli/packages/special/dbcommands.py | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) delete mode 100644 TODO create mode 100644 TODO.md diff --git a/CHANGELOG.md b/CHANGELOG.md index edee1e9..00f3b65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.11.0 - TBD + +### Improvements + +* When an empty `\d` is invoked the list of tables are returned instead of an error. + + + ## 1.10.1 - 2024-3-23 ### Bug Fixes diff --git a/TODO b/TODO deleted file mode 100644 index 7c854dc..0000000 --- a/TODO +++ /dev/null @@ -1,3 +0,0 @@ -* [] Sort by frecency. -* [] Add completions when an attach database command is run. -* [] Add behave tests. diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..58e2ebc --- /dev/null +++ b/TODO.md @@ -0,0 +1,6 @@ +* [ ] Change to use ruff +* [ ] Automate the release process via GH actions. [Article](https://simonwillison.net/2024/Jan/16/python-lib-pypi/) + +* [] Sort by frecency. +* [] Add completions when an attach database command is run. +* [] Add behave tests. diff --git a/litecli/packages/special/dbcommands.py b/litecli/packages/special/dbcommands.py index dec3507..687c9a4 100644 --- a/litecli/packages/special/dbcommands.py +++ b/litecli/packages/special/dbcommands.py @@ -224,7 +224,7 @@ def describe(cur, arg, **_): arg ) else: - raise ArgumentMissing("Table name required.") + return list_tables(cur) log.debug(query) cur.execute(query) From 11a68b4e72f73cd498b2dafe05932a6be0868985 Mon Sep 17 00:00:00 2001 From: Amjith Ramanujam Date: Sat, 23 Mar 2024 19:25:17 -0700 Subject: [PATCH 2/4] Drop Python 3.7 and add 3.11 and 3.12 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ee36cf..d4de9d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 From 6c26b4243496eefa869d46b96ac480a4da857c8a Mon Sep 17 00:00:00 2001 From: Amjith Ramanujam Date: Sat, 23 Mar 2024 21:09:14 -0700 Subject: [PATCH 3/4] Print the sqlite version at startup. --- litecli/main.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/litecli/main.py b/litecli/main.py index 268ede2..d82f7cd 100644 --- a/litecli/main.py +++ b/litecli/main.py @@ -10,7 +10,7 @@ from datetime import datetime from io import open from collections import namedtuple -from sqlite3 import OperationalError +from sqlite3 import OperationalError, sqlite_version import shutil from cli_helpers.tabular_output import TabularOutputFormatter @@ -380,10 +380,8 @@ def run_cli(self): key_bindings = cli_bindings(self) if not self.less_chatty: - print("Version:", __version__) - print("Mail: https://groups.google.com/forum/#!forum/litecli-users") + print(f"LiteCli: {__version__} (SQLite: {sqlite_version})") print("GitHub: https://github.com/dbcli/litecli") - # print("Home: https://litecli.com") def get_message(): prompt = self.get_prompt(self.prompt_format) @@ -819,7 +817,7 @@ def get_col_type(col): headers, format_name="vertical" if expanded else None, column_types=column_types, - **output_kwargs + **output_kwargs, ) if isinstance(formatted, (text_type)): @@ -841,7 +839,7 @@ def get_col_type(col): headers, format_name="vertical", column_types=column_types, - **output_kwargs + **output_kwargs, ) if isinstance(formatted, (text_type)): formatted = iter(formatted.splitlines()) From 4c545ae54fe813bd69727d88c1c48dd452ca8301 Mon Sep 17 00:00:00 2001 From: Amjith Ramanujam Date: Sat, 23 Mar 2024 21:28:14 -0700 Subject: [PATCH 4/4] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00f3b65..14222a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Improvements * When an empty `\d` is invoked the list of tables are returned instead of an error. +* Show SQLite version at startup.