{"id":20041336,"url":"https://github.com/gernest/nutz","last_synced_at":"2025-05-05T08:32:16.705Z","repository":{"id":30245389,"uuid":"33796602","full_name":"gernest/nutz","owner":"gernest","description":"A  cool way to work with bolt database buckets ","archived":false,"fork":false,"pushed_at":"2016-05-19T07:02:51.000Z","size":23,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-08T19:47:48.271Z","etag":null,"topics":["bolt-database","golang","nutz"],"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/gernest.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}},"created_at":"2015-04-11T23:44:11.000Z","updated_at":"2023-10-19T18:31:21.000Z","dependencies_parsed_at":"2022-07-31T08:07:57.493Z","dependency_job_id":null,"html_url":"https://github.com/gernest/nutz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fnutz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fnutz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fnutz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fnutz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gernest","download_url":"https://codeload.github.com/gernest/nutz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252466798,"owners_count":21752436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bolt-database","golang","nutz"],"created_at":"2024-11-13T10:46:17.588Z","updated_at":"2025-05-05T08:32:16.435Z","avatar_url":"https://github.com/gernest.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nutz [![Build Status](https://drone.io/github.com/gernest/nutz/status.png)](https://drone.io/github.com/gernest/nutz/latest) [![GoDoc ](https://godoc.org/github.com/gernest/nutz?status.svg)](https://godoc.org/github.com/gernest/nutz)[![Coverage Status](https://coveralls.io/repos/gernest/nutz/badge.svg)](https://coveralls.io/r/gernest/nutz)\n\nnutz is a library for interacting with bolt databases. It removes the boilerplates and\nstay faithful with the bolt database view of \"simple API\".\n\n## Where is nutz useful\n- [x] You want to maintain more than one database\n- [x] Your project uses nested buckets extensively.\n\n## Installation\n```bash\ngo get github.com/gernest/nutz\n```\n## How to use\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/gernest/nutz\"\n)\n\nfunc main() {\n\tdatabaseName := \"my-databse.db\"\n\n\t// ntz.NewStorage takes the same arguments as *bolt.Open. The differnce is with\n\t// nutz nothing is opened.\n\tdb := nutz.NewStorage(databaseName, 0600, nil)\n\n\t// Creates a new record in the bucket library with key  \"lady morgana\" and\n\t// value []byte(\"A mist of avalon\")\n\tdb.Create(\"library\", \"lady morgana\", []byte(\"A mist of avalon\"))\n\n\t// If you want to create a record which will be deep inside buckets. lets say\n\t// you want to store a record for a teacher. The buckets will be like\n\t// city\u003eschool\u003eclass\u003eteacher.\n\tdb.Create(\"city\", \"john Doe\", []byte(\"scientist\"), \"school\", \"class\", \"teacher\")\n\n\t// Retrieving records from a bolt database.\n\td := db.Get(\"library\", \"lady morgana\")\n\n\tfmt.Println(string(d.Data) == \"A mist of avalon\") //=\u003e true\n\n\t// lets check if there was any error\n\tfmt.Println(d.Error) //=\u003e nil\n\n\t// Retriving nested buckets .\n\tn:=db.Get(\"city\",\"john Doe\",\"school\",\"class\",\"teacher\")\n\n\tfmt.Println(string(n.Data)==\"scientist\") //=\u003e true\n\n\t// Lets delete the database\n\tdb.DeleteDatabase()\n\n}\n\n```\n\n# Contributing\n\nStart with clicking the star button to make the author and his neighbors happy. Then fork it and submit a pull request for whatever change you want to be added to this project.\n\nOr, open an issue for any questions.\n\n# Author\nGeofrey Ernest \u003cgeofreyernest@live.com\u003e\n\nTwitter  : [@gernesti](https://twitter.com/gernesti)\n\n\n## License\n\nThis project is under the MIT License. See the [LICENSE](https://github.com/gernest/nutz/blob/master/LICENCE) file for the full license text.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgernest%2Fnutz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgernest%2Fnutz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgernest%2Fnutz/lists"}