simonw / sqlite-utils
Showing 1 of 1 files from the diff.

@@ -14,6 +14,7 @@
Loading
14 14
from sqlite_fts4 import rank_bm25  # type: ignore
15 15
import sys
16 16
import textwrap
17 +
from typing import Generator, Iterable, Union, Optional, List
17 18
import uuid
18 19
19 20
SQLITE_MAX_VARS = 999
@@ -359,13 +360,17 @@
Loading
359 360
                for table in tables
360 361
            )
361 362
362 -
    def query(self, sql, params=None):
363 +
    def query(
364 +
        self, sql: str, params: Optional[Union[Iterable, dict]] = None
365 +
    ) -> Generator[dict, None, None]:
363 366
        cursor = self.execute(sql, params or tuple())
364 367
        keys = [d[0] for d in cursor.description]
365 368
        for row in cursor:
366 369
            yield dict(zip(keys, row))
367 370
368 -
    def execute_returning_dicts(self, sql, params=None):
371 +
    def execute_returning_dicts(
372 +
        self, sql: str, params: Optional[Union[Iterable, dict]] = None
373 +
    ) -> List[dict]:
369 374
        return list(self.query(sql, params))
370 375
371 376
    def resolve_foreign_keys(self, name, foreign_keys):
Files Coverage
sqlite_utils 96.04%
Project Totals (4 files) 96.04%
1
coverage:
2
  status:
3
    project:
4
      default:
5
        informational: true
6
    patch:
7
      default:
8
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading