{"id":17175516,"url":"https://github.com/kanrichan/tinydb","last_synced_at":"2025-04-13T16:31:04.764Z","repository":{"id":44088606,"uuid":"422881118","full_name":"kanrichan/tinydb","owner":"kanrichan","description":"TinyDB is a lightweight document oriented database optimized for your happiness :)","archived":false,"fork":false,"pushed_at":"2023-10-19T04:19:53.000Z","size":35,"stargazers_count":44,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T07:36:00.585Z","etag":null,"topics":["database","golang","json","nosql"],"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/kanrichan.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}},"created_at":"2021-10-30T12:56:05.000Z","updated_at":"2025-01-06T22:52:55.000Z","dependencies_parsed_at":"2023-02-15T20:45:51.028Z","dependency_job_id":null,"html_url":"https://github.com/kanrichan/tinydb","commit_stats":null,"previous_names":["yiwen-chan/tinydb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanrichan%2Ftinydb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanrichan%2Ftinydb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanrichan%2Ftinydb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanrichan%2Ftinydb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanrichan","download_url":"https://codeload.github.com/kanrichan/tinydb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248743724,"owners_count":21154726,"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":["database","golang","json","nosql"],"created_at":"2024-10-14T23:56:50.654Z","updated_at":"2025-04-13T16:31:04.292Z","avatar_url":"https://github.com/kanrichan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tinydb\n\n### Introduction\n\n[TinyDB](https://github.com/msiemens/tinydb) is a lightweight document oriented database optimized for your happiness :) The target are small apps that would be blown away by a SQL-DB or an external database server.\n\nBut in this project, it's written in pure Golang and has no external dependencies. \n\n### Example Code\n\nImport\n```Go\nimport tiny \"github.com/Yiwen-Chan/tinydb\"\n```\n\nNew a storage\n```Go\nstorage, err := tiny.JSONStorage(\"test.json\")\n```\n\nOpen a database used by storage\n```Go\ndatabase, err := tiny.TinyDB(storage)\ndefer database.Close()\n```\n\nGet a table and Insert or Delete or Update or Select\n```Go\ntable := tiny.GetTable[student](database)\ntable.Insert(student{001, \"test\"})\ntable.Update(func(s student) student { s.ID = 002; return s }, func(s student) bool { return true })\ntable.Select(func(s student) bool { return true })\ntable.Delete(func(s student) bool { return true })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanrichan%2Ftinydb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanrichan%2Ftinydb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanrichan%2Ftinydb/lists"}