home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1092386254

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/1699#issuecomment-1092386254 https://api.github.com/repos/simonw/datasette/issues/1699 1092386254 IC_kwDOBm6k_c5BHH3O 25778 2022-04-08T02:39:25Z 2022-04-08T02:39:25Z CONTRIBUTOR

And just to think this through a little more, here's what stream_geojson might look like:

python async def stream_geojson(datasette, columns, rows, database, stream): db = datasette.get_database(database) for row in rows: feature = await row_to_geojson(row, db) stream.write(feature + "\n") # just assuming newline mode for now

Alternately, that could be an async generator, like this:

python async def stream_geojson(datasette, columns, rows, database): db = datasette.get_database(database) for row in rows: feature = await row_to_geojson(row, db) yield feature

Not sure which makes more sense, but I think this pattern would open up a lot of possibility. If you had your stream_indented_json function, you could do yield from stream_indented_json(rows, 2) and be one your way.

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