{"id":16972967,"url":"https://github.com/henvic/pgxtutorial","last_synced_at":"2026-04-01T21:01:39.881Z","repository":{"id":42231992,"uuid":"428063511","full_name":"henvic/pgxtutorial","owner":"henvic","description":"Example of how to build a web service using Go, PostgreSQL, and gRPC","archived":false,"fork":false,"pushed_at":"2025-05-06T00:04:36.000Z","size":213,"stargazers_count":135,"open_issues_count":2,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-27T14:35:45.378Z","etag":null,"topics":["go","golang","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/henvic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"henvic"}},"created_at":"2021-11-14T23:13:14.000Z","updated_at":"2026-02-08T16:41:38.000Z","dependencies_parsed_at":"2023-11-12T01:28:38.302Z","dependency_job_id":"a07937e1-1f5e-42e4-a853-0ecb8005985f","html_url":"https://github.com/henvic/pgxtutorial","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"d789ca1eb472f555f66721026c1a59988da9254b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/henvic/pgxtutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henvic%2Fpgxtutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henvic%2Fpgxtutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henvic%2Fpgxtutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henvic%2Fpgxtutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henvic","download_url":"https://codeload.github.com/henvic/pgxtutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henvic%2Fpgxtutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31050479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T15:56:29.888Z","status":"ssl_error","status_checked_at":"2026-03-27T15:56:29.182Z","response_time":164,"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":["go","golang","postgres","postgresql"],"created_at":"2024-10-14T01:00:40.995Z","updated_at":"2026-04-01T21:01:39.818Z","avatar_url":"https://github.com/henvic.png","language":"Go","funding_links":["https://github.com/sponsors/henvic"],"categories":["Go"],"sub_categories":[],"readme":"# pgxtutorial\n[![GoDoc](https://godoc.org/github.com/henvic/pgxtutorial?status.svg)](https://godoc.org/github.com/henvic/pgxtutorial) [![Build Status](https://github.com/henvic/pgxtutorial/workflows/Integration/badge.svg)](https://github.com/henvic/pgxtutorial/actions?query=workflow%3AIntegration) [![Coverage Status](https://coveralls.io/repos/henvic/pgxtutorial/badge.svg)](https://coveralls.io/r/henvic/pgxtutorial)\n\nThis is an accompanying repository of the article [Back to basics: Writing an application using Go and PostgreSQL](https://henvic.dev/posts/go-postgres) by [Henrique Vicente](https://henvic.dev/). Feel free to open issues to ask any questions or comment on anything.\n\n## Environment variables\npgxtutorial uses the following environment variables:\n\n| Environment Variable | Description |\n| - | - |\n| PostgreSQL environment variables | Please check https://www.postgresql.org/docs/current/libpq-envars.html |\n| INTEGRATION_TESTDB | When running go test, database tests will only run if `INTEGRATION_TESTDB=true` |\n| OTEL_EXPORTER | When OTEL_EXPORTER=stdout or OTEL_EXPORTER=otel, telemetry is exported |\n\n## tl;dr\nTo play with it install [Go](https://go.dev/) on your system.\nYou'll need to connect to a [PostgreSQL](https://www.postgresql.org/) database.\nYou can check if a connection is working by calling `psql`.\n\nTo run tests:\n\n```sh\n# Run all tests passing INTEGRATION_TESTDB explicitly\n$ INTEGRATION_TESTDB=true go test -v ./...\n```\n\nTo run application:\n\n```sh\n# Create a database\n$ psql -c \"CREATE DATABASE pgxtutorial;\"\n# Set the environment variable PGDATABASE\n$ export PGDATABASE=pgxtutorial\n# Run migrations\n$ tern migrate -m ./migrations\n# Execute application\n$ go run .\n2021/11/22 07:21:21 HTTP server listening at localhost:8080\n2021/11/22 07:21:21 gRPC server listening at 127.0.0.1:8082\n```\n\nYou could also\n```\ngo install github.com/henvic/pgxtutorial@latest\n```\nto just get the `pgxtutorial` binary.\n\n## See also\n* [pgtools](https://github.com/henvic/pgtools/)\n* [pgq](https://github.com/henvic/pgq)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenvic%2Fpgxtutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenvic%2Fpgxtutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenvic%2Fpgxtutorial/lists"}