{"id":34585191,"url":"https://github.com/planetscale/golang-example-gin","last_synced_at":"2026-05-25T18:33:07.847Z","repository":{"id":99532468,"uuid":"540576156","full_name":"planetscale/golang-example-gin","owner":"planetscale","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-06T11:14:22.000Z","size":34,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-06T13:24:43.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planetscale.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-23T18:48:52.000Z","updated_at":"2025-09-27T04:52:12.000Z","dependencies_parsed_at":"2023-07-30T20:16:04.252Z","dependency_job_id":null,"html_url":"https://github.com/planetscale/golang-example-gin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/planetscale/golang-example-gin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fgolang-example-gin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fgolang-example-gin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fgolang-example-gin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fgolang-example-gin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planetscale","download_url":"https://codeload.github.com/planetscale/golang-example-gin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fgolang-example-gin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33488909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: 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":[],"created_at":"2025-12-24T10:29:49.154Z","updated_at":"2026-05-25T18:33:07.839Z","avatar_url":"https://github.com/planetscale.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connecting to PlanetScale from Go\n\n\u003e **Note:** This example targets PlanetScale Vitess/MySQL. PlanetScale also offers managed Postgres. For more information, see the [PlanetScale Postgres documentation](https://planetscale.com/docs/postgres).\n\nThis example demonstrates how to connect a Go application to a PlanetScale database using [`go-sql-driver/mysql`](https://github.com/go-sql-driver/mysql).\n\nFollow the instructions below to find and insert your PlanetScale credentials.\n\n## Getting the credentials\n\n1. In the [PlanetScale dashboard](https://app.planetscale.com), select the database you want to connect to.\n2. Click \"**Branches**\" and select the branch you want to connect to.\n3. Click \"**Connect**\".\n4. Select \"**Go**\" from the \"**Connect from**\" dropdown.\n5. If the password is blurred, click \"**New password**\".\n6. Copy the contents of the `.env` tab. You won't be able to see the password again.\n\n## Connecting your database\n\n1. Create a file in the root of the project called `.env` and paste the connection details here from the previous section.\n2. Run the app using `go run .` in a terminal.\n3. Use `tests.http` file with the VS Code Rest Client plugin to test the API, or use the contents as a reference for your preferred API testing software.\n\n\nYou can find more information in the [Foreign key constraints section of the Go quickstart](https://planetscale.com/docs/tutorials/connect-go-app#foreign-key-constraints).\n\n## More resources\n\n**Go resources**\n\n- For more in-depth Go instructions, check out the [Go quickstart](https://planetscale.com/docs/tutorials/connect-go-app).\n\n**Next steps**\n\n- Learn more about the [PlanetScale workflow](https://planetscale.com/docs/concepts/planetscale-workflow).\n- Learn how to [branch your PlanetScale database](https://planetscale.com/docs/concepts/branching) for development.\n- Learn how to ship schema changes to production with [deploy requests](https://planetscale.com/docs/concepts/deploy-requests).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fgolang-example-gin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanetscale%2Fgolang-example-gin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fgolang-example-gin/lists"}