{"id":20705455,"url":"https://github.com/whosonfirst/go-whosonfirst-sqlite-spr","last_synced_at":"2026-02-08T03:08:23.490Z","repository":{"id":57575810,"uuid":"325159178","full_name":"whosonfirst/go-whosonfirst-sqlite-spr","owner":"whosonfirst","description":"Go package to implement the whosonfirst/go-whosonfirst-spr interface for \"standard places result\" (SPR) data stored in a SQLite database.","archived":false,"fork":false,"pushed_at":"2024-12-13T20:36:20.000Z","size":34,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T18:09:02.014Z","etag":null,"topics":["golang","spr","sqlite","whosonfirst"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whosonfirst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-29T01:48:05.000Z","updated_at":"2024-12-13T20:34:48.000Z","dependencies_parsed_at":"2022-08-29T00:50:28.618Z","dependency_job_id":null,"html_url":"https://github.com/whosonfirst/go-whosonfirst-sqlite-spr","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/whosonfirst/go-whosonfirst-sqlite-spr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-sqlite-spr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-sqlite-spr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-sqlite-spr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-sqlite-spr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whosonfirst","download_url":"https://codeload.github.com/whosonfirst/go-whosonfirst-sqlite-spr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-sqlite-spr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29218671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T02:25:35.815Z","status":"ssl_error","status_checked_at":"2026-02-08T02:24:27.970Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","spr","sqlite","whosonfirst"],"created_at":"2024-11-17T01:18:12.454Z","updated_at":"2026-02-08T03:08:23.468Z","avatar_url":"https://github.com/whosonfirst.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-whosonfirst-sqlite-spr\n\nGo package to implement the `whosonfirst/go-whosonfirst-spr` interface for \"standard places result\" (SPR) data stored in a SQLite database that has been indexed using the `whosonfirst/go-whosonfirst-sqlite-features` package.\n\n## Documentation\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/whosonfirst/go-whosonfirst-sqlite-spr.svg)](https://pkg.go.dev/github.com/whosonfirst/go-whosonfirst-sqlite-spr)\n\n## Description\n\n`go-whosonfirst-sqlite-spr` is a Go package to implement the `whosonfirst/go-whosonfirst-spr` interface for [\"standard places result\"](https://github.com/whosonfirst/go-whosonfirst-spr) (SPR) data stored in a SQLite database, specifically data stored in [an `spr` table](https://github.com/whosonfirst/go-whosonfirst-sqlite-features#spr) as indexed by the `go-whosonfirst-sqlite-features` package.\n\nThis package exposes a single public method called `RetrieveSPR` that retrieves a row from a `spr` table in a SQLite database and returns it as an instance that implements the `go-whosonfirst-spr.SPR` interface. \n\nThe method signature is:\n\n```\nfunc RetrieveSPR(context.Context, database.SQLiteDatabase, sqlite.Table, int64, string) (spr.StandardPlacesResult, error)\n```\n\nFor example:\n\n```\nimport (\n        \"context\"\n\t\"database/sql\"\n\t\n\t_ \"github.com/mattn/go-sqlite3\"\n\t\n\t\"github.com/whosonfirst/go-whosonfirst-database/sql/tables\"\n\t\"github.com/whosonfirst/go-whosonfirst-sqlite-spr/v2\"\n)\n\nctx := context.Background()\n\ndb, _ := sql.Open(\"sqlite3\", \"test.db\")\nspr_table, _ := tables.NewSPRTableWithDatabase(db)\n\nid := 1234\nalt_label := \"\"\n\nspr_r, _ := spr.RetrieveSPR(ctx, db, spr_table, id, alt_label)\n```\n\n_Error handling omitted for the sake of brevity._\n\nThe `spr_r` instance returned will have the type `SQLiteStandardPlacesResult` and implements all of the `spr.StandardPlacesResult` methods. Under the hood it looks like this:\n\n```\ntype SQLiteStandardPlacesResult struct {\n\tspr.StandardPlacesResult     `json:\",omitempty\"`\n\tWOFId                        string  `json:\"wof:id\"`\n\tWOFParentId                  string  `json:\"wof:parent_id\"`\n\tWOFName                      string  `json:\"wof:name\"`\n\tWOFCountry                   string  `json:\"wof:country\"`\n\tWOFPlacetype                 string  `json:\"wof:placetype\"`\n\tMZLatitude                   float64 `json:\"mz:latitude\"`\n\tMZLongitude                  float64 `json:\"mz:longitude\"`\n\tMZMinLatitude                float64 `json:\"mz:min_latitude\"`\n\tMZMinLongitude               float64 `json:\"mz:min_longitude\"`\n\tMZMaxLatitude                float64 `json:\"mz:max_latitude\"`\n\tMZMaxLongitude               float64 `json:\"mz:max_longitude\"`\n\tMZIsCurrent                  int64   `json:\"mz:is_current\"`\n\tMZIsDeprecated               int64   `json:\"mz:is_deprecated\"`\n\tMZIsCeased                   int64   `json:\"mz:is_ceased\"`\n\tMZIsSuperseded               int64   `json:\"mz:is_superseded\"`\n\tMZIsSuperseding              int64   `json:\"mz:is_superseding\"`\n\tWOFPath         \t     string  `json:\"wof:path\"`\n\tWOFRepo         \t     string  `json:\"wof:repo\"`\n\tWOFLastModified \t     int64   `json:\"wof:lastmodified\"`\n}\n```\n\n## See also\n\n* https://github.com/whosonfirst/go-whosonfirst-spr\n* https://github.com/whosonfirst/go-whosonfirst-database","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhosonfirst%2Fgo-whosonfirst-sqlite-spr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhosonfirst%2Fgo-whosonfirst-sqlite-spr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhosonfirst%2Fgo-whosonfirst-sqlite-spr/lists"}