home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

10 rows where comments = 16 and user = 9599 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: state_reason, created_at (date), updated_at (date), closed_at (date)

state 2

  • closed 8
  • open 2

repo 2

  • datasette 8
  • sqlite-utils 2

type 1

  • issue 10
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
1726236847 I_kwDOBm6k_c5m5Eiv 2078 Resolve the difference between `wrap_view()` and `BaseView` simonw 9599 closed 0     16 2023-05-25T17:44:32Z 2023-05-26T00:18:46Z 2023-05-26T00:18:46Z OWNER  

There are two patterns for implementing views in Datasette at the moment. I want to combine those.

Part of: - #2053

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2078/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed
1408757705 I_kwDOBm6k_c5T9-_J 1843 Intermittent "Too many open files" error running tests simonw 9599 open 0     16 2022-10-14T04:45:01Z 2022-12-17T22:02:41Z   OWNER  

Partial stack trace from one of them: ``` /Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.10/site-packages/jinja2/loaders.py:200: in get_source f = open_if_exists(filename)


filename = '/Users/simon/Dropbox/Development/datasette/datasette/templates/error.html', mode = 'rb'

def open_if_exists(filename: str, mode: str = "rb") -> t.Optional[t.IO]:
    """Returns a file descriptor for the filename if that file exists,
    otherwise ``None``.
    """
    if not os.path.isfile(filename):
        return None
  return open(filename, mode)

E OSError: [Errno 24] Too many open files: '/Users/simon/Dropbox/Development/datasette/datasette/templates/error.html' ```

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1843/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  reopened
1425029242 I_kwDOBm6k_c5U8Dh6 1863 Update a single record in an existing table simonw 9599 closed 0   Datasette 1.0a0 8658075 16 2022-10-27T04:53:17Z 2022-11-29T18:08:53Z 2022-11-29T18:06:37Z OWNER  

API design:

POST /db/table/row-pks/-/update { "field": "updated_value" } Only the fields that you pass will be updated.

Maybe this is the wrong design though? The design for insert currently looks like this:

  • https://github.com/simonw/datasette/issues/1851#issuecomment-1294224185

POST /db/table/-/insert Authorization: Bearer xxx Content-Type: application/json { "row": { "id": 1, "name": "New name" } } I could use the same format for /-/update, but in this case the API doesn't require you to pass every field so "row" doesn't seem like the right key.

I think I'll go with this:

POST /db/table/1/-/update Authorization: Bearer xxx Content-Type: application/json { "update": { "name": "New name" } } The benefit of having an "update" key is that it allows me to use other keys in the future. Maybe a "alter": true key to indicate that new columns should be added if they are missing.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1863/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed
816526538 MDU6SXNzdWU4MTY1MjY1Mzg= 239 sqlite-utils extract could handle nested objects simonw 9599 open 0     16 2021-02-25T15:10:28Z 2022-09-03T23:46:02Z   OWNER  

Imagine a table (imported from a nested JSON file) where one of the columns contains values that look like this:

{"email": "anonymous@noreply.airtable.com", "id": "usrROSHARE0000000", "name": "Anonymous"}

The sqlite-utils extract command already uses single text values in a column to populate a new table. It would not be much of a stretch for it to be able to use JSON instead, including specifying which of those values should be used as the primary key in the new table.

sqlite-utils 140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/239/reactions",
    "total_count": 6,
    "+1": 5,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1095570074 I_kwDOCGYnMM5BTRKa 364 `--batch-size 1` doesn't seem to commit for every item simonw 9599 closed 0   3.21 7558727 16 2022-01-06T18:18:50Z 2022-01-10T19:27:17Z 2022-01-10T05:36:19Z OWNER  

I'm trying this, but it doesn't seem to write anything to the database file until I hit CTRL+C:

heroku logs --app=simonwillisonblog --tail | grep 'measure#nginx.service' | \ sqlite-utils insert /tmp/herokutail.db log - --import re --convert "$(cat <<EOD r = re.compile(r'([^\s=]+)=(?:"(.*?)"|(\S+))') pairs = {} for key, value1, value2 in r.findall(line): pairs[key] = value1 or value2 return pairs EOD )" --lines --batch-size 1

sqlite-utils 140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/364/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed
517451234 MDU6SXNzdWU1MTc0NTEyMzQ= 615 ?_col= and ?_nocol= support for toggling columns on table view simonw 9599 closed 0     16 2019-11-04T22:55:41Z 2021-05-27T04:26:10Z 2021-05-27T04:17:44Z OWNER  

Split off from #292 (I guess this is a re-opening of #312).

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/615/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed
725996507 MDU6SXNzdWU3MjU5OTY1MDc= 1036 Make it possible to download BLOB data from the Datasette UI simonw 9599 closed 0   0.51 6026070 16 2020-10-20T22:47:56Z 2021-01-18T17:45:00Z 2020-10-25T00:14:52Z OWNER  

Currently you can only extract binary BLOB data as base64-encoded JSON, which is not user friendly at all. It should always be possible for end-users to get the binary data out.

I'm worried about XSS vulnerabilities here, but hopefully sending Content-Type: application/octet-stream helps there? Need to research that.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1036/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed
711627628 MDU6SXNzdWU3MTE2Mjc2Mjg= 981 Action menu for table columns simonw 9599 closed 0   Datasette 0.50 5971510 16 2020-09-30T04:45:38Z 2020-10-08T23:55:00Z 2020-09-30T23:58:17Z OWNER  

At the very least I'd like a menu on each table column that lets me select sort-asc v.s. sort-desc without having to click twice.

I'd also like to be able to indicate that a column should be used for faceting (possibly only for columns that are not floating point and do not have a unique index on them).

This needs to be built with accessibility in mind - I don't want screenreaders to read out the contents of a menu as the "th" label for any given cell.

Related: #690

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/981/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed
633578769 MDU6SXNzdWU2MzM1Nzg3Njk= 811 Support "allow" block on root, databases and tables, not just queries simonw 9599 closed 0   Datasette 0.44 5512395 16 2020-06-07T17:01:09Z 2020-06-08T19:34:00Z 2020-06-08T19:32:36Z OWNER  

No reason not to expand the "allow" mechanism described here to the root of metadata.json plus to databases and tables.

Refs #810 and #800.

json { "databases": { "mydatabase": { "allow": { "id": ["root"] } } } }

TODO:

  • [x] Instance level
  • [x] Database level
  • [x] Table level
  • [x] Query level
  • [x] Affects list of queries
  • [x] Affects list of tables on database page
  • [x] Affects truncated list of tables on index page
  • [x] Affects list of SQL views on database page
  • [x] Affects list of databases on index page
  • [x] Show 🔒 in header on index page for private instances
  • [x] Show 🔒 in header on private database page
  • [x] Show 🔒 in header on private table page
  • [x] Show 🔒 in header on private query page
  • [x] Move assert_permissions_checked() calls from test_html.py to test_permissions.py
  • [x] Update documentation
datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/811/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed
322477187 MDU6SXNzdWUzMjI0NzcxODc= 255 Facets simonw 9599 closed 0     16 2018-05-12T03:00:07Z 2019-05-29T21:39:12Z 2018-05-16T15:32:12Z OWNER  

Ability to display facets and facet counts on the table view.

Facets can be specified in the URL with ?_facet=column&_facet=othercolumn or the default facets for a table can be set using a new "facets": [...] property in metadata.json

  • [x] Implement ?_facet=
  • [x] Implement metadata.json facets key
  • [x] Design for how facets should be presented
  • [x] Facets should be able to toggle off as well as on
  • [x] Expand labels for facets that are foreign keys
  • [x] Suggest potential facets (if we can do so within a tight time limit)
  • [x] Documentation
datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/255/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [pull_request] TEXT,
   [body] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
, [active_lock_reason] TEXT, [performed_via_github_app] TEXT, [reactions] TEXT, [draft] INTEGER, [state_reason] TEXT);
CREATE INDEX [idx_issues_repo]
                ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
                ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
                ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
                ON [issues] ([user]);
Powered by Datasette · Queries took 308.28ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows