{"id":28282770,"url":"https://github.com/devilcove/boltdb","last_synced_at":"2026-02-18T22:00:47.745Z","repository":{"id":213598563,"uuid":"734478545","full_name":"devilcove/boltdb","owner":"devilcove","description":"Generic CRUD abstractions to bbolt (etc.io/bbolt) database","archived":false,"fork":false,"pushed_at":"2025-11-26T22:02:02.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-29T17:27:49.399Z","etag":null,"topics":["bbolt","bolt","boltdb","database","go"],"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/devilcove.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-21T19:35:55.000Z","updated_at":"2025-11-26T22:02:04.000Z","dependencies_parsed_at":"2024-03-22T20:45:23.461Z","dependency_job_id":"9eb5dcda-faf2-4b65-895d-11e389d695b2","html_url":"https://github.com/devilcove/boltdb","commit_stats":null,"previous_names":["devilcove/boltdb"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/devilcove/boltdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilcove%2Fboltdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilcove%2Fboltdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilcove%2Fboltdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilcove%2Fboltdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devilcove","download_url":"https://codeload.github.com/devilcove/boltdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilcove%2Fboltdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"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":["bbolt","bolt","boltdb","database","go"],"created_at":"2025-05-21T15:19:59.215Z","updated_at":"2026-02-18T22:00:47.740Z","avatar_url":"https://github.com/devilcove.png","language":"Go","readme":"boltdb\n-------\n![tests](https://github.com/devilcove/boltdb/actions/workflows/test.yml/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/devilcove/boltdb?style=flat-square)](https://goreportcard.com/report/github.com/devilcove/boltdb)\n[![Go Reference](https://pkg.go.dev/badge/github.com/devilcove/boltdb.svg)](https://pkg.go.dev/github.com/devilcove/boltdb)\n[![Go Coverage](https://raw.githubusercontent.com/wiki/devilcove/boltdb/coverage/coverage.svg)](https://raw.githack.com/wiki/devilcove/boltdb/coverage/coverage.html)\n\nGo module `github.com/devilcove/boltdb` is a generic abstractions layer for basic crud operations on a `go.etcd.io/bbolt` key/value store\n\nInstalling\n----------\nTo start using, install Go and run `go get`:\n````\ngo get github.com/devilcove/boltdb@latest\n````\nFunctions\n---------\n### Initialization\ncall initialize with the path to store and list of tables.  Store and tables will be created if they do not exist.\n````\nimport \"github.com/devilcove/bbolt\"\n\nif err := boltdb.Initialize(path, []string{\"users\", \"networks\"}); err != nil{\n  return err\n}\ndefer boltd.Close()\n````\n### Create/Update\npass the key/value pair along with table name\n#### Save -- save key/value always (overwrite existing or create new)\n#### Insert -- save only iff key does not exist\n#### Update -- save only iff key exists\n````\ncont userTable = \"users\"\n\nuser := models.User {\n  Username: \"admin\",\n  Password: \"encrypted password\",\n  IsAdmin: true,\n}\n\nif err := boltdb.Save(user, user.Username, userTable); err != nil {\n  return err\n}\n````\n \n### Read\nread table names\n````\ntables := boltdb.Tables()\n````\nreturn value of key in table\n````\nuser, err := boltdb.Get[models.User](\"admin\", userTable)\nif err != nil {\n  return err\n}\n````\nretrieve all values from table\n````\nusers, err := boltdb.GetAll[models.User](userTable)\nif err != nil {\n  return err\n}\n````\n### Delete\ndelete value of key in table\n````\nif err := boltdb.Delete[models.User](\"admin\", userTable); err != nil {\n  return err\n}\n````\n#### Advanced Usage\nthe db connection is made available if more advanced queries are needed\n````\nimport (\n  \"encoding/json\"\n  \"errors\"\n\n  \"github.com/devilcove/boltdb\"\n  \"go.etcd.io/bbolt\"\n)\n\nfunc AdminExists() bool {\n\tvar user models.User\n\tvar found bool\n\tdb := boltdb.Connection()\n\tif db == nil {\n\t\treturn found\n\t}\n\tif err := db.View(func(tx *bbolt.Tx) error {\n\t\tb := tx.Bucket([]byte(UserTable))\n\t\tif b == nil {\n\t\t\treturn boltdb.ErrNoResults\n\t\t}\n\t\t_ = b.ForEach(func(k, v []byte) error {\n\t\t\tif err := json.Unmarshal(v, \u0026user); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif user.IsAdmin {\n\t\t\t\tfound = true\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\treturn nil\n\t}); err != nil {\n\t\treturn false\n\t}\n\treturn found\n}\n\n````  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevilcove%2Fboltdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevilcove%2Fboltdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevilcove%2Fboltdb/lists"}