{"id":15676437,"url":"https://github.com/ije/postdb","last_synced_at":"2025-05-07T20:08:41.746Z","repository":{"id":41905342,"uuid":"277298776","full_name":"ije/postdb","owner":"ije","description":"A database to store your posts in golang with bbolt, noSQL.","archived":false,"fork":false,"pushed_at":"2023-11-13T11:25:55.000Z","size":116,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T20:08:20.183Z","etag":null,"topics":["boltdb","golang","postdb"],"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/ije.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}},"created_at":"2020-07-05T12:35:13.000Z","updated_at":"2024-06-07T23:53:47.000Z","dependencies_parsed_at":"2024-06-20T23:40:08.245Z","dependency_job_id":null,"html_url":"https://github.com/ije/postdb","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ije%2Fpostdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ije%2Fpostdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ije%2Fpostdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ije%2Fpostdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ije","download_url":"https://codeload.github.com/ije/postdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949270,"owners_count":21830151,"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":["boltdb","golang","postdb"],"created_at":"2024-10-03T16:01:55.471Z","updated_at":"2025-05-07T20:08:41.692Z","avatar_url":"https://github.com/ije.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostDB\n\n[![GoDoc](https://godoc.org/github.com/ije/postdb?status.svg)](https://godoc.org/github.com/ije/postdb)\n[![GoReport](https://goreportcard.com/badge/github.com/ije/postdb)](https://goreportcard.com/report/github.com/ije/postdb)\n[![MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)\n\nA database to store posts in [Go](https://golang.org) with [BoltDB](https://github.com/etcd-io/bbolt), noSQL.\n\n## Installation\n```bash\ngo get github.com/ije/postdb\n```\n\n## Usage\n\n```go\nimport (\n\t\"github.com/ije/postdb\"\n\t\"github.com/ije/postdb/q\"\n)\n\n// opening a database\ndb, err := postdb.Open(\"post.db\", 0666, false)\nif err != nil {\n    return err\n}\ndefer db.Close()\n\n// get all posts in the database\ndb.List()\n\n// get posts with query\ndb.List(q.Tags(\"foo\", \"bar\"), q.Range(1, 100), q.Order(q.DESC), q.Select(\"title\", \"date\", \"content\"))\n\n// get post without kv\ndb.Get(q.ID(id))\n\n// get post with specified kv\ndb.Get(q.ID(id), q.Select(\"title\", \"date\"))\n\n// get post with prefixed kv\ndb.Get(q.ID(id), q.Select(\"title_*\")) // match key in title_en,title_zh...\n\n// get post with full kv\ndb.Get(q.ID(id), q.Select(\"*\"))\n\n// add a new post\ndb.Put(q.Alias(name), q.Status(1), q.Tags(\"foo\", \"bar\"), q.KV{\"foo\": []byte(\"bar\")})\n\n// update the existing post\ndb.Update(q.ID(id), q.KV{\"foo\": []byte(\"cool\")})\n\n// delete the existing kv of the post\ndb.DeleteKV(q.ID(id), q.Select(\"foo\"))\n\n// delete the existing posts\ndb.Delete(q.ID(id))\n\n// using namespace\nns := db.Namespace(\"name\")\nns.List()\nns.Get(q.ID(id))\n...\n\n// backup the entire database\ndb.WriteTo(w)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fije%2Fpostdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fije%2Fpostdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fije%2Fpostdb/lists"}