home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1294408928

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/496#issuecomment-1294408928 https://api.github.com/repos/simonw/sqlite-utils/issues/496 1294408928 IC_kwDOCGYnMM5NJxzg 39538958 2022-10-28T03:36:56Z 2022-10-28T03:37:50Z NONE

With respect to the typing of Table class itself, my interim solution:

python from sqlite_utils.db import Table def tbl(self, table_name: str) -> Table: tbl = self.db[table_name] if isinstance(tbl, Table): return tbl raise Exception(f"Missing {table_name=}")

With respect to @chapmanjacobd concern on the DEFAULT being an empty class, have also been using # type: ignore, e.g.

python @classmethod def insert_list(cls, areas: list[str]): return meta.tbl(meta.Areas).insert_all( ({"area": a} for a in areas), ignore=True # type: ignore )

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