home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 500783373

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association pull_request body repo type active_lock_reason performed_via_github_app reactions draft state_reason
500783373 MDU6SXNzdWU1MDA3ODMzNzM= 62 [enhancement] Method to delete a row in python 4454869 closed 0     5 2019-10-01T09:45:47Z 2019-11-04T16:30:34Z 2019-11-04T16:18:18Z NONE  

Hi ! Thanks for the lib !

Obviously, every possible sql queries won't have a dedicated method.

But I was thinking : a method to delete a row (I'm terrible with names, maybe delete_where() or something, would be useful.

I have a Database, with primary key.

For the moment, I use :

Python3 db.conn.execute(f"DELETE FROM table WHERE key = {key_id}") db.conn.commit() to delete a row I don't need anymore, giving his primary key.

Works like a charm.

Just an idea :

Python3 table.delete_where_pkey({'key': key_id}) or something (I know, I'm terrible at naming methods...).

Pros : well, no need to write SQL query.

Cons : WHERE normally allows to do many more things (operators =, <>, >, <, BETWEEN), not to mention AND, OR, etc... Method is maybe to specific, and/or a pain to render more flexible.

Again, just a thought. Writing his own sql works too, so...

Thanks again. See yah.

140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/62/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 2.528ms · About: github-to-sqlite