{"id":17749303,"url":"https://github.com/annybs/ezdb","last_synced_at":"2026-04-24T16:36:58.898Z","repository":{"id":244658143,"uuid":"812192479","full_name":"annybs/ezdb","owner":"annybs","description":"Simple interfaces for working with basic key-value storage in your Go application","archived":false,"fork":false,"pushed_at":"2024-07-11T16:57:53.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2024-09-14T04:39:07.624Z","etag":null,"topics":["database","go","golang"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/annybs/ezdb","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annybs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-06-08T07:42:50.000Z","updated_at":"2024-07-16T06:35:14.000Z","dependencies_parsed_at":"2024-10-26T13:30:10.207Z","dependency_job_id":"dba64f3d-9976-44ff-8fed-efe222f1f1c8","html_url":"https://github.com/annybs/ezdb","commit_stats":null,"previous_names":["annybs/ezdb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/annybs/ezdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annybs%2Fezdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annybs%2Fezdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annybs%2Fezdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annybs%2Fezdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annybs","download_url":"https://codeload.github.com/annybs/ezdb/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annybs%2Fezdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32231177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: 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","go","golang"],"created_at":"2024-10-26T11:22:41.171Z","updated_at":"2026-04-24T16:36:58.884Z","avatar_url":"https://github.com/annybs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EZ DB\n\nThis package provides simple interfaces for working with basic key-value document storage in your Go application.\n\n## System requirements\n\n- [Go v1.21](https://go.dev/dl/)\n\n## Basic usage\n\nThe primary interface in EZ DB is `Collection[T]` which reflects a single key-value store. This is analogous to tables in RDBMS, collections in NoSQL databases etc.\n\nCollections use a generic type `T` to specify the document type. You can use this to enforce a document schema. This example creates a collection which only accepts `Student` documents:\n\n```go\npackage main\n\nimport \"github.com/annybs/ezdb\"\n\ntype Student struct {\n\tName string\n\tAge int\n}\n\nvar db = ezdb.Memory[Student](nil)\n\nfunc main() {\n\tdb.Open()\n\tdb.Put(\"annie\", Student{Name: \"Annie\", Age: \"32\"})\n\tdb.Close()\n}\n```\n\n## Marshaling data\n\nSome database backends require marshaling and unmarshaling data. The `DocumentMarshaler[T1, T2]` interface allows you to use whatever marshaler suits your needs or the requirements of your chosen database.\n\nThe following marshalers are included in EZ DB:\n\n- `JSON[T]` marshals your data `T` to `[]byte` using [encoding/json](https://pkg.go.dev/encoding/json)\n\n## Supported databases\n\nThe following databases are included in EZ DB:\n\n- `LevelDB[T]` is [fast key-value storage](https://github.com/google/leveldb) on disk\n- `Memory[T]` is essentially a wrapper for `map[string]T`. It can be provided another Collection to use as a persistence backend\n\n## Limitations\n\nEZ DB is intended for simple document storage and can work with any addressable data represented as `T` in your Go app.\n\nThis makes it unsuited for working with unaddressable types, such as byte arrays, particularly when a document marshaler is involved.\n\nIf you want more control beyond what EZ DB offers, it's best to just use the appropriate database software and connector for your needs.\n\n## License\n\nSee [LICENSE.md](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannybs%2Fezdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannybs%2Fezdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannybs%2Fezdb/lists"}