github
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/1851#issuecomment-1292519956 | https://api.github.com/repos/simonw/datasette/issues/1851 | 1292519956 | IC_kwDOBm6k_c5NCkoU | 15178711 | 2022-10-26T19:20:33Z | 2022-10-26T19:20:33Z | CONTRIBUTOR | > This could use a new plugin hook, too. I don't want to complicate your life too much, but for things like GIS, I'd want a way to turn regular JSON into SpatiaLite geometries or combine X/Y coordinates into point geometries and such. Happy to help however I can. @eyeseast Maybe you could do this with triggers? Like you can insert JSON-friendly data into a "raw" table, and create a trigger that transforms that inserted data into the proper table Here's an example: ```sql -- meant to be updated from a Datasette insert create table points_raw(longitude int, latitude int); -- the target table with proper spatliate geometries create table points(point geometry); CREATE TRIGGER insert_points_raw INSERT ON points_raw BEGIN insert into points(point) values (makepoint(new.longitude, new.latitude)) END; ``` You could then POST a new row to `points_raw` like this: ``` POST /db/points_raw Authorization: Bearer xxx Content-Type: application/json { "row": { "longitude": 27.64356, "latitude": -47.29384 } } ``` Then SQLite with run the trigger and insert a new row in `points` with the correct geometry point. Downside is you'd have duplicated data with `points_raw`, but maybe it could be a `TEMP` table (or have a cron that deletes all rows from that table every so often?) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1421544654 | |
https://github.com/simonw/datasette/pull/1789#issuecomment-1223347322 | https://api.github.com/repos/simonw/datasette/issues/1789 | 1223347322 | IC_kwDOBm6k_c5I6sx6 | 15178711 | 2022-08-23T00:03:20Z | 2022-08-23T00:03:20Z | CONTRIBUTOR | @simonw to build the extension on ubuntu, you can run: ``` apt-get update && apt-get install libsqlite3-dev gcc gcc ext.c -fPIC -shared -o ext.so ``` I'm not the best with Actions, but if you set the cache key to `ext.c`, run those two commands to download dependencies + compile to `ext.so`, then the unit test should pick it up and run it correctly. Let me know if you want me to update the PR with that added | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1344823170 | |
https://github.com/simonw/datasette/pull/1789#issuecomment-1221576460 | https://api.github.com/repos/simonw/datasette/issues/1789 | 1221576460 | IC_kwDOBm6k_c5Iz8cM | 15178711 | 2022-08-21T16:16:42Z | 2022-08-21T16:16:42Z | CONTRIBUTOR | Rebased, Read the docs failure should now now fixed Re docs - ya that's a pretty ambitious page, I'm still not 100% sure what the best practices are/should be... Would be happy to make that page in a future PR | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1344823170 | |
https://github.com/simonw/datasette/issues/1528#issuecomment-975955589 | https://api.github.com/repos/simonw/datasette/issues/1528 | 975955589 | IC_kwDOBm6k_c46K-aF | 15178711 | 2021-11-22T22:00:30Z | 2021-11-22T22:00:30Z | CONTRIBUTOR | Oh, another thing to consider: I believe this would be the first `"_file"` key in datasette's metadata, compared to other `"_url"` keys like `"license_url"` or `"about_url"`. Not too sure what considerations to include with this (ex should missing files cause Datasette to stop before starting, should build scripts bundle these sql files somewhere during `datasette package`, etc.) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1060631257 |