{"id":38814872,"url":"https://github.com/protogodev/dbtest","last_synced_at":"2026-01-17T12:59:15.475Z","repository":{"id":57622422,"uuid":"394502971","full_name":"protogodev/dbtest","owner":"protogodev","description":"Database testing made easy in Go.","archived":false,"fork":false,"pushed_at":"2023-05-12T09:08:10.000Z","size":178,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T05:50:50.508Z","etag":null,"topics":["golang","testing"],"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/protogodev.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-08-10T02:35:16.000Z","updated_at":"2022-10-31T05:08:40.000Z","dependencies_parsed_at":"2024-06-19T05:22:03.505Z","dependency_job_id":"2e2552d4-35a5-4268-aef3-ccf83ac827ff","html_url":"https://github.com/protogodev/dbtest","commit_stats":null,"previous_names":["russellluo/dbtest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/protogodev/dbtest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protogodev%2Fdbtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protogodev%2Fdbtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protogodev%2Fdbtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protogodev%2Fdbtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/protogodev","download_url":"https://codeload.github.com/protogodev/dbtest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protogodev%2Fdbtest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"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":["golang","testing"],"created_at":"2026-01-17T12:59:14.897Z","updated_at":"2026-01-17T12:59:15.467Z","avatar_url":"https://github.com/protogodev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbtest\n\nDatabase testing made easy in Go.\n\n\n## Features\n\n1. Declarative\n  \n    Define the minimum test specification in a YAML-based DSL, then all tests can be generated automatically.\n\n2. Customizable\n\n    You can specify your own Go template when generating tests.\n\n3. Opinionated\n  \n    - [The database is a detail][1], which means the database-related code should always implement a Go interface.\n    - [Run database tests against a real database][2], instead of relying on mocks.\n        + The limitation is that running tests in parallel is not supported.\n    - Use the same [test fixture][3] for all subtests of the same [method under test][4].\n    - Only [test the public methods][5], thus the generated tests are in a separate `_test` package.\n    - Leverage [TestMain][6] to do global setup and teardown.\n    - Prefer [table driven tests][7].\n\n\n## Installation\n\nMake a custom build of [protogo](https://github.com/protogodev/protogo):\n\n```bash\n$ protogo build --plugin=github.com/protogodev/dbtest\n```\n\nOr build from a local fork:\n\n```bash\n$ protogo build --plugin=github.com/protogodev/dbtest=../my-fork\n```\n\n\u003cdetails open\u003e\n  \u003csummary\u003e Usage \u003c/summary\u003e\n\n```bash\n$ protogo dbtest -h\nUsage: protogo dbtest \u003csource-file\u003e \u003cinterface-name\u003e\n\nArguments:\n  \u003csource-file\u003e       source-file\n  \u003cinterface-name\u003e    interface-name\n\nFlags:\n  -h, --help                         Show context-sensitive help.\n\n      --out=STRING                   output filename (default \"./\u003csrcPkgName\u003e_test.go\")\n      --fmt                          whether to make the test code formatted\n      --spec=\"./dbtest.spec.yaml\"    the test specification in YAML\n      --tmpl=STRING                  the template to render (default to builtin template)\n```\n\n\u003c/details\u003e\n\n\n## Examples\n\nSee [examples](examples).\n\n\n## Documentation\n\nCheck out the [Godoc][8].\n\n\n## License\n\n[MIT](LICENSE)\n\n\n[1]: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html\n[2]: https://github.com/go-testfixtures/testfixtures\n[3]: https://en.wikipedia.org/wiki/Test_fixture#Software\n[4]: http://xunitpatterns.com/SUT.html\n[5]: https://martinfowler.com/articles/practical-test-pyramid.html#WhatToTest\n[6]: https://pkg.go.dev/testing#hdr-Main\n[7]: https://github.com/golang/go/wiki/TableDrivenTests\n[8]: https://pkg.go.dev/github.com/protogodev/dbtest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotogodev%2Fdbtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotogodev%2Fdbtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotogodev%2Fdbtest/lists"}