{"id":18446666,"url":"https://github.com/cristalhq/pgxutil","last_synced_at":"2025-04-08T00:31:56.112Z","repository":{"id":57637755,"uuid":"425238014","full_name":"cristalhq/pgxutil","owner":"cristalhq","description":"Go jackc/pgx helper to write proper transactions ","archived":false,"fork":false,"pushed_at":"2023-02-28T20:02:37.000Z","size":43,"stargazers_count":7,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T03:24:49.005Z","etag":null,"topics":["database","go","golang","pgx","postgres","transactions"],"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/cristalhq.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-06T12:25:37.000Z","updated_at":"2023-05-05T06:38:17.000Z","dependencies_parsed_at":"2024-06-20T03:20:56.346Z","dependency_job_id":null,"html_url":"https://github.com/cristalhq/pgxutil","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristalhq%2Fpgxutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristalhq%2Fpgxutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristalhq%2Fpgxutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristalhq%2Fpgxutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristalhq","download_url":"https://codeload.github.com/cristalhq/pgxutil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755401,"owners_count":20990616,"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":["database","go","golang","pgx","postgres","transactions"],"created_at":"2024-11-06T07:09:59.554Z","updated_at":"2025-04-08T00:31:55.721Z","avatar_url":"https://github.com/cristalhq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgxutil\n\n[![build-img]][build-url]\n[![pkg-img]][pkg-url]\n[![reportcard-img]][reportcard-url]\n[![coverage-img]][coverage-url]\n\nGo [jackc/pgx](https://github.com/jackc/pgx) helper to write proper transactions.\n\n\n## Features\n\n* Simple API.\n\n## Install\n\nGo version 1.17+\n\n```\ngo get github.com/cristalhq/pgxutil\n```\n\n## Example\n\n```go\n// create jackc/pgx pool\nvar pool *pgxpool.Pool\n\ndb, err := pgxutil.New(pool)\nif err != nil {\n\tpanic(err)\n}\n\nctx := context.Background()\n\n// to make transaction with a given isolation level\nlevel := pgx.Serializable\nerrTx := db.InWriteTx(ctx, level, func(tx pgx.Tx) error {\n\t// TODO: good query with tx\n\treturn nil\n})\nif errTx != nil {\n\tpanic(errTx)\n}\n\n// to make read-only transaction with a read committed isolation level\nerrRead := db.InReadTx(ctx, func(tx pgx.Tx) error {\n\t// TODO: good read-only query with tx\n\treturn nil\n})\nif errRead != nil {\n\tpanic(errRead)\n}\t\n```\n\nAlso see examples: [examples_test.go](https://github.com/cristalhq/pgxutil/blob/main/example_test.go).\n\n## Documentation\n\nSee [these docs][pkg-url].\n\n## License\n\n[MIT License](LICENSE).\n\n[build-img]: https://github.com/cristalhq/pgxutil/workflows/build/badge.svg\n[build-url]: https://github.com/cristalhq/pgxutil/actions\n[pkg-img]: https://pkg.go.dev/badge/cristalhq/pgxutil\n[pkg-url]: https://pkg.go.dev/github.com/cristalhq/pgxutil\n[reportcard-img]: https://goreportcard.com/badge/cristalhq/pgxutil\n[reportcard-url]: https://goreportcard.com/report/cristalhq/pgxutil\n[coverage-img]: https://codecov.io/gh/cristalhq/pgxutil/branch/main/graph/badge.svg\n[coverage-url]: https://codecov.io/gh/cristalhq/pgxutil","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristalhq%2Fpgxutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristalhq%2Fpgxutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristalhq%2Fpgxutil/lists"}