Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Internal

- Switch mypy to ty for type checking. [(#242)](https://github.com/dbcli/litecli/pull/242/files)
- Add sqlean-stubs for type checking. [(#243)(https://github.com/dbcli/litecli/pull/243/files)]

## 1.17.0 - 2025-09-28

Expand Down
2 changes: 1 addition & 1 deletion litecli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from io import open

try:
from sqlean import OperationalError, sqlite_version # type: ignore[import-untyped]
from sqlean import OperationalError, sqlite_version
except ImportError:
from sqlite3 import OperationalError, sqlite_version
from time import time
Expand Down
7 changes: 3 additions & 4 deletions litecli/sqlexecute.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from typing import Any, Generator, Iterable

try:
import sqlean as sqlite3 # type: ignore[import-untyped]
from sqlean import OperationalError # type: ignore[import-untyped]
import sqlean as sqlite3
from sqlean import OperationalError

sqlite3.extensions.enable_all()
except ImportError:
Expand Down Expand Up @@ -87,8 +87,7 @@ def connect(self, database: str | None = None) -> None:
if not os.path.exists(db_dir_name):
raise Exception("Path does not exist: {}".format(db_dir_name))

# sqlean exposes the connect method during run-time
conn = sqlite3.connect(database=db_name, isolation_level=None, uri=uri) # type: ignore[attr-defined]
conn = sqlite3.connect(database=db_name, isolation_level=None, uri=uri)
conn.text_factory = lambda x: x.decode("utf-8", "backslashreplace")
if self.conn:
self.conn.close()
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dev = [
"pdbpp>=0.10.3",
"llm>=0.19.0",
"ty>=0.0.4",
"sqlean-stubs>=0.0.3",
]

[tool.setuptools.packages.find]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sqlexecute.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .utils import assert_result_equal, dbtest, is_expanded_output, run, set_expanded_output

try:
from sqlean import OperationalError, ProgrammingError # type: ignore[import-untyped]
from sqlean import OperationalError, ProgrammingError
except ImportError:
from sqlite3 import OperationalError, ProgrammingError

Expand Down
Loading