home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "CONTRIBUTOR" and issue = 1124731464 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • eyeseast 4

issue 1

  • Make it easier to insert geometries, with documentation and maybe code · 4 ✖

author_association 1

  • CONTRIBUTOR · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1077671779 https://github.com/simonw/sqlite-utils/issues/399#issuecomment-1077671779 https://api.github.com/repos/simonw/sqlite-utils/issues/399 IC_kwDOCGYnMM5AO_dj eyeseast 25778 2022-03-24T14:11:33Z 2022-03-24T14:11:43Z CONTRIBUTOR

Coming back to this. I was about to add a utility function to datasette-geojson to convert lat/lng columns to geometries. Thankfully I googled first. There's a SpatiaLite function for this: MakePoint.

sql select MakePoint(longitude, latitude) as geometry from places;

I'm not sure if that would work with conversions, since it needs two columns, but it's an option for tables that already have latitude, longitude columns.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make it easier to insert geometries, with documentation and maybe code 1124731464  
1030741289 https://github.com/simonw/sqlite-utils/issues/399#issuecomment-1030741289 https://api.github.com/repos/simonw/sqlite-utils/issues/399 IC_kwDOCGYnMM49b90p eyeseast 25778 2022-02-06T03:03:43Z 2022-02-06T03:03:43Z CONTRIBUTOR

I wonder if there are any interesting non-geospatial canned conversions that it would be worth including?

Off the top of my head:

  • Un-nesting JSON objects into columns
  • Splitting arrays
  • Normalizing dates and times
  • URL munging with urlparse
  • Converting strings to numbers

Some of this is easy enough with SQL functions, some is easier in Python. Maybe that's where having pre-built classes gets really handy, because it saves you from thinking about which way it's implemented.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make it easier to insert geometries, with documentation and maybe code 1124731464  
1030740826 https://github.com/simonw/sqlite-utils/issues/399#issuecomment-1030740826 https://api.github.com/repos/simonw/sqlite-utils/issues/399 IC_kwDOCGYnMM49b9ta eyeseast 25778 2022-02-06T02:59:10Z 2022-02-06T02:59:10Z CONTRIBUTOR

All this said, I don't think it's unreasonable to point people to dedicated tools like geojson-to-sqlite. If I'm dealing with a bunch of GeoJSON or Shapefiles, I need to something to read those anyway (or I need to figure out virtual tables). But something like this might make it easier to build those libraries, or standardize the underlying parts.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make it easier to insert geometries, with documentation and maybe code 1124731464  
1030740653 https://github.com/simonw/sqlite-utils/issues/399#issuecomment-1030740653 https://api.github.com/repos/simonw/sqlite-utils/issues/399 IC_kwDOCGYnMM49b9qt eyeseast 25778 2022-02-06T02:57:17Z 2022-02-06T02:57:17Z CONTRIBUTOR

I like the idea of having stock conversions you could import. I'd actually move them to a dedicated module (call it sqlite_utils.conversions or something), because it's different from other utilities. Maybe they even take configuration, or they're composable.

```python from sqlite_utils.conversions import LongitudeLatitude

db["places"].insert( { "name": "London", "lng": -0.118092, "lat": 51.509865, }, conversions={"point": LongitudeLatitude("lng", "lat")}, ) ```

I would definitely use that for every CSV I get with lat/lng columns where I actually need GeoJSON.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make it easier to insert geometries, with documentation and maybe code 1124731464  

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 14.721ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows