Skip to content

Commit 8fc0a28

Browse files
committed
Add sqlean stubs
1 parent eea974f commit 8fc0a28

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

litecli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from io import open
1414

1515
try:
16-
from sqlean import OperationalError, sqlite_version # type: ignore[import-untyped]
16+
from sqlean import OperationalError, sqlite_version
1717
except ImportError:
1818
from sqlite3 import OperationalError, sqlite_version
1919
from time import time

litecli/sqlexecute.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from typing import Any, Generator, Iterable
66

77
try:
8-
import sqlean as sqlite3 # type: ignore[import-untyped]
9-
from sqlean import OperationalError # type: ignore[import-untyped]
8+
import sqlean as sqlite3
9+
from sqlean import OperationalError
1010

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

90-
# sqlean exposes the connect method during run-time
91-
conn = sqlite3.connect(database=db_name, isolation_level=None, uri=uri) # type: ignore[attr-defined]
90+
conn = sqlite3.connect(database=db_name, isolation_level=None, uri=uri)
9291
conn.text_factory = lambda x: x.decode("utf-8", "backslashreplace")
9392
if self.conn:
9493
self.conn.close()

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dev = [
4646
"pdbpp>=0.10.3",
4747
"llm>=0.19.0",
4848
"ty>=0.0.4",
49+
"sqlean-stubs>=0.0.3",
4950
]
5051

5152
[tool.setuptools.packages.find]

tests/test_sqlexecute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .utils import assert_result_equal, dbtest, is_expanded_output, run, set_expanded_output
88

99
try:
10-
from sqlean import OperationalError, ProgrammingError # type: ignore[import-untyped]
10+
from sqlean import OperationalError, ProgrammingError
1111
except ImportError:
1212
from sqlite3 import OperationalError, ProgrammingError
1313

0 commit comments

Comments
 (0)