home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

111 rows where comments = 0, state = "open" and user = 9599 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: milestone, author_association, created_at (date), updated_at (date)

repo 9

  • datasette 90
  • sqlite-utils 6
  • dogsheep-beta 5
  • github-to-sqlite 3
  • twitter-to-sqlite 2
  • apple-notes-to-sqlite 2
  • swarm-to-sqlite 1
  • pocket-to-sqlite 1
  • dogsheep-photos 1

type 2

  • issue 110
  • pull 1

state 1

  • open · 111 ✖
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
1978022687 I_kwDOBm6k_c515jsf 2204 request.post_body() can only be called once simonw 9599 open 0     0 2023-11-05T23:22:03Z 2023-11-05T23:23:23Z   OWNER  

This code here:

https://github.com/simonw/datasette/blob/452a587e236ef642cbc6ae345b58767ea8420cb5/datasette/utils/asgi.py#L127-L135

It consumes the messages, which means if you try to call it a second time you won't be able to get at the body.

This is efficient - we don't end up with a request object property with potentially megabytes of content that we never look at again - but it's inconvenient for cases like middleware or functions where we don't know if the body has been consumed yet or not.

Potential solution: set request._body the first time it is called, and return that on subsequent calls.

Potential optimization: only do this for bodies that are shorter than a certain threshold - maybe 1MB - and raise an exception if you attempt to call post_body() multiple times against one of those larger bodies.

I'm a bit nervous about that option though, since it could result in errors that don't show up in testing but do show up in production.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2204/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1977155641 I_kwDOCGYnMM512QA5 601 Move plugin directory into documentation simonw 9599 open 0     0 2023-11-04T04:07:52Z 2023-11-04T04:07:52Z   OWNER  

https://github.com/simonw/sqlite-utils-plugins should be in the official documentation.

I can use the same pattern as https://llm.datasette.io/en/stable/plugins/directory.html

https://til.simonwillison.net/readthedocs/stable-docs

sqlite-utils 140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/601/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1895266807 I_kwDOBm6k_c5w93n3 2184 Design decision - should configuration be exposed at /-/config ? simonw 9599 open 0     0 2023-09-13T21:07:08Z 2023-09-13T21:07:38Z   OWNER  

This made me think. That {"$env": "ENV_VAR"} hack was introduced back here:

  • https://github.com/simonw/datasette/issues/538

The problem it was solving was that metadata was visible to everyone with access to the instance at /-/metadata but plugins clearly needed a way to set secret settings.

Now that this stuff is moving to config, we have some decisions to make:

  1. Add /-/config to let people see the configuration of their instance, and keep the $env trick for secret settings.
  2. Say all configuration aside from metadata is secret and make $env optional or ditch it entirely.
  3. Allow plugins to announce which of their configuration options are secret so we can automatically redact them from /-/config

I've found /-/metadata extraordinarily useful as a user of Datasette - it really helps me understand exactly what's going on if I run into any problems with a plugin, if I can quickly check what the settings look like.

So I'm leaning towards option 1 or 3.

Originally posted by @simonw in https://github.com/simonw/datasette/pull/2183#discussion_r1325076924

Also refs: - #2093

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2184/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1888477283 I_kwDOC8SPRc5wj-Bj 38 Run `rebuild_fts` after building the index simonw 9599 open 0     0 2023-09-08T23:17:45Z 2023-09-08T23:17:45Z   MEMBER  

In: - https://github.com/simonw/datasette.io/issues/152#issuecomment-1712323347

This turned out to be the fix:

bash dogsheep-beta index dogsheep-index.db templates/dogsheep-beta.yml sqlite-utils rebuild-fts dogsheep-index.db

dogsheep-beta 197431109 issue    
{
    "url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/38/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1875739055 I_kwDOBm6k_c5vzYGv 2167 Document return type of await ds.permission_allowed() simonw 9599 open 0     0 2023-08-31T15:14:23Z 2023-08-31T15:14:23Z   OWNER  

The return type isn't documented here: https://github.com/simonw/datasette/blob/4c3ef033110407f3b3dbce501659d523724985e0/docs/internals.rst#L327-L350

On inspecting the code I'm not 100% sure if it's possible for this. method to return None, or if it can only return True or False. Need to confirm that.

https://github.com/simonw/datasette/blob/4c3ef033110407f3b3dbce501659d523724985e0/datasette/app.py#L822C15-L853

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2167/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
594237015 MDU6SXNzdWU1OTQyMzcwMTU= 718 Plugin idea: datasette-redirects simonw 9599 open 0     0 2020-04-05T03:41:38Z 2023-08-30T22:17:31Z   OWNER  

I just had to write a one-off custom plugin to redirect niche-musems.com to www.niche-museums.com (https://github.com/simonw/museums/issues/21) - it would be great if this kind of thing could be handled by a configurable plugin.

https://github.com/simonw/museums/blob/6b1faf00c463b2228860d4d62d104b11935e01b1/plugins/redirect_www.py

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/718/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  reopened
1823428714 I_kwDOBm6k_c5sr1Bq 2120 Add __all__ to datasette/__init__.py simonw 9599 open 0     0 2023-07-27T01:07:10Z 2023-07-27T01:07:10Z   OWNER  

Currently looks like this: https://github.com/simonw/datasette/blob/08181823990a71ffa5a1b57b37259198eaa43e06/datasette/init.py#L1-L6

Adding __all__ = ["Permission", "Forbidden"...] would let me get rid of those # noqa comments.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2120/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1808116827 I_kwDOBm6k_c5rxaxb 2103 data attribute on Datasette tables exposing the primary key of the row simonw 9599 open 0     0 2023-07-17T16:18:25Z 2023-07-17T16:18:25Z   OWNER  

Maybe put it on the <tr> but probably better to go on the td.type-pk.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2103/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1764792125 I_kwDOBm6k_c5pMJc9 2086 Show information on startup in directory configuration mode simonw 9599 open 0     0 2023-06-20T07:13:33Z 2023-06-20T07:13:33Z   OWNER  

https://discord.com/channels/823971286308356157/823971286941302908/1120516587036889098

One thing that would be helpful would be message at launch indicating a metadata.json is getting picked up. I'm using directory mode and was editing the wrong file for awhile before I realize nothing I was doing was having any effect.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2086/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1665510265 I_kwDOBm6k_c5jRat5 2060 Clean up a bunch of warnings from ruff simonw 9599 open 0     0 2023-04-13T01:23:02Z 2023-04-13T01:23:02Z   OWNER  

See: - #2056

ruff spots a bunch of warnings about things like unused variables - would be good to clean up as many of these as possible.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2060/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1649793525 I_kwDOBm6k_c5iVdn1 2051 `?_extra=row_urls` for table pages simonw 9599 open 0     0 2023-03-31T17:58:36Z 2023-03-31T17:58:36Z   OWNER  

Provides URLs to the JSON version of those rows. Maybe it persists the ?_shape= option too? Not sure about that.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2051/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1641013220 I_kwDOBm6k_c5hz9_k 2045 First column on a view page has no facet option in cog menu simonw 9599 open 0   Datasette 1.0 3268330 0 2023-03-26T18:02:47Z 2023-03-26T18:02:48Z   OWNER  

e.g. first column on this page - cog menu has no option to facet.

https://datasette.io/content/tools

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2045/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1636616315 I_kwDOBm6k_c5hjMh7 2042 Gather feedback on new ?_extra= design simonw 9599 open 0     0 2023-03-22T23:07:43Z 2023-03-22T23:08:19Z   OWNER  

Now that I've landed: - #1999

See also: - #262

I want to get some feedback from people on the design of the new ?_extra= feature, before freezing it into Datasette 1.0.

The big change is that the default JSON representation is now MUCH slimmer - it only gives you keys for "next" and "rows", where rows is a list of JSON objects (not a list of arrays as was previously the default) - for example https://latest.datasette.io/fixtures/sortable.json

If you want extra stuff you can ask for it with the new ?_extra= parameter - e.g. https://latest.datasette.io/fixtures/sortable.json?_extra=columns&_extra=suggested_facets

You can use ?_extra=extras to see a list of available extras: https://latest.datasette.io/fixtures/sortable.json?_extra=extras

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2042/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1617938730 I_kwDOJHON9s5gb8kq 9 Default to just storing plaintext, store HTML if `--html` is passed simonw 9599 open 0     0 2023-03-09T20:19:06Z 2023-03-09T20:19:06Z   MEMBER  

The full body version of the notes can get HUGE, due to embedded images. It turns out for my own purposes I'm usually happy with just the plaintext version.

I'm tempted to say you don't get HTML unless you pass a --html option.

apple-notes-to-sqlite 611552758 issue    
{
    "url": "https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/9/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1616440856 I_kwDOJHON9s5gWO4Y 5 Configure full text search simonw 9599 open 0     0 2023-03-09T05:20:46Z 2023-03-09T05:20:46Z   MEMBER  

FTS would be useful.

Maybe even extract the plain text from the notes to make that index easier to create, rather than creating it against the HTML. Can use the plaintext property for that.

apple-notes-to-sqlite 611552758 issue    
{
    "url": "https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/5/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1564774831 I_kwDOBm6k_c5dRJGv 2012 Missing space in database summary simonw 9599 open 0     0 2023-01-31T18:01:13Z 2023-01-31T18:01:13Z   OWNER  

Spotted this on an instance index page:

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2012/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1554032168 I_kwDOBm6k_c5coKYo 2002 Document how actors are displayed simonw 9599 open 0     0 2023-01-24T00:08:49Z 2023-01-24T00:08:49Z   OWNER  

https://github.com/simonw/datasette/blob/e4ebef082de90db4e1b8527abc0d582b7ae0bc9d/datasette/utils/init.py#L1052-L1056

This logic should be reflected in the documentation on https://docs.datasette.io/en/stable/authentication.html#actors

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/2002/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1516815571 I_kwDOBm6k_c5aaMTT 1975 _col=id can cause id column to export twice in CSV export simonw 9599 open 0     0 2023-01-03T00:25:15Z 2023-01-03T00:25:21Z   OWNER  

https://datasette.simonwillison.net/simonwillisonblog/blog_entry.csv?_col=id&_col=title&_col=body&_labels=on&_size=1

csv id,id,title,body 1,1,WaSP Phase II,"<p>The <a href=""http://www.webstandards.org/"">Web Standards</a> project has launched Phase II.</p>" That should not have two id columns.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1975/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1468495358 I_kwDOBm6k_c5Xh3X- 1910 Check incoming column types on various write APIs simonw 9599 open 0   Datasette 1.0a-next 8755003 0 2022-11-29T18:09:10Z 2022-12-13T05:29:09Z   OWNER  

I do think this needs type checking - I just tried and you really can send a string to an integer column and have it work, which feels bad.

Originally posted by @simonw in https://github.com/simonw/datasette/issues/1863#issuecomment-1331089156

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1910/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1447465004 I_kwDOBm6k_c5WRpAs 1889 Ability to create new tokens via the API simonw 9599 open 0   Datasette 1.0a-next 8755003 0 2022-11-14T06:21:36Z 2022-12-13T05:29:08Z   OWNER  

Refs: - #1850

Initially I decided that the API shouldn't be able to create new tokens at all - I don't like the idea of an API token holder creating themselves additional tokens.

Then I realized that two of the API features are specifically more useful if you can generate fresh tokens via the API:

  • Tokes that expire after a time limit are MUCH more useful if they can be automatically generated
  • Likewise, tokens that are restricted to a subset of permissions (see #1855) make more sense to be generated like this, especially in conjunction with expiry times
datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1889/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1216436131 I_kwDOBm6k_c5IgVej 1721 Implement plugin hooks: `register_table_extras`, `register_row_extras`, `register_query_extras` simonw 9599 open 0   Datasette 1.0a-next 8755003 0 2022-04-26T20:21:49Z 2022-12-13T05:29:07Z   OWNER  

Designed in: - #1720

Part of: - #262 - #1709

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1721/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1479920517 I_kwDOBm6k_c5YNcuF 1934 Return number of ignored/replaced items from /-/insert simonw 9599 open 0   Datasette 1.0 3268330 0 2022-12-06T19:01:58Z 2022-12-06T19:02:03Z   OWNER  

Idea from here: - https://github.com/simonw/sqlite-utils/issues/516

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1934/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1456013930 I_kwDOBm6k_c5WyQJq 1906 Extract publish Heroku support to a plugin simonw 9599 open 0   Datasette 1.0 3268330 0 2022-11-19T00:02:51Z 2022-11-19T00:03:10Z   OWNER  

This is a strong argument for extracting the Heroku support out to a plugin - it would allow this to be fixed with a plugin release without needing to push a full release of Datasette itself.

Originally posted by @simonw in https://github.com/simonw/datasette/issues/1905#issuecomment-1320678715

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1906/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1454532488 I_kwDOBm6k_c5WsmeI 1902 Document {% block crumbs %} for plugin authors simonw 9599 open 0   Datasette 1.0 3268330 0 2022-11-18T06:16:30Z 2022-11-18T06:16:39Z   OWNER  

For datasette-copyable I want to show breadcrumbs that take database/instance permissions into account, so I'm removing {% block nav %} entirely and replacing it with this:

html+jinja {% block crumbs %} {{ crumbs.nav(request=request, database=database, table=table) }} {% endblock %}

Originally posted by @simonw in https://github.com/simonw/datasette/issues/1901#issuecomment-1319588163

I should document this.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1902/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1424980545 I_kwDOBm6k_c5U73pB 1861 request.headers.get("Content-Type") fails simonw 9599 open 0     0 2022-10-27T03:39:12Z 2022-10-27T03:39:12Z   OWNER  

Turns out this is case-sensitive, needs to be:

request.headers.get("content-type") != "application/json"

That's not great usability. It should be case insensitive.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1861/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1406860394 I_kwDOBm6k_c5T2vxq 1841 Drop format_bytes for Jinja filesizeformat filter simonw 9599 open 0     0 2022-10-12T22:06:34Z 2022-10-12T22:06:34Z   OWNER  

Turns out this isn't necessary:

https://github.com/simonw/datasette/blob/5aa359b86907d11b3ee601510775a85a90224da8/datasette/utils/init.py#L849-L858

I can use this instead: https://jinja.palletsprojects.com/en/3.1.x/templates/#jinja-filters.filesizeformat

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1841/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1399933513 I_kwDOBm6k_c5TcUpJ 1833 Ability to submit long queries by POST simonw 9599 open 0     0 2022-10-06T16:03:26Z 2022-10-06T16:18:00Z   OWNER  

Datasette doesn't limit URL lengths but some common web proxies do - the one in front of Google Cloud Run for example limits to 8KB total for incoming request headers: https://cloud.google.com/load-balancing/docs/quotas#https-lb-header-limits

This means longer SQL queries can break!

Need an optional mechanism for submitting queries by POST instead.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1833/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1396977994 I_kwDOBm6k_c5TRDFK 1830 Add documentation for writing tests with signed actor cookies simonw 9599 open 0     0 2022-10-04T23:51:26Z 2022-10-04T23:51:26Z   OWNER  

I use this pattirn in a lot of plugin tests, e.g. https://github.com/simonw/datasette-edit-templates/blob/087f6a6cabc20020f2b0524f11aa3a7836320848/tests/test_edit_templates.py#L55-L58 python actor = ds.sign({"a": {"id": "root"}}, "actor") response1 = await ds.client.get( "/-/edit-templates/_footer.html", cookies={"ds_actor": actor} ) I should add this to the documentation on this page: https://docs.datasette.io/en/latest/testing_plugins.html

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1830/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1378636455 I_kwDOBm6k_c5SLFKn 1815 `datasette publish provider .` to publish whole directory, similar to configuration directory mode simonw 9599 open 0     0 2022-09-19T23:28:59Z 2022-09-19T23:29:11Z   OWNER  

I haven't done this with any of my other datasette publish tools, but I do think it's a good idea. Being able to publish the entire directory - with templates and plugins and metadata - does seem very useful to me.

Originally posted by @simonw in https://github.com/simonw/datasette-publish-fly/issues/23#issuecomment-1251673489

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1815/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1359604075 I_kwDOCGYnMM5RCelr 481 Idea: `sqlite-utils create-table tablename --sql "select ..."` simonw 9599 open 0     0 2022-09-02T01:41:24Z 2022-09-02T01:42:08Z   OWNER  

Could offer syntactic sugar for:

sql create table foo as select * from bar

sqlite-utils create-table data.db foo --sql "select * from bar" https://sqlite-utils.datasette.io/en/stable/cli-reference.html#create-table

sqlite-utils 140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/481/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1353088849 I_kwDOBm6k_c5Qpn9R 1795 Consider automatically cleaning up curly quotes in searches simonw 9599 open 0     0 2022-08-27T16:35:25Z 2022-08-27T16:35:25Z   OWNER  

If your phone helpfully adds curly quotes for you then phrase searches against FTS won't work: “Rebecca Sugar”

In regular (not ?_searchmode=raw search mode Datasette could clean these up for you to help avoid that mistake.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1795/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1345561209 I_kwDOBm6k_c5QM6J5 1790 A better HTML title for canned query pages simonw 9599 open 0     0 2022-08-21T18:27:46Z 2022-08-21T18:27:46Z   OWNER  

https://scotrail.datasette.io/scotrail/assemble_sentence?terms=This+train+is+formed+of%2Cbomb+which

Current title is:

scotrail: with phrases as ( select key, value from json_each('["' || replace(:terms, ',', '","') || '"]')),matches as (select phrases.key, phrases.value, ( select File from announcements where announcements.Transcription like '%' || trim(phrases.value) || '%' order by length(announcements.Transcription) limit 1 ) as Filefrom phrases),results as ( select key, announcements.Transcription, announcements.mp3 from announcements join matches on announcements.File = matches.File order by key)select 'Combined sentence:' as mp3, group_concat(Transcription, ' ') as Transcription, -1 as keyfrom results unionselect mp3, Transcription, keyfrom resultsorder by key

I think a better title would be:

scotrail: assemble_sentence, terms = This train is formed of,bomb which

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1790/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1340900019 I_kwDOBm6k_c5P7IKz 1785 Can't use cog menu to facet by first column in a view simonw 9599 open 0     0 2022-08-16T21:27:23Z 2022-08-16T21:27:23Z   OWNER  

https://latest.datasette.io/fixtures/paginated_view

Compare with:

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1785/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1266329095 I_kwDOBm6k_c5LeqYH 1756 Mechanism for creating databases in WAL mode simonw 9599 open 0     0 2022-06-09T15:39:28Z 2022-06-09T15:39:28Z   OWNER  

The --create option currently creates databases if they are missing, but does not enable WAL mode for them.

It turns out WAL mode is useful for databases that are accepting writes!

I think a --create-wal option that both creates them AND sets WAL mode on any that are created would be a good idea.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1756/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1251739062 I_kwDOBm6k_c5KnAW2 1752 Research if I can drop Janus simonw 9599 open 0     0 2022-05-28T22:46:52Z 2022-05-28T22:46:52Z   OWNER  

It seems to me Janus dependency is not necessary, async with app.database_write_mutex(): out = await app.transaction(func) may be enough.

Comment here: https://lobste.rs/s/fki4tj/architecture_notes_datasette#c_a2ihon

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1752/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1237871948 I_kwDOBm6k_c5JyG1M 1743 `datasette.utils.to_css_class()` should be a documented internal simonw 9599 open 0     0 2022-05-16T23:57:26Z 2022-05-16T23:57:26Z   OWNER  

Because I'm using it in this plugin: - https://github.com/simonw/datasette-upload-dbs/issues/1

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1743/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1219398983 I_kwDOBm6k_c5Iro1H 1730 SQL tracing should much more closely track the SQL query execution simonw 9599 open 0     0 2022-04-28T22:41:04Z 2022-04-28T22:41:10Z   OWNER  

In #1727 I realized that the SQL tracing was measuring a whole bunch of stuff outside of the SQL query itself.

I started experimenting with this fix for that but it didn't work - I got back an empty JSON array of traces for some reason:

```diff diff --git a/datasette/database.py b/datasette/database.py index ba594a8..d7f9172 100644 --- a/datasette/database.py +++ b/datasette/database.py @@ -7,7 +7,7 @@ import sys import threading import uuid

-from .tracer import trace +from .tracer import trace, trace_child_tasks from .utils import ( detect_fts, detect_primary_keys, @@ -207,30 +207,31 @@ class Database: time_limit_ms = custom_time_limit

         with sqlite_timelimit(conn, time_limit_ms):
  • try:
  • cursor = conn.cursor()
  • cursor.execute(sql, params if params is not None else {})
  • max_returned_rows = self.ds.max_returned_rows
  • if max_returned_rows == page_size:
  • max_returned_rows += 1
  • if max_returned_rows and truncate:
  • rows = cursor.fetchmany(max_returned_rows + 1)
  • truncated = len(rows) > max_returned_rows
  • rows = rows[:max_returned_rows]
  • else:
  • rows = cursor.fetchall()
  • truncated = False
  • except (sqlite3.OperationalError, sqlite3.DatabaseError) as e:
  • if e.args == ("interrupted",):
  • raise QueryInterrupted(e, sql, params)
  • if log_sql_errors:
  • sys.stderr.write(
  • "ERROR: conn={}, sql = {}, params = {}: {}\n".format(
  • conn, repr(sql), params, e
  • with trace("sql", database=self.name, sql=sql.strip(), params=params):
  • try:
  • cursor = conn.cursor()
  • cursor.execute(sql, params if params is not None else {})
  • max_returned_rows = self.ds.max_returned_rows
  • if max_returned_rows == page_size:
  • max_returned_rows += 1
  • if max_returned_rows and truncate:
  • rows = cursor.fetchmany(max_returned_rows + 1)
  • truncated = len(rows) > max_returned_rows
  • rows = rows[:max_returned_rows]
  • else:
  • rows = cursor.fetchall()
  • truncated = False
  • except (sqlite3.OperationalError, sqlite3.DatabaseError) as e:
  • if e.args == ("interrupted",):
  • raise QueryInterrupted(e, sql, params)
  • if log_sql_errors:
  • sys.stderr.write(
  • "ERROR: conn={}, sql = {}, params = {}: {}\n".format(
  • conn, repr(sql), params, e
  • ) )
  • )
  • sys.stderr.flush()
  • raise
  • sys.stderr.flush()
  • raise

         if truncate:
             return Results(rows, truncated, cursor.description)
    

    @@ -238,9 +239,8 @@ class Database: else: return Results(rows, False, cursor.description)

  • with trace("sql", database=self.name, sql=sql.strip(), params=params):

  • results = await self.execute_fn(sql_operation_in_thread)
  • return results
  • with trace_child_tasks():
  • return await self.execute_fn(sql_operation_in_thread)

    @property def size(self): ```

Originally posted by @simonw in https://github.com/simonw/datasette/issues/1727#issuecomment-1111602802

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1730/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1217014076 I_kwDOBm6k_c5Iiik8 1726 Security page in the documentation simonw 9599 open 0     0 2022-04-27T08:43:30Z 2022-04-27T08:43:30Z   OWNER  

A page talking about how to run Datasette securely, and security concerns to take into account.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1726/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1216622905 I_kwDOBm6k_c5IhDE5 1725 Performance question - what is happening in this gap? simonw 9599 open 0     0 2022-04-27T00:21:11Z 2022-04-27T00:21:11Z   OWNER  

Trace from https://latest-with-plugins.datasette.io/github/commits?_facet=repo&_trace=1&_facet=committer

What's going on in that gap? Can I improve the tracing output to show some non-SQL queries to figure that out?

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1725/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1216479167 I_kwDOBm6k_c5Igf-_ 1722 `db.primary_keys()` and `db.table_columns()` don't show up in traces simonw 9599 open 0     0 2022-04-26T21:08:36Z 2022-04-26T21:08:36Z   OWNER  

Noticed this while working on: - #1715

This code here isn't showing up in traces: https://github.com/simonw/datasette/blob/579f59dcec43a91dd7d404e00b87a00afd8515f2/datasette/views/table.py#L218-L220

Because those functions don't use the regular trace-instrumented db.execute() code path - they work directly against a connection instead: https://github.com/simonw/datasette/blob/579f59dcec43a91dd7d404e00b87a00afd8515f2/datasette/utils/init.py#L610-L626

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1722/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1197925865 I_kwDOBm6k_c5HZuXp 1704 File PRs against incompatible plugins pinning to datasette<1.0 simonw 9599 open 0   Datasette 1.0 3268330 0 2022-04-08T23:15:30Z 2022-04-08T23:15:30Z   OWNER  

As part of the preparation for the 1.0 release, test all existing known plugins against the alpha.

For any that break, submit a PR suggesting they pin to a version <1.0 - and include a link to the documentation on how to upgrade the plugin for 1.0.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1704/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1196327155 I_kwDOBm6k_c5HToDz 1702 Be more consistent with column quoting simonw 9599 open 0     0 2022-04-07T16:59:20Z 2022-04-07T16:59:20Z   OWNER  

This tutorial made me notice that Datasette is pretty inconsistent with how column quoting works: https://datasette.io/tutorials/learn-sql

It has examples of each of "table_name" and [table_name] and table_name, and it uses single quoted values too.

Datasette should generate SQL as consistently as possible to support learners.

That tutorial should also provide a tiny bit of extra information about what's going on here.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1702/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1181364043 I_kwDOBm6k_c5Gai9L 1687 Make show_json.html or a similar mechanism stable for plugins simonw 9599 open 0     0 2022-03-25T23:42:45Z 2022-03-25T23:42:45Z   OWNER  

I used show_json.html in the new datasette-packages plugin, which means it will break if that template changes: - https://github.com/simonw/datasette-packages/issues/3

It would be useful if it (or something like it) was documented and stable for plugins to use.

Also relevant: - #878

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1687/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
953218043 MDU6SXNzdWU5NTMyMTgwNDM= 1403 Labels explaining what hidden tables are for simonw 9599 open 0     0 2021-07-26T19:29:22Z 2022-03-21T22:20:37Z   OWNER  

A reasonable question: "What are those hidden tables for?"

This could be answered by adding a small piece of explanatory text to each table - based on if it's related to FTS or to SpatiaLite or configured to be hidden for some other reason.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1403/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1175894898 I_kwDOBm6k_c5GFrty 1680 Consider simplifying permissions for 1.0 simonw 9599 open 0   Datasette 1.0 3268330 0 2022-03-21T20:17:29Z 2022-03-21T20:17:29Z   OWNER  

Permission checks right now can express one of three opinions:

  • False means "so not grant this permisson"
  • True means "grant this permission"
  • None means "I have no opinion"

But... there's also a concept of a "default" for a given permission check, which might be False or True.

I worry this is too complicated. Could this be simplified before 1.0? In particular the default concept.

See also: - #1676

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1680/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1148638868 I_kwDOBm6k_c5EdtaU 1639 Make datasette-redirect-forbidden unneccessary simonw 9599 open 0     0 2022-02-23T22:18:46Z 2022-02-23T22:18:46Z   OWNER  

I wrote datasette-redirect-forbidden today because I needed 403 errors to redirect to /-/login and it was the quickest way to solve that problem.

This should be a feature of Datasette core.

  • https://github.com/simonw/datasette-redirect-forbidden/issues/2
datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1639/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1142107925 I_kwDOBm6k_c5EEy8V 1638 `filters_from_request` plugin hook docs should mention that returning an async function is allowed simonw 9599 open 0     0 2022-02-18T00:08:26Z 2022-02-18T00:08:26Z   OWNER  

https://docs.datasette.io/en/stable/plugin_hooks.html#filters-from-request-request-database-table-datasette doesn't mention that you can return an async function - but you can, and in fact Datasette itself uses that here: https://github.com/simonw/datasette/blob/aa7f0037a46eb76ae6fe9bf2a1f616c58738ecdf/datasette/filters.py#L43-L47

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1638/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1125576543 I_kwDOBm6k_c5DFu9f 1630 Review datasette.utils and decide which functions should be documented for 1.0 simonw 9599 open 0   Datasette 1.0 3268330 0 2022-02-07T06:39:52Z 2022-02-07T06:39:52Z   OWNER  

Follows: - #1176

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1630/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1122557010 I_kwDOBm6k_c5C6NxS 1627 Get the tests passing against Windows simonw 9599 open 0     0 2022-02-03T01:23:06Z 2022-02-03T01:23:32Z   OWNER  

OK, the tests do NOT pass against Windows! https://github.com/simonw/datasette/runs/5044105941

Originally posted by @simonw in https://github.com/simonw/datasette/issues/1626#issuecomment-1028515161

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1627/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1122450452 I_kwDOBm6k_c5C5zwU 1625 Try running tests against macOS and Windows in addition to Ubuntu simonw 9599 open 0     0 2022-02-02T22:25:57Z 2022-02-02T22:25:57Z   OWNER  

I already do this for sqlite-utils: https://github.com/simonw/sqlite-utils/blob/3.22.1/.github/workflows/test.yml

Related: - #1617 - #1545

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1625/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1102966378 I_kwDOBm6k_c5Bve5q 1599 Add architecture documentation simonw 9599 open 0     0 2022-01-14T04:55:38Z 2022-01-14T04:56:03Z   OWNER  

Inspired by https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html

Good example: https://github.com/rust-analyzer/rust-analyzer/blob/d7c99931d05e3723d878bea5dc26766791fa4e69/docs/dev/architecture.md

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1599/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1102568047 I_kwDOBm6k_c5Bt9pv 1596 Documentation page warning of changes coming in 1.0 simonw 9599 open 0     0 2022-01-13T23:26:04Z 2022-01-13T23:26:04Z   OWNER  

I should start this relatively soon.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1596/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1090798237 I_kwDOCGYnMM5BBEKd 359 Use RETURNING if available to populate last_pk simonw 9599 open 0     0 2021-12-29T23:43:23Z 2021-12-29T23:43:23Z   OWNER  

Inspired by this: https://news.ycombinator.com/item?id=29729283

Because SQLite is effectively serializing all the writes for us, we have zero locking in our code. We used to have to lock when inserting new items (to get the LastInsertRowId), but the newer version of SQLite supports the RETURNING keyword, so we don't even have to lock on inserts now.

sqlite-utils 140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/359/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
741231849 MDU6SXNzdWU3NDEyMzE4NDk= 1087 Idea: ?_extra=urls for getting back URLs to useful things simonw 9599 open 0     0 2020-11-12T02:55:41Z 2021-12-15T18:06:16Z   OWNER  

Working on https://github.com/simonw/datasette-search-all/issues/10 made me realize that sometimes it can be difficult to calculate the URL for a database, table or row within Datasette.

It would be useful to have an optional extra JSON extension (using ?_extra= from #262) that can help with this.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1087/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1067775061 I_kwDOBm6k_c4_pPRV 1539 Research PRAGMA query_only simonw 9599 open 0     0 2021-11-30T23:30:24Z 2021-11-30T23:30:24Z   OWNER  

https://www.sqlite.org/pragma.html#pragma_query_only

The query_only pragma prevents data changes on database files when enabled. When this pragma is enabled, any attempt to CREATE, DELETE, DROP, INSERT, or UPDATE will result in an SQLITE_READONLY error. However, the database is not truly read-only. You can still run a checkpoint or a COMMIT and the return value of the sqlite3_db_readonly() routine is not affected.

Would it be worth adding this as an extra protection against accidental writes to a DB file over a read-only connection?

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1539/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1059209412 I_kwDOBm6k_c4_IkDE 1523 Come up with a more elegant solution for base_url than ds.urls.path() simonw 9599 open 0     0 2021-11-20T19:05:22Z 2021-11-20T19:05:22Z   OWNER  

While fixing #1519 I added a lot of ugly code that looks like this: https://github.com/simonw/datasette/blob/08947fa76433d18988aa1ee1d929bd8320c75fe2/datasette/facets.py#L228-L230

See these two commits in particular: fe687fd0207c4c56c4778d3e92e3505fc4b18172 and 08947fa76433d18988aa1ee1d929bd8320c75fe2

It would be great to come up with a less verbose and error-prone way of handling this problem.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1523/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1056746091 I_kwDOBm6k_c4-_Kpr 1515 Handle foreign keys that point to a non-existent table simonw 9599 open 0     0 2021-11-17T23:40:13Z 2021-11-18T01:31:56Z   OWNER  

Spotted in https://github.com/simonw/datasette-graphql/issues/79

Demo: https://datasette-graphql-demo.datasette.io/fixtures/bad_foreign_key

The foreign key links to a 404 page.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1515/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1051277222 I_kwDOBm6k_c4-qTem 1504 Link to ?_size=max at bottom of table page simonw 9599 open 0     0 2021-11-11T19:06:33Z 2021-11-11T19:06:33Z   OWNER  

This can have text such as "Show 1,000 rows per page", based on the max size limit setting. Would make it easier for people to see more data at once without having to know how to hack the URL, similar to the ... for facet sizes I added in #1337.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1504/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
1006016302 I_kwDOBm6k_c479pcu 1477 Consider adding request to the documented default template context simonw 9599 open 0     0 2021-09-24T02:34:09Z 2021-09-24T02:34:09Z   OWNER  

I made a plugin for this today but I think perhaps it should be a default thing instead: https://datasette.io/plugins/datasette-template-request

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1477/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
970626625 MDU6SXNzdWU5NzA2MjY2MjU= 1435 Turn off suggest facets on tables with large numbers of columns simonw 9599 open 0     0 2021-08-13T18:30:48Z 2021-08-13T18:30:48Z   OWNER  

If a table has 200 columns it will take multiple seconds to try and suggest facets. I should either quit after the first 20 or not suggest facets at all.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1435/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
957347860 MDU6SXNzdWU5NTczNDc4NjA= 1412 Mention WAL mode in the documentation (plus backup tips) simonw 9599 open 0     0 2021-08-01T00:27:11Z 2021-08-01T00:27:11Z   OWNER  

This is useful for people who are deploying Datasette with any write functionality, especially if they might be using something like EFS.

I can add a section about this to the bottom of https://docs.datasette.io/en/stable/deploying.html and then link to that section from both https://docs.datasette.io/en/stable/sql_queries.html#writable-canned-queries and https://docs.datasette.io/en/stable/internals.html#await-db-execute-write-sql-params-none-block-false

Also useful: mention that just copying a SQLite database file while it is being written to may not get a consistent file, so tell people to use one of the SQLite backup mechanisms instead.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1412/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
957315684 MDU6SXNzdWU5NTczMTU2ODQ= 1410 Rename settings to `default_allow_facet` and `default_allow_download` and `default_allow_csv_stream` simonw 9599 open 0   Datasette 1.0 3268330 0 2021-07-31T20:27:12Z 2021-07-31T20:27:49Z   OWNER  

If I was prone to over-thinking (which I am) I'd note that allow_facet and allow_download and allow_csv_stream are all settings that do NOT have an equivalent in the newer permissions system, which is itself a little weird and inconsistent.

So maybe there's a future task where I introduce those as both permissions and metadata "allow_x" blocks, then rename the settings themselves to be called default_allow_facet and default_allow_download and default_allow_csv_stream.

If I was going to do that I should get it in before Datasette 1.0.

Originally posted by @simonw in https://github.com/simonw/datasette/issues/1409#issuecomment-890400425

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1410/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
925491857 MDU6SXNzdWU5MjU0OTE4NTc= 1383 Improve test coverage for `inspect.py` simonw 9599 open 0     0 2021-06-20T00:22:43Z 2021-06-20T00:22:49Z   OWNER  

https://codecov.io/gh/simonw/datasette/src/main/datasette/inspect.py shows only 36% coverage for that module at the moment.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1383/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
776128269 MDU6SXNzdWU3NzYxMjgyNjk= 1162 First working version of "datasette insert data.db file.csv" simonw 9599 open 0     0 2020-12-29T23:20:11Z 2021-06-17T18:12:32Z   OWNER  

Refs #1160

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1162/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
924203783 MDU6SXNzdWU5MjQyMDM3ODM= 1379 Idea: ?_end=1 option for streaming CSV responses simonw 9599 open 0     0 2021-06-17T18:11:21Z 2021-06-17T18:11:30Z   OWNER  

As discussed in this thread: https://twitter.com/simonw/status/1405554676993433605 - one of the disadvantages of Datasette's streaming CSV feature is that it's hard to tell if you got the whole file or if the connection ended early - or if an error occurred.

Idea: offer an optional ?_end=1 parameter which, if enabled, adds a single row to the end of the CSV file that looks like this:

END,,,,,,,,,

For however many columns the CSV file usually has.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1379/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
915488244 MDU6SXNzdWU5MTU0ODgyNDQ= 1372 Add section to "writing plugins" about security, e.g. avoiding XSS simonw 9599 open 0     0 2021-06-08T20:49:33Z 2021-06-08T20:49:46Z   OWNER  

https://docs.datasette.io/en/stable/writing_plugins.html should have tips on writing secure plugins.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1372/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
897212458 MDU6SXNzdWU4OTcyMTI0NTg= 63 Ability to fetch commits from branches other than the default simonw 9599 open 0     0 2021-05-20T17:58:08Z 2021-05-20T17:58:08Z   MEMBER  

This tool is currently almost entirely ignorant of the concept of branches. One example: you can't retrieve commits from any branch other than the default (usually main).

github-to-sqlite 207052882 issue    
{
    "url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/63/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
871304967 MDU6SXNzdWU4NzEzMDQ5Njc= 1315 settings.json should be picked up by "datasette publish cloudrun" simonw 9599 open 0     0 2021-04-29T18:16:41Z 2021-04-29T18:16:41Z   OWNER  
datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1315/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
856895291 MDU6SXNzdWU4NTY4OTUyOTE= 1299 Design better empty states simonw 9599 open 0     0 2021-04-13T12:06:12Z 2021-04-13T12:06:12Z   OWNER  

Inspiration here: https://emptystat.es/

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1299/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
839367451 MDU6SXNzdWU4MzkzNjc0NTE= 1275 Idea: long-running query mode simonw 9599 open 0     0 2021-03-24T05:23:20Z 2021-03-24T05:23:20Z   OWNER  

It would be cool if you could run Datasette in a long-running query mode, for use with trusted users - something like this:

datasette --unlimited my.db

This would disable the query limit, but would also enable a feature where if a query takes longer than e.g. 1s to return Datasette returns an HTML page to the browser with a progress indicator and polls the server until the query is complete.... but also provides the user with a "cancel" button. This relates to the .interrupt() research in #1270.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1275/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
836923194 MDU6SXNzdWU4MzY5MjMxOTQ= 32 JSON API for search results simonw 9599 open 0     0 2021-03-20T22:21:36Z 2021-03-20T22:21:36Z   MEMBER  

Refs https://github.com/simonw/datasette/issues/878

dogsheep-beta 197431109 issue    
{
    "url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/32/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
816601354 MDExOlB1bGxSZXF1ZXN0NTgwMjM1NDI3 241 Extract expand - work in progress simonw 9599 open 0     0 2021-02-25T16:36:38Z 2021-02-25T16:36:38Z   OWNER simonw/sqlite-utils/pulls/241

Refs #239. Still needs documentation and CLI implementation.

sqlite-utils 140912432 pull    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/241/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
1  
778530523 MDU6SXNzdWU3Nzg1MzA1MjM= 1172 /-/static should be excluded from auth and permission checks simonw 9599 open 0     0 2021-01-05T02:53:41Z 2021-01-05T02:53:41Z   OWNER  

I want to set far future / immutable cache headers on everything served from /-/static and /-/static-plugins

This has security implications since it will be possible to see what plugins are installed by checking for known static URLs. I'm fine with that - performance is more important here.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1172/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
750089847 MDU6SXNzdWU3NTAwODk4NDc= 1109 Deprecate --config in Datasette 1.0 (in favour of --setting) simonw 9599 open 0   Datasette 1.0 3268330 0 2020-11-24T21:43:57Z 2020-12-17T22:07:49Z   OWNER  

I added a deprecation warning to this in #992.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1109/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
346026869 MDU6SXNzdWUzNDYwMjY4Njk= 354 Handle many-to-many relationships simonw 9599 open 0     0 2018-07-31T04:03:13Z 2020-11-24T19:51:18Z   OWNER  

This is a master tracking ticket for various many-2-many features.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/354/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
426722204 MDU6SXNzdWU0MjY3MjIyMDQ= 423 ?_search_col=X not reflected correctly in the UI simonw 9599 open 0     0 2019-03-28T21:48:19Z 2020-11-03T19:01:59Z   OWNER  

e.g. https://latest.datasette.io/fixtures/searchable?_search_text1=barry

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/423/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
730210880 MDU6SXNzdWU3MzAyMTA4ODA= 1055 query.html and table.html should share the same table implementation simonw 9599 open 0   Datasette 1.0 3268330 0 2020-10-27T07:58:21Z 2020-10-27T07:58:29Z   OWNER  

In #998 I made a change that affected the table page but didn't affect the query page because I incorrectly assumed they shared rendering logic.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1055/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
709789634 MDU6SXNzdWU3MDk3ODk2MzQ= 27 Sort order is not persisted by facet filter links simonw 9599 open 0     0 2020-09-27T18:22:07Z 2020-09-27T18:22:07Z   MEMBER  

A link to /-/beta?category=1&timestamp__date=2018-08-01&q=swedish should be to /-/beta?category=1&timestamp__date=2018-08-01&q=swedish&sort=newest

dogsheep-beta 197431109 issue    
{
    "url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/27/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
581795570 MDU6SXNzdWU1ODE3OTU1NzA= 93 Support more string values for types in .add_column() simonw 9599 open 0     0 2020-03-15T19:32:49Z 2020-09-24T20:36:46Z   OWNER  

https://sqlite-utils.readthedocs.io/en/2.4.2/python-api.html#adding-columns says:

SQLite types you can specify are "TEXT", "INTEGER", "FLOAT" or "BLOB".

As discovered in #92 this isn't the right list of values. I should expand this to match https://www.sqlite.org/datatype3.html

sqlite-utils 140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/93/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
688352145 MDU6SXNzdWU2ODgzNTIxNDU= 141 insert-files support for compressed values simonw 9599 open 0     0 2020-08-28T20:59:46Z 2020-09-24T20:36:08Z   OWNER  

The sqlar format supports this, it would be useful if insert-files could support this too.

https://www.sqlite.org/sqlar.html

sqlite-utils 140912432 issue    
{
    "url": "https://api.github.com/repos/simonw/sqlite-utils/issues/141/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
703218448 MDU6SXNzdWU3MDMyMTg0NDg= 51 Documentation for twitter-to-sqlite fetch simonw 9599 open 0     0 2020-09-17T02:38:10Z 2020-09-17T02:38:10Z   MEMBER  

It's mentioned in passing in the README but it deserves its own section: $ twitter-to-sqlite fetch \ "https://api.twitter.com/1.1/account/verify_credentials.json" \ | grep '"id"' | head -n 1

twitter-to-sqlite 206156866 issue    
{
    "url": "https://api.github.com/repos/dogsheep/twitter-to-sqlite/issues/51/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
703216044 MDU6SXNzdWU3MDMyMTYwNDQ= 49 Feature: gists and starred gists simonw 9599 open 0     0 2020-09-17T02:30:52Z 2020-09-17T02:30:52Z   MEMBER  

https://developer.github.com/v3/gists/#list-starred-gists

github-to-sqlite 207052882 issue    
{
    "url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/49/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
692202408 MDU6SXNzdWU2OTIyMDI0MDg= 12 Idea: maps and GeoJSON support simonw 9599 open 0     0 2020-09-03T18:47:10Z 2020-09-04T01:45:03Z   MEMBER  

It would be cool if the display_sql could return a column populated with GeoJSON which would the automatically be displayed on a map in the results (or maybe default JS would look for a class="geojson" element output by the display template) - ala https://github.com/simonw/datasette-leaflet-geojson

Then I could render workout routes on a map, or Swarm checkin points.

dogsheep-beta 197431109 issue    
{
    "url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/12/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
691537426 MDU6SXNzdWU2OTE1Mzc0MjY= 959 Internals API idea: results.dicts in addition to results.rows simonw 9599 open 0     0 2020-09-03T00:50:17Z 2020-09-03T00:50:17Z   OWNER  

I just wrote this code: python results = await database.execute(SEARCH_SQL, {"query": query}) return [dict(r) for r in results.rows] How about having results.dicts as a utility property that does that?

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/959/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
689850810 MDU6SXNzdWU2ODk4NTA4MTA= 6 Set up a demo instance simonw 9599 open 0     0 2020-09-01T06:20:24Z 2020-09-01T06:20:24Z   MEMBER  

Once I've got the Datasette plugin to a state where it's worth building a demo: #3

I can use data from my public https://github-to-sqlite.dogsheep.net/ demo plus the Pocket data subset I use for the demo in https://github.com/dogsheep/pocket-to-sqlite/issues/5 - I could pull in the https://dogsheep-photos.dogsheep.net/ photos data too.

dogsheep-beta 197431109 issue    
{
    "url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/6/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
689848827 MDU6SXNzdWU2ODk4NDg4Mjc= 6 ISO timestamps simonw 9599 open 0     0 2020-09-01T06:16:42Z 2020-09-01T06:16:42Z   MEMBER  

The time_added, time_updated and time_read columns currently store data like this:

September 19, 2019 - 00:30:30 UTC

Should use ISO instead, e.g. 2020-07-26T01:05:24+00:00

pocket-to-sqlite 213286752 issue    
{
    "url": "https://api.github.com/repos/dogsheep/pocket-to-sqlite/issues/6/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
675594325 MDU6SXNzdWU2NzU1OTQzMjU= 917 Idea: "datasette publish" option for "only if the data has changed simonw 9599 open 0     0 2020-08-08T21:58:27Z 2020-08-08T21:58:27Z   OWNER  

This is a pattern I often find myself needing. I usually implement this in GitHub Actions like this:

https://github.com/simonw/covid-19-datasette/blob/efa01c39abc832b8641fc2a92840cc3acae2fb08/.github/workflows/scheduled.yml#L52-L63

yaml - name: Set variables to decide if we should deploy id: decide_variables run: |- echo "##[set-output name=latest;]$(datasette inspect covid.db | jq '.covid.hash' -r)" echo "##[set-output name=deployed;]$(curl -s https://covid-19.datasettes.com/-/databases.json | jq '.[0].hash' -r)" - name: Set up Cloud Run if: github.event_name == 'workflow_dispatch' || steps.decide_variables.outputs.latest != steps.decide_variables.outputs.deployed uses: GoogleCloudPlatform/github-actions/setup-gcloud@master This is pretty fiddly. It might be good for datasette publish to grow a helper option that does effectively this - hashes the databases (and the metadata.json) and compares them to the deployed version.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/917/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
673602857 MDU6SXNzdWU2NzM2MDI4NTc= 9 Define a view that displays photos correctly simonw 9599 open 0     0 2020-08-05T14:53:39Z 2020-08-05T14:53:39Z   MEMBER  

The photos table stores data like this:

id | createdAt | source | prefix | suffix | width | height | visibility | created ▲ | user -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 5e12c9708506bc000840262a | January 06, 2020 - 05:45:20 UTC | Swarm for iOS 1 | https://fastly.4sqi.net/img/general/ | /15889193_AXxGk4I1nbzUZuyYqObgbXdJNyEHiwj6AUDq0tPZWtw.jpg | 1920 | 1440 | public | 2020-01-06T05:45:20 | 15889193

The photo URL can be derived from those pieces - define a SQL view which does that (using datasette-json-html to display the pictures)

swarm-to-sqlite 205429375 issue    
{
    "url": "https://api.github.com/repos/dogsheep/swarm-to-sqlite/issues/9/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
668064026 MDU6SXNzdWU2NjgwNjQwMjY= 911 Rethink the --name option to "datasette publish" simonw 9599 open 0   Datasette 1.0 3268330 0 2020-07-29T18:49:49Z 2020-07-29T18:49:49Z   OWNER  

--name works inconsistently across the different publish providers - on Cloud Run you should use --service instead for example. Need to review it across all of them and either remove it or clarify what it does.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/911/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
648659536 MDU6SXNzdWU2NDg2NTk1MzY= 881 Figure out why restore_working_directory is needed in some places simonw 9599 open 0     0 2020-07-01T04:19:25Z 2020-07-01T04:19:25Z   OWNER  

This is a frustrating workaround. I have a restore_working_directory fixture that I wrote to solve errors that look like this: ``` /Users/simon/Dropbox/Development/datasette/tests/test_publish_cloudrun.py:148:


/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py:112: in enter return next(self.gen)


self = <click.testing.CliRunner object at 0x1135ad110>

@contextlib.contextmanager
def isolated_filesystem(self):
    """A context manager that creates a temporary folder and changes
    the current working directory to it for isolated filesystem tests.
    """
  cwd = os.getcwd()

E FileNotFoundError: [Errno 2] No such file or directory `` Here's an example of it in use: removing therestore_working_directory` argument from this function causes the failure. https://github.com/simonw/datasette/blob/549b1c2063db48c4622ee5c7b478a1e3cbc1ac07/tests/test_plugins.py#L689-L690

I'd like to not have to do this.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/881/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
638238548 MDU6SXNzdWU2MzgyMzg1NDg= 845 Code coverage should ignore files in .coveragerc simonw 9599 open 0     0 2020-06-13T21:45:42Z 2020-06-13T21:46:03Z   OWNER  

I'm not sure why this is, but the code coverage I have running in a GitHub Action doesn't take my .coveragerc file into account. It should:

https://github.com/simonw/datasette/blob/cf7a2bdb404734910ec07abc7571351a2d934828/.github/workflows/test-coverage.yml#L31-L35

Here's the bit that's ignored:

https://github.com/simonw/datasette/blob/cf7a2bdb404734910ec07abc7571351a2d934828/.coveragerc#L1-L2

As a result my coverage score is 84%, when it should be 92%: 2020-06-13T21:41:18.4404252Z ----------- coverage: platform linux, python 3.8.3-final-0 ----------- 2020-06-13T21:41:18.4404570Z Name Stmts Miss Cover 2020-06-13T21:41:18.4404971Z -------------------------------------------------------- 2020-06-13T21:41:18.4405227Z datasette/__init__.py 3 0 100% 2020-06-13T21:41:18.4405441Z datasette/__main__.py 3 3 0% 2020-06-13T21:41:18.4405668Z datasette/_version.py 279 279 0% 2020-06-13T21:41:18.4405921Z datasette/actor_auth_cookie.py 20 0 100% 2020-06-13T21:41:18.4406135Z datasette/app.py 499 27 95% 2020-06-13T21:41:18.4406343Z datasette/cli.py 162 45 72% 2020-06-13T21:41:18.4406553Z datasette/database.py 236 17 93% 2020-06-13T21:41:18.4406761Z datasette/default_permissions.py 40 0 100% 2020-06-13T21:41:18.4406975Z datasette/facets.py 210 24 89% 2020-06-13T21:41:18.4407186Z datasette/filters.py 122 7 94% 2020-06-13T21:41:18.4407394Z datasette/hookspecs.py 34 0 100% 2020-06-13T21:41:18.4407600Z datasette/inspect.py 36 23 36% 2020-06-13T21:41:18.4407807Z datasette/plugins.py 34 6 82% 2020-06-13T21:41:18.4408014Z datasette/publish/__init__.py 0 0 100% 2020-06-13T21:41:18.4408240Z datasette/publish/cloudrun.py 57 2 96% 2020-06-13T21:41:18.4408786Z datasette/publish/common.py 19 1 95% 2020-06-13T21:41:18.4409029Z datasette/publish/heroku.py 97 13 87% 2020-06-13T21:41:18.4409243Z datasette/renderer.py 63 4 94% 2020-06-13T21:41:18.4409450Z datasette/sql_functions.py 5 0 100% 2020-06-13T21:41:18.4410480Z datasette/tracer.py 87 16 82% 2020-06-13T21:41:18.4410972Z datasette/utils/__init__.py 504 31 94% 2020-06-13T21:41:18.4411755Z datasette/utils/asgi.py 264 24 91% 2020-06-13T21:41:18.4412173Z datasette/utils/shutil_backport.py 44 44 0% 2020-06-13T21:41:18.4412822Z datasette/version.py 4 0 100% 2020-06-13T21:41:18.4413562Z datasette/views/__init__.py 0 0 100% 2020-06-13T21:41:18.4414276Z datasette/views/base.py 288 19 93% 2020-06-13T21:41:18.4414579Z datasette/views/database.py 120 2 98% 2020-06-13T21:41:18.4414860Z datasette/views/index.py 57 2 96% 2020-06-13T21:41:18.4415379Z datasette/views/special.py 72 16 78% 2020-06-13T21:41:18.4418994Z datasette/views/table.py 418 18 96% 2020-06-13T21:41:18.4428811Z -------------------------------------------------------- 2020-06-13T21:41:18.4430394Z TOTAL 3777 623 84%

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/845/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
626582657 MDU6SXNzdWU2MjY1ODI2NTc= 779 Make human_description_en explicitly available to output renderers simonw 9599 open 0     0 2020-05-28T14:59:54Z 2020-05-28T14:59:54Z   OWNER  

datasette-atom uses this:

https://github.com/simonw/datasette-atom/blob/df98a6c43a443224b6cd232f84703ec297ef046b/datasette_atom/init.py#L36-L37 python if data.get("human_description_en"): title += ": " + data["human_description_en"] It's a nice way to generate a useful title for a filtered table.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/779/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
621486115 MDU6SXNzdWU2MjE0ODYxMTU= 27 photos_with_apple_metadata view should include labels simonw 9599 open 0     0 2020-05-20T06:06:17Z 2020-05-20T06:06:17Z   MEMBER  

https://dogsheep-photos.dogsheep.net/public/photos_with_apple_metadata?place_city=New+Orleans&_facet=place_city&_facet_array=albums&_facet_array=persons

Here's one way to add that: sql select rowid, photo, ( select json_group_array( json_object( 'label', normalized_string, 'href', '/photos/labelled?_hide_sql=1&label=' || normalized_string ) ) from labels where labels.uuid = photos_with_apple_metadata.uuid ) as labels, date,

dogsheep-photos 256834907 issue    
{
    "url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/27/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
613491342 MDU6SXNzdWU2MTM0OTEzNDI= 762 Experiment with PRAGMA hard_heap_limit simonw 9599 open 0     0 2020-05-06T17:33:23Z 2020-05-07T03:08:44Z   OWNER  

This was added in SQLite 2020-01-22 (3.31.0): https://www.sqlite.org/changes.html#version_3_31_0

Add the sqlite3_hard_heap_limit64() interface and the corresponding PRAGMA hard_heap_limit command.

This sounds like it could be a nice extra safety measure.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/762/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
599776345 MDU6SXNzdWU1OTk3NzYzNDU= 24 Feature idea: github-to-sqlite everything ... simonw 9599 open 0     0 2020-04-14T18:34:00Z 2020-04-14T18:34:00Z   MEMBER  

At the moment if you want to pull all your repos, issues, issues comments etc you have to do it with a sequence of separate commands.

Consider adding a everything or all command which fetches everything that the tool knows how to fetch, and is designed to be run on a cron in a way that fetches just new stuff each time.

github-to-sqlite 207052882 issue    
{
    "url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/24/reactions",
    "total_count": 7,
    "+1": 7,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
593006814 MDU6SXNzdWU1OTMwMDY4MTQ= 715 Refactor duplicate cell display logic simonw 9599 open 0     0 2020-04-03T00:58:11Z 2020-04-03T00:58:11Z   OWNER  

The logic for rendering cells in table view and in database (or canned query) view is currently very similar:

https://github.com/simonw/datasette/blob/7656fd64d8b6a32ebc34d89c1b8711cc5ea240f7/datasette/views/base.py#L514-L539

Compared with:

https://github.com/simonw/datasette/blob/7656fd64d8b6a32ebc34d89c1b8711cc5ea240f7/datasette/views/table.py#L104-L195

I'll be changing this a bit in #698 but I should still try to clean this up more further in the future.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/715/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
530468212 MDU6SXNzdWU1MzA0NjgyMTI= 643 Set up some basic benchmarks as part of the unit tests simonw 9599 open 0     0 2019-11-29T19:24:19Z 2019-11-29T19:24:19Z   OWNER  

https://pypi.org/project/pytest-benchmark/ looks great for this.

Here's how to run it as a github action: https://github.com/rhysd/github-action-benchmark/blob/master/examples/pytest/README.md

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/643/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
505673645 MDU6SXNzdWU1MDU2NzM2NDU= 16 Do a better job with archived direct message threads simonw 9599 open 0     0 2019-10-11T06:55:21Z 2019-10-11T06:55:27Z   MEMBER  

https://github.com/dogsheep/twitter-to-sqlite/blob/fb2698086d766e0333a55bb73435e7283feeb438/twitter_to_sqlite/archive.py#L98-L99

twitter-to-sqlite 206156866 issue    
{
    "url": "https://api.github.com/repos/dogsheep/twitter-to-sqlite/issues/16/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
503053243 MDU6SXNzdWU1MDMwNTMyNDM= 582 Datasette should not completely crash if one SQLite database is malformed simonw 9599 open 0     0 2019-10-06T05:11:43Z 2019-10-06T05:11:43Z   OWNER  

If you run Datasette against a number of database files and one of them is malformed, you get this 500 error on the index page:

It would be better if Datasette still worked and listed the databases that were NOT malformed, then showed an inline error message just for the one that could not be accessed.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/582/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   
460095928 MDU6SXNzdWU0NjAwOTU5Mjg= 528 Establish a pattern for Datasette plugins built on top of Pandas simonw 9599 open 0     0 2019-06-24T21:05:52Z 2019-06-24T21:05:52Z   OWNER  

The Pandas ecosystem is huge, varied and full of tools that are really good at doing interesting analysis on top of tabular data.

Pandas should not be a dependency of Datasette core, but I think there is a lot of potential in having plugins which use Pandas to apply interesting analysis to data sucked out of Datasette's SQLite tables.

One example (thanks, Tony): https://github.com/ResidentMario/missingno could form the basis of a fantastic plugin for getting a high-level overview of how complete each column in a table is.

Some thought is needed here about what shape these kind of plugins might take, and what plugin hooks they would use.

datasette 107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/528/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   

Next page

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 286.446ms · About: github-to-sqlite