{"id":19865893,"url":"https://github.com/driftprogramming/pgxpoolmock","last_synced_at":"2026-01-23T00:09:54.549Z","repository":{"id":40549893,"uuid":"373719704","full_name":"driftprogramming/pgxpoolmock","owner":"driftprogramming","description":"pgx postgresql pool","archived":false,"fork":false,"pushed_at":"2025-08-07T07:39:21.000Z","size":735,"stargazers_count":38,"open_issues_count":6,"forks_count":17,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-07T09:30:06.019Z","etag":null,"topics":["go","mock","pgx","pool","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/driftprogramming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-04T04:27:55.000Z","updated_at":"2025-08-07T07:39:25.000Z","dependencies_parsed_at":"2024-06-18T17:09:22.883Z","dependency_job_id":"e95d701b-f1a3-4345-995e-d2ff0582e47a","html_url":"https://github.com/driftprogramming/pgxpoolmock","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/driftprogramming/pgxpoolmock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftprogramming%2Fpgxpoolmock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftprogramming%2Fpgxpoolmock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftprogramming%2Fpgxpoolmock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftprogramming%2Fpgxpoolmock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/driftprogramming","download_url":"https://codeload.github.com/driftprogramming/pgxpoolmock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftprogramming%2Fpgxpoolmock/sbom","scorecard":{"id":356253,"data":{"date":"2025-08-11","repo":{"name":"github.com/driftprogramming/pgxpoolmock","commit":"d20f17a99585080964c7330b64bffeb0f4fbd9fe"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 4/17 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: MIT License: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T09:41:28.573Z","repository_id":40549893,"created_at":"2025-08-18T09:41:28.573Z","updated_at":"2025-08-18T09:41:28.573Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28675509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T20:48:19.482Z","status":"ssl_error","status_checked_at":"2026-01-22T20:48:14.968Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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","mock","pgx","pool","postgresql"],"created_at":"2024-11-12T15:24:27.626Z","updated_at":"2026-01-23T00:09:54.539Z","avatar_url":"https://github.com/driftprogramming.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"### PGX POOL MOCK\n\nThis repo is mock `pgxpool` in https://github.com/jackc/pgx. so that you can test your data access code locally, no real database is needed.\nI also strongly recommend you use `pgxpool` rather than `pgx` only. see https://github.com/jackc/pgx/tree/master/pgxpool\n\n### How to install\n\n```\ngo get -u github.com/driftprogramming/pgxpoolmock\n```\n\n### How to Use\n\nSee file `order_dao_example_test.go` to figure out how to use it. Or see the below:\n```go\npackage pgxpoolmock_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/driftprogramming/pgxpoolmock\"\n\t\"github.com/driftprogramming/pgxpoolmock/testdata\"\n\t\"go.uber.org/mock/gomock\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\n\nfunc TestInsertOrder(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tmockPool := pgxpoolmock.NewMockPgxPool(ctrl)\n\tcommandTag := pgconn.CommandTag(\"INSERT 0 1\")\n\tmockPool.EXPECT().Exec(gomock.Any(), \"insert into order (id, price) values ($1, $2)\", 1, 2.3).Return(commandTag, nil)\n\torderDao := testdata.OrderDAO{\n\t\tPool: mockPool,\n\t}\n\n\torder := \u0026testdata.Order{\n\t\tID:    1,\n\t\tPrice: 2.3,\n\t}\n\terr := orderDao.InsertOrder(order)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", err)\n\t}\n}\n\nfunc TestGetOneOrderByID(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\tmockPool := pgxpoolmock.NewMockPgxPool(ctrl)\n\tcolumns := []string{\"id\", \"price\"}\n\tpgxRow := pgxpoolmock.NewRow(columns, 1, 2.3)\n\tmockPool.EXPECT().QueryRow(gomock.Any(), \"select id, price from order where id = $1\", 1).Return(pgxRow)\n\torderDao := testdata.OrderDAO{\n\t\tPool: mockPool,\n\t}\n\tactualOrder, err := orderDao.GetOneOrderByID(1)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", err)\n\t}\n\tassert.NotNil(t, actualOrder)\n\tassert.Equal(t, 1, actualOrder.ID)\n\tassert.Equal(t, 2.3, actualOrder.Price)\n}\n\nfunc TestName(t *testing.T) {\n\tt.Parallel()\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\t// given\n\tmockPool := pgxpoolmock.NewMockPgxPool(ctrl)\n\tcolumns := []string{\"id\", \"price\"}\n\tpgxRows := pgxpoolmock.NewRows(columns).AddRow(100, 100000.9).ToPgxRows()\n\tmockPool.EXPECT().Query(gomock.Any(), gomock.Any(), gomock.Any()).Return(pgxRows, nil)\n\torderDao := testdata.OrderDAO{\n\t\tPool: mockPool,\n\t}\n\n\t// when\n\tactualOrder := orderDao.GetOrderByID(1)\n\n\t// then\n\tassert.NotNil(t, actualOrder)\n\tassert.Equal(t, 100, actualOrder.ID)\n\tassert.Equal(t, 100000.9, actualOrder.Price)\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdriftprogramming%2Fpgxpoolmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdriftprogramming%2Fpgxpoolmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdriftprogramming%2Fpgxpoolmock/lists"}