{"id":21113862,"url":"https://github.com/wux1an/bufinsert","last_synced_at":"2026-04-18T11:02:46.319Z","repository":{"id":144186707,"uuid":"431919458","full_name":"wux1an/bufinsert","owner":"wux1an","description":"An enhancement for gorm bulk insert. This can help you save the data to the buffer first, and then insert the all data in the buffer into the database when the buffer is full.","archived":false,"fork":false,"pushed_at":"2021-11-25T17:09:11.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-08T14:44:45.252Z","etag":null,"topics":["batch-insert","buffer-insert","bulk-insert","database","gorm","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wux1an.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-25T17:00:19.000Z","updated_at":"2021-11-25T17:10:54.000Z","dependencies_parsed_at":"2023-04-24T02:19:50.924Z","dependency_job_id":null,"html_url":"https://github.com/wux1an/bufinsert","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wux1an/bufinsert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wux1an%2Fbufinsert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wux1an%2Fbufinsert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wux1an%2Fbufinsert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wux1an%2Fbufinsert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wux1an","download_url":"https://codeload.github.com/wux1an/bufinsert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wux1an%2Fbufinsert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31966217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["batch-insert","buffer-insert","bulk-insert","database","gorm","sqlite"],"created_at":"2024-11-20T01:59:13.088Z","updated_at":"2026-04-18T11:02:46.298Z","avatar_url":"https://github.com/wux1an.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bufinsert\n\nAn enhancement for [gorm](https://github.com/go-gorm/gorm) bulk insert. This can help you save the data to the buffer\nfirst, and then insert the all data in buffer into database when the buffer is full.\n\n# Install\n\n```bash\ngo get -u github.com/wux1an/bufinsert\n```\n\n# Usage\n\n```golang\npackage bufinsert\n\nimport (\n\t\"gorm.io/gorm\"\n)\n\nfunc ExampleNewInserter() {\n\tvar db = \u0026gorm.DB{} // fake database\n\tvar inserter = NewInserter(db, 2)\n\n\tfor i := 0; i \u003c 11; i++ {\n\t\tgo inserter.Insert(i)\n\t}\n\n\tinserter.Flush() // flush and empty\n}\n\nfunc ExampleBufferedInserter_Insert() {\n\tvar db = \u0026gorm.DB{} // fake database\n\tvar inserter = NewInserter(db, 2)\n\n\t// way 1\n\tinserter.Insert(\"1\") // not flush\n\tinserter.Insert(\"2\") // flush and empty\n\tinserter.Insert(\"3\") // not flush\n\t// way 2\n\tinserter.Insert([]interface{}{\"4\", \"5\", \"6\", \"7\"})\n\n\tinserter.Flush() // flush and empty\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwux1an%2Fbufinsert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwux1an%2Fbufinsert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwux1an%2Fbufinsert/lists"}