{"id":37140696,"url":"https://github.com/freerware/work","last_synced_at":"2026-01-14T16:29:22.975Z","repository":{"id":46091387,"uuid":"182435732","full_name":"freerware/work","owner":"freerware","description":"A compact library for tracking and committing changes to your entities.","archived":false,"fork":false,"pushed_at":"2025-01-18T19:10:12.000Z","size":344,"stargazers_count":60,"open_issues_count":13,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-18T19:31:38.448Z","etag":null,"topics":["database","design-pattern","design-patterns","designpattern","designpatterns","go","golang","martin-fowler","resiliency","transactions","unit-of-work","unitofwork"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freerware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-04-20T17:34:31.000Z","updated_at":"2025-01-01T23:32:36.000Z","dependencies_parsed_at":"2023-10-14T22:09:39.445Z","dependency_job_id":"a53df25d-026b-43cd-8d3a-5ae08e57c270","html_url":"https://github.com/freerware/work","commit_stats":null,"previous_names":["freerware/work-it"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/freerware/work","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerware%2Fwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerware%2Fwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerware%2Fwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerware%2Fwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freerware","download_url":"https://codeload.github.com/freerware/work/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freerware%2Fwork/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"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":["database","design-pattern","design-patterns","designpattern","designpatterns","go","golang","martin-fowler","resiliency","transactions","unit-of-work","unitofwork"],"created_at":"2026-01-14T16:29:22.424Z","updated_at":"2026-01-14T16:29:22.969Z","avatar_url":"https://github.com/freerware.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/5921929/73911149-1dad9280-4866-11ea-8818-fed1cd49e8b1.png\" width=\"360\"\u003e\u003c/p\u003e\n\n# work\n\u003e A compact library for tracking and committing atomic changes to your entities.\n\n[![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci]\n[![Coverage Status][coverage-img]][coverage] [![Release][release-img]][release]\n[![License][license-img]][license] [![Blog][blog-img]][blog]\n\n## What is it?\n\n`work` does the heavy lifting of tracking changes that your application makes\nto entities within a particular operation. This is accomplished by using what we\nrefer to as a \"work unit\", which is essentially an implementation of the\n[Unit Of Work][uow] pattern popularized by Martin Fowler. With work units,\nyou no longer need to write any code to track, apply, or rollback changes\natomically in your application. This lets you focus on just writing the code\nthat handles changes when they happen.\n\n## Why use it?\n\n- easier management of changes to your entities.\n- automatic rollback of changes when chaos ensues.\n- centralization of save and rollback functionality.\n- reduced overhead when applying changes.\n- decoupling of code triggering changes from code that persists the changes.\n- production-ready logs and metrics.\n- works with your existing persistence layer.\n- automatic and configurable retries.\n\nFor SQL datastores, also enjoy:\n\n- one transaction, one connection per unit.\n- consolidates persistence operations into three operations, regardless of\n  the amount of entity changes.\n- shorter transaction times.\n  - transaction is opened only once the unit is ready to be saved.\n  - transaction only remains open as long as it takes for the unit to be saved.\n- proper threading of `context.Context` with `database/sql`.\n\n## Getting Started\n\nReady to get moving? Head over to the [Getting Started][getting-started] page in the wiki.\n\n## Release information\n\n| Version | Supported |\n|---------|-----------|\n| `V4`    |  ✅       |\n| `V3`    |  ✅       |\n| `V2`    |  ❌       |\n| `V1`    |  ❌       |\n\n\u003e Versions `1.x.x` and `2.x.x` are no longer supported. Please upgrade to\nat least `3.x.x+` to receive the latest and greatest features!\n\n## Dependancy Information\n\nAs of [`v3.0.0`][modules-release], the project utilizes [modules][modules-doc].\nPrior to `v3.0.0`, the project utilized [`dep`][dep] for dependency management.\n\nIn order to transition to modules gracefully, we adhered to the\n[best practice recommendations][modules-wiki] authored by the Golang team.\n\n## Contribute\n\nWant to lend us a hand? Check out our guidelines for\n[contributing][contributing].\n\n## License\n\nWe are rocking an [Apache 2.0 license][apache-license] for this project.\n\n## Code of Conduct\n\nPlease check out our [code of conduct][code-of-conduct] to get up to speed\nhow we do things.\n\n[uow]: https://martinfowler.com/eaaCatalog/unitOfWork.html\n[modules-doc]: https://golang.org/doc/go1.11#modules\n[modules-wiki]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher\n[modules-release]: https://github.com/freerware/work/releases/tag/v3.0.0\n[dep]: https://golang.github.io/dep/\n[contributing]: https://github.com/freerware/work/blob/master/CONTRIBUTING.md\n[apache-license]: https://github.com/freerware/work/blob/master/LICENSE.txt\n[code-of-conduct]: https://github.com/freerware/work/blob/master/CODE_OF_CONDUCT.md\n[concurrency-pr]: https://github.com/freerware/work/pull/35\n[actions-pr]: https://github.com/freerware/work/pull/30\n[doc-img]: https://pkg.go.dev/badge/github.com/freerware/work/v4.svg\n[doc]: https://pkg.go.dev/github.com/freerware/work/v4\n[ci-img]: https://github.com/freerware/work/actions/workflows/ci.yaml/badge.svg?branch=master\n[ci]: https://github.com/freerware/work/actions/workflows/ci.yaml\n[coverage-img]: https://codecov.io/gh/freerware/work/branch/master/graph/badge.svg?token=W5YH9TPP3C\n[coverage]: https://codecov.io/gh/freerware/work\n[license]: https://opensource.org/licenses/Apache-2.0\n[license-img]: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n[release]: https://github.com/freerware/work/releases\n[release-img]: https://img.shields.io/github/tag/freerware/work.svg?label=version\n[blog]: https://medium.com/@freerjm/work-units-ec2da48cf574\n[blog-img]: https://img.shields.io/badge/blog-medium-lightgrey\n[v4-docs]: https://github.com/freerware/work/blob/master/v4/README.md\n[tags]: https://github.com/freerware/work/tags\n[dependabot-alerts]: https://github.com/freerware/work/security/dependabot?q=is%3Aclosed\n[getting-started]: https://github.com/freerware/work/wiki/Getting-Started\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreerware%2Fwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreerware%2Fwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreerware%2Fwork/lists"}