home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 968384005

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/331#issuecomment-968384005 https://api.github.com/repos/simonw/sqlite-utils/issues/331 968384005 IC_kwDOCGYnMM45uF4F 9599 2021-11-14T23:19:29Z 2021-11-14T23:20:32Z OWNER

Tested it like this, against a freshly built .tar.gz package from my development environment: (w) w % mypy . hello.py:1: error: Skipping analyzing "sqlite_utils": found module but no type hints or library stubs hello.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports Found 1 error in 1 file (checked 1 source file) (w) w % pip install ~/Dropbox/Development/sqlite-utils/dist/sqlite-utils-3.17.1.tar.gz Processing /Users/simon/Dropbox/Development/sqlite-utils/dist/sqlite-utils-3.17.1.tar.gz ... Successfully installed sqlite-utils-3.17.1 (w) w % mypy . Success: no issues found in 1 source file I tested against the .whl too.

My hello.py script contained this: ```python import sqlite_utils from typing import cast

if name == "main": db = sqlite_utils.Database(memory=True) table = cast(sqlite_utils.db.Table, db["foo"]) table.insert({"id": 5}) print(list(db.query("select * from foo"))) That `cast()` is necessary because without it you get this error: (w) w % mypy . hello.py:7: error: Item "View" of "Union[Table, View]" has no attribute "insert" ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
1026794056  
Powered by Datasette · Queries took 0.742ms · About: github-to-sqlite