{"id":13714308,"url":"https://github.com/nanohard/scribble","last_synced_at":"2026-01-17T00:57:40.733Z","repository":{"id":94979392,"uuid":"188903939","full_name":"nanohard/scribble","owner":"nanohard","description":"Multi-file database, using codecs. Based on github.com/nanobox-io/golang-scribble. Apache-2.0 license.","archived":false,"fork":false,"pushed_at":"2020-06-06T15:29:09.000Z","size":31,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-03T23:30:18.876Z","etag":null,"topics":["binary","database","flat-file","go","golang","json"],"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/nanohard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-05-27T20:15:45.000Z","updated_at":"2024-04-05T10:09:23.000Z","dependencies_parsed_at":"2023-03-24T08:31:57.613Z","dependency_job_id":null,"html_url":"https://github.com/nanohard/scribble","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanohard%2Fscribble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanohard%2Fscribble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanohard%2Fscribble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanohard%2Fscribble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanohard","download_url":"https://codeload.github.com/nanohard/scribble/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224551221,"owners_count":17330103,"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":["binary","database","flat-file","go","golang","json"],"created_at":"2024-08-02T23:01:56.703Z","updated_at":"2026-01-17T00:57:40.715Z","avatar_url":"https://github.com/nanohard.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# Scribble\n[![GoDoc](https://godoc.org/github.com/boltdb/bolt?status.svg)](http://godoc.org/github.com/nanohard/scribble) [![Go Report Card](https://goreportcard.com/badge/github.com/nanohard/scribble)](https://goreportcard.com/report/github.com/nanohard/scribble)\n--------\n\nFlat-file database in Golang using choosable encoders.\n\nCurrently supports:\n- JSON\n- Binary\n\n### Installation\n\nInstall using `go get github.com/nanohard/scribble`.\n\n### Usage\nUnless you have a need to use JSON, it is recommended to use the default Binary for reduced file \nsize.\n\n#### Initialize Database\n```go\nimport(\n    \"github.com/nanohard/scribble\"\n\n    // Needed for Unmarshaling when using db.ReadAll()\n    \"github.com/nanohard/scribble/codec/json\"\n    // Or\n    \"github.com/nanohard/scribble/codec/binary\"\n)\n\n// A new scribble driver, providing the directory where it will be writing to,\n// and a qualified logger if desired.\n// Defaults to using encoding/binary (well, really kelindar/binary)\ndb, err := scribble.New(dir, nil) // `binary.Codec` is used by default\nif err != nil {\n    fmt.Println(\"Error\", err)\n}\n\n// Or\n\noptions := scribble.Options{\n    Codec: json.Codec,  // `binary.Codec` is used by default\n}\ndb, err := scribble.New(dir, options)\nif err != nil {\n    fmt.Println(\"Error\", err)\n}\n```\n\n#### DB Functions\n```go\n// Write a fish to the database\nfish := Fish{}\nif err := db.Write(\"fish\", \"onefish\", fish); err != nil {\n    fmt.Println(\"Error\", err)\n}\n\n// Read a fish from the database (passing fish by reference)\nonefish := Fish{}\nif err := db.Read(\"fish\", \"onefish\", \u0026onefish); err != nil {\n    fmt.Println(\"Error\", err)\n}\n\n// Read all fish from the database, unmarshaling the response.\nrecords, err := db.ReadAll(\"fish\")\nif err != nil {\n    fmt.Println(\"Error\", err)\n}\n\nfishies := []Fish{}\nfor _, f := range records {\n    fishFound := Fish{}\n    // binary.Codec.Unmarshal or json.Codec.Unmarshal\n    if err := json.Codec.Unmarshal([]byte(f), \u0026fishFound); err != nil {\n        fmt.Println(\"Error\", err)\n    }\n    fishies = append(fishies, fishFound)\n}\n\n// Delete a fish from the database\nif err := db.Delete(\"fish\", \"onefish\"); err != nil {\n    fmt.Println(\"Error\", err)\n}\n\n// Delete all fish from the database\nif err := db.Delete(\"fish\", \"\"); err != nil {\n    fmt.Println(\"Error\", err)\n}\n```\n\n## Documentation\n- Complete documentation is available on [godoc](http://godoc.org/github.com/nanohard/scribble).\n\n## Todo/Doing\n- More encoders?\n\n## Contributing\n- Rebase into one commit.\n- Have liberal code comments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanohard%2Fscribble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanohard%2Fscribble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanohard%2Fscribble/lists"}