home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

13 rows where issue = 1218133366 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • simonw 9
  • wragge 4

author_association 2

  • OWNER 9
  • CONTRIBUTOR 4

issue 1

  • Writable canned queries fail with useless non-error against immutable databases · 13 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1214411623 https://github.com/simonw/datasette/issues/1728#issuecomment-1214411623 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5IYnNn simonw 9599 2022-08-14T16:34:20Z 2022-08-14T16:34:20Z OWNER

Here's what it looks like:

I put the disabled attribute on the form submission button too. There's no visible difference in how that button is displayed but since this is only a state that should be seen by the developer I think that's OK, especially combined with the warning at the top of the page.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1214408558 https://github.com/simonw/datasette/issues/1728#issuecomment-1214408558 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5IYmdu simonw 9599 2022-08-14T16:14:36Z 2022-08-14T16:14:36Z OWNER

Decision: I'm going to implement this:

Don't allow the user to even submit the form - show a message saying that this canned query is unavailable because the database cannot be written to

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111752676 https://github.com/simonw/datasette/issues/1728#issuecomment-1111752676 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ__k wragge 127565 2022-04-28T05:11:54Z 2022-04-28T05:11:54Z CONTRIBUTOR

And in terms of the bug, yep I agree that option 2 would be the most useful and least frustrating.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111751734 https://github.com/simonw/datasette/issues/1728#issuecomment-1111751734 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ_w2 wragge 127565 2022-04-28T05:09:59Z 2022-04-28T05:09:59Z CONTRIBUTOR

Thanks, I'll give it a try!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111714665 https://github.com/simonw/datasette/issues/1728#issuecomment-1111714665 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ2tp simonw 9599 2022-04-28T03:52:47Z 2022-04-28T03:52:58Z OWNER

Nice custom template/theme!

Yeah, for that I'd recommend hosting elsewhere - on a regular VPS (I use systemd like this: https://docs.datasette.io/en/stable/deploying.html#running-datasette-using-systemd ) or using Fly if you want to tub containers without managing a full server.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111712953 https://github.com/simonw/datasette/issues/1728#issuecomment-1111712953 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ2S5 wragge 127565 2022-04-28T03:48:36Z 2022-04-28T03:48:36Z CONTRIBUTOR

I don't think that'd work for this project. The db is very big, and my aim was to have an environment where researchers could be making use of the data, but be easily able to add corrections to the HTR/OCR extracted data when they came across problems. It's in its immutable (!) form here: https://sydney-stock-exchange-xqtkxtd5za-ts.a.run.app/stock_exchange/stocks

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111708206 https://github.com/simonw/datasette/issues/1728#issuecomment-1111708206 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ1Iu simonw 9599 2022-04-28T03:38:56Z 2022-04-28T03:38:56Z OWNER

In terms of this bug, there are a few potential fixes:

  1. Detect the write to a immutable database and show the user a proper, meaningful error message in the red error box at the top of the page
  2. Don't allow the user to even submit the form - show a message saying that this canned query is unavailable because the database cannot be written to
  3. Don't even allow Datasette to start running at all - if there's a canned query configured in metadata.yml and the database it refers to is in -i immutable mode throw an error on startup

I'm not keen on that last one because it would be frustrating if you couldn't launch Datasette just because you had an old canned query lying around in your metadata file.

So I'm leaning towards option 2.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111707384 https://github.com/simonw/datasette/issues/1728#issuecomment-1111707384 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ074 simonw 9599 2022-04-28T03:36:46Z 2022-04-28T03:36:56Z OWNER

A more realistic solution (which I've been using on several of my own projects) is to keep the data itself in GitHub and encourage users to edit it there - using the GitHub web interface to edit YAML files or similar.

Needs your users to be comfortable hand-editing YAML though! You can at least guard against critical errors by having CI run tests against their YAML before deploying.

I have a dream of building a more friendly web forms interface which edits the YAML back on GitHub for the user, but that's just a concept at the moment.

Even more fun would be if a user-friendly form could submit PRs for review without the user having to know what a PR is!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111706519 https://github.com/simonw/datasette/issues/1728#issuecomment-1111706519 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ0uX simonw 9599 2022-04-28T03:34:49Z 2022-04-28T03:34:49Z OWNER

I've wanted to do stuff like that on Cloud Run too. So far I've assumed that it's not feasible, but recently I've been wondering how hard it would be to have a small (like less than 100KB or so) Datasette instance which persists data to a backing GitHub repository such that when it starts up it can pull the latest copy and any time someone edits it can push their changes.

I'm still not sure it would work well on Cloud Run due to the uncertainty at what would happen if Cloud Run decided to boot up a second instance - but it's still an interesting thought exercise.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111705323 https://github.com/simonw/datasette/issues/1728#issuecomment-1111705323 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ0br wragge 127565 2022-04-28T03:32:06Z 2022-04-28T03:32:06Z CONTRIBUTOR

Ah, that would be it! I have a core set of data which doesn't change to which I want authorised users to be able to submit corrections. I was going to deal with the persistence issue by just grabbing the user corrections at regular intervals and saving to GitHub. I might need to rethink. Thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111705069 https://github.com/simonw/datasette/issues/1728#issuecomment-1111705069 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQ0Xt simonw 9599 2022-04-28T03:31:33Z 2022-04-28T03:31:33Z OWNER

Confirmed - this is a bug where immutable databases fail to show a useful error if you write to them with a canned query.

Steps to reproduce: echo ' databases: writable: queries: add_name: sql: insert into names(name) values (:name) write: true ' > write-metadata.yml echo '{"name": "Simon"}' | sqlite-utils insert writable.db names - datasette writable.db -m write-metadata.yml Then visit http://127.0.0.1:8001/writable/add_name - adding names works.

Now do this instead:

datasette -i writable.db -m write-metadata.yml

And I'm getting a broken error:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111698307 https://github.com/simonw/datasette/issues/1728#issuecomment-1111698307 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQyuD simonw 9599 2022-04-28T03:18:02Z 2022-04-28T03:18:02Z OWNER

If the behaviour you are seeing is because the database is running in immutable mode then that's a bug - you should get a useful error message instead!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  
1111697985 https://github.com/simonw/datasette/issues/1728#issuecomment-1111697985 https://api.github.com/repos/simonw/datasette/issues/1728 IC_kwDOBm6k_c5CQypB simonw 9599 2022-04-28T03:17:20Z 2022-04-28T03:17:20Z OWNER

How did you deploy to Cloud Run?

datasette publish cloudrun defaults to running databases there in -i immutable mode, because if you managed to change a file on disk on Cloud Run those changes would be lost the next time your container restarted there.

That's why I upgraded datasette-publish-fly to provide a way of working with their volumes support - they're the best option I know of right now for running Datasette in a container with a persistent volume that can accept writes: https://simonwillison.net/2022/Feb/15/fly-volumes/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Writable canned queries fail with useless non-error against immutable databases 1218133366  

Advanced export

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

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 207.358ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows