{"id":17117613,"url":"https://github.com/feloy/pgproc","last_synced_at":"2026-05-04T02:39:54.019Z","repository":{"id":57604643,"uuid":"86089707","full_name":"feloy/pgproc","owner":"feloy","description":"pgproc - Easily call PostgreSQL procedures from Go (golang)","archived":false,"fork":false,"pushed_at":"2017-05-09T08:37:10.000Z","size":20,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-29T07:48:55.739Z","etag":null,"topics":["golang","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/feloy.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-03-24T16:39:19.000Z","updated_at":"2022-08-16T04:36:00.000Z","dependencies_parsed_at":"2022-09-26T20:01:09.656Z","dependency_job_id":null,"html_url":"https://github.com/feloy/pgproc","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/feloy%2Fpgproc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feloy%2Fpgproc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feloy%2Fpgproc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feloy%2Fpgproc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feloy","download_url":"https://codeload.github.com/feloy/pgproc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245195764,"owners_count":20575936,"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":["golang","postgresql"],"created_at":"2024-10-14T17:52:12.378Z","updated_at":"2026-05-04T02:39:48.986Z","avatar_url":"https://github.com/feloy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/feloy/pgproc.svg?branch=master)](https://travis-ci.org/feloy/pgproc)\n\n[![Coverage Status](https://coveralls.io/repos/github/feloy/pgproc/badge.svg?branch=master)](https://coveralls.io/github/feloy/pgproc?branch=master)\n\n# pgproc - Easily call PostgreSQL procedures from Go (golang)\n\nIf you are using PostgreSQL server programming functionalities (user-defined \nprocedures and data types essentially) and want to access these functions \nfrom your Go programs, this library is made for you.\n\nThanks to both PostgreSQL and Go reflection APIs, it is possible to automatically\nmap types of parameters and returned values between both worlds.\n\nThe main advantage of the `pgproc` library is to be able to call in a single pair of lines\na PostgreSQL stored procedure and get its result in a Go native of `struct` variable.\n\n**This library is at an early development stage, please have a look at the tests files \nto see the covered cases.**\n\n## Install\n\n```sh\n$ go get github.com/feloy/pgproc\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n        \"fmt\"\n        \"github.com/feloy/pgproc\"\n)\n\nvar (\n        user     = \"myuser\"\n        password = \"mysecret\"\n        host     = \"localhost\"\n        dbname   = \"mydb\"\n        base     *pgproc.PgProc\n)\n\nfunc main() {\n        conninfo := fmt.Sprintf(\"user=%s password=%s host=%s dbname=%s sslmode=disable\",\n                user, password, host, dbname)\n        base, err := pgproc.NewPgProc(conninfo)\n        if err != nil {\n                panic(\"cannot connect to database\")\n        }\n\n        // Call an SQL procedure returning an integer value\n        var val int\n        base.Call(\u0026val, \"public\", \"age_of_captain\")\n        fmt.Printf(\"The captain is %d years old\\n\", val)\n\n        // Call an SQL procedures returning a composite value\n\tvar str struct {\n\t        Age  int\n                Name string\n        }\n\tbase.Call(\u0026str, \"public\", \"get_captain_info\")\n\tfmt.Println(str)\n\n}\n```\n\nresults in:\n```sh\n$ go run main.go\nThe captain is 42 years old\n{42 Ford Prefect}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeloy%2Fpgproc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeloy%2Fpgproc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeloy%2Fpgproc/lists"}