{"id":16951309,"url":"https://github.com/otoolep/go-grpc-pg","last_synced_at":"2025-07-19T12:33:37.374Z","repository":{"id":57527376,"uuid":"95632223","full_name":"otoolep/go-grpc-pg","owner":"otoolep","description":"Simple service exposing a gRPC interface, with a connection to PostgreSQL on the backend","archived":false,"fork":false,"pushed_at":"2018-06-12T01:34:41.000Z","size":35,"stargazers_count":33,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T22:21:35.015Z","etag":null,"topics":["go","golang","grpc","postgres"],"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/otoolep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-28T05:34:58.000Z","updated_at":"2022-11-01T17:51:17.000Z","dependencies_parsed_at":"2022-09-07T02:52:23.422Z","dependency_job_id":null,"html_url":"https://github.com/otoolep/go-grpc-pg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolep%2Fgo-grpc-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolep%2Fgo-grpc-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolep%2Fgo-grpc-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otoolep%2Fgo-grpc-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otoolep","download_url":"https://codeload.github.com/otoolep/go-grpc-pg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245140801,"owners_count":20567450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","grpc","postgres"],"created_at":"2024-10-13T21:59:48.502Z","updated_at":"2025-03-23T17:30:57.032Z","avatar_url":"https://github.com/otoolep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-grpc-pg [![Circle CI](https://circleci.com/gh/otoolep/go-grpc-pg/tree/master.svg?style=svg)](https://circleci.com/gh/otoolep/go-grpc-pg/tree/master) [![GoDoc](https://godoc.org/github.com/otoolep/go-grpc-pg?status.svg)](https://godoc.org/github.com/otoolep/go-grpc-pg) [![Go Report Card](https://goreportcard.com/badge/github.com/otoolep/go-grpc-pg)](https://goreportcard.com/report/github.com/otoolep/go-grpc-pg)\n======\n\nA simple service demonstrating Go, gRPC, and PostgreSQL. Integration with [CircleCI (version 1.0)](http://www.circleci.com) included.\n\n## Building go-grpc-pg\n*Building go-httpd requires Go 1.8 or later. [gvm](https://github.com/moovweb/gvm) is a great tool for installing and managing your versions of Go.*\n\nDownload and build it like so:\n```\nmkdir go-grpc-pg # Or any directory of your choice\ncd go-grpc-pg/\nexport GOPATH=$PWD\ngo get -t github.com/otoolep/go-grpc-pg/...\ncd src/github.com/otoolep/go-grpc-pg\ngo install ./...\n```\nSome people consider using a distinct `GOPATH` environment variable for each project _doing it wrong_. In practise I, and many other Go programmers, find this actually most convenient.\n\n### Optional step to speed up testing\nUnit testing actually uses SQLite, which is built as part of the test suite -- there is no need to install SQLite separately. However the compilation of SQLite is slow, and quickly becomes tedious if continually repeated. To avoid continual compilation every test run, execute the following command after performing the steps above:\n```\ngo install github.com/mattn/go-sqlite3\n```\n\n## Running go-grpc-pg\nOnce built as per above, launch the server as follows:\n```\n$GOPATH/bin/server\n```\nThis assumes PostgreSQL is listening on `localhost`, port 5432. Run `$GOPATH/bin/server -h` to learn the full configuration the server expects of PostgreSQL, including the database, user, and password that must exist.\n\n### Generating queries\nAssuming the server is up and running, execute the client as follows.\n```\n$GOPATH/bin/client\n```\nAn example session is shown below.\n```\n\u003e\u003e CREATE TABLE bar (id INTEGER NOT NULL PRIMARY KEY, name TEXT)\nLast Insert ID: -1, rows affected: 1\n\u003e\u003e SELECT * FROM bar\n\u003e\u003e INSERT INTO bar(id, name) VALUES(1, 'bob')\nLast Insert ID: -1, rows affected: 1\n\u003e\u003e INSERT INTO bar(id, name) VALUES(2, 'tom')\nLast Insert ID: -1, rows affected: 1\n\u003e\u003e SELECT * FROM bar\n1       bob\n2       tom\n\u003e\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotoolep%2Fgo-grpc-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotoolep%2Fgo-grpc-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotoolep%2Fgo-grpc-pg/lists"}