{"id":19475379,"url":"https://github.com/erdian718/lmodbolt","last_synced_at":"2026-05-06T09:43:11.321Z","repository":{"id":57502770,"uuid":"188523595","full_name":"erdian718/lmodbolt","owner":"erdian718","description":"boltdb/bolt bindings for Lua.","archived":false,"fork":false,"pushed_at":"2019-05-26T04:58:31.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T06:31:53.077Z","etag":null,"topics":["bolt","boltdb","database","db","go","lua"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erdian718.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":"2019-05-25T05:13:45.000Z","updated_at":"2019-05-26T04:58:33.000Z","dependencies_parsed_at":"2022-09-02T01:51:41.275Z","dependency_job_id":null,"html_url":"https://github.com/erdian718/lmodbolt","commit_stats":null,"previous_names":["ofunc/lmodbolt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdian718%2Flmodbolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdian718%2Flmodbolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdian718%2Flmodbolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdian718%2Flmodbolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erdian718","download_url":"https://codeload.github.com/erdian718/lmodbolt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240699024,"owners_count":19843508,"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","boltdb","database","db","go","lua"],"created_at":"2024-11-10T19:32:18.754Z","updated_at":"2026-05-06T09:43:11.292Z","avatar_url":"https://github.com/erdian718.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lmodbolt\n\n[boltdb/bolt](https://github.com/boltdb/bolt) bindings for [Lua](https://github.com/ofunc/lua).\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"ofunc/lmodbolt\"\n\t\"ofunc/lua/util\"\n)\n\nfunc main() {\n\tl := util.NewState()\n\tl.Preload(\"bolt\", lmodbolt.Open)\n\tutil.Run(l, \"main.lua\")\n}\n```\n\n```lua\nlocal bolt = require 'bolt'\n\nlocal db = bolt.open('test.db')\ndb:update(function(tx)\n\tlocal demo = tx:bucket('demo')\n\tdemo:set('foo', {\n\t\tid = 123;\n\t\tname = 'test';\n\t\tvalid = true;\n\t})\n\n\tlocal foo = tx:bucket('demo'):get('foo')\n\tprint(foo.id, foo.name, foo.valid)\nend)\ndb:close()\n```\n\n## Dependencies\n\n* [ofunc/lua](https://github.com/ofunc/lua)\n* [ofunc/lmodmsgpack](https://github.com/ofunc/lmodmsgpack)\n* [boltdb/bolt](https://github.com/boltdb/bolt)\n\n## Documentation\n\n### bolt.open(path)\n\nCreates and opens a database at the given `path`.\nIf the file does not exist then it will be created automatically.\n\n### db:close()\n\nReleases all database resources.\nAll transactions must be closed before closing the database.\n\n### db:view(f)\n\nExecutes the function `f` within the context of a managed read-only transaction.\nAny error in function `f` is returned from the `view` method.\n\n### db:update(f)\n\nExecutes the function `f` within the context of a read-write managed transaction.\nIf no error in the function `f` then the transaction is committed.\nOtherwise the entire transaction is rolled back.\nAny error in function `f` is returned from the `update` method.\n\n### tx:writeto(w)\n\nWrites the entire database to a writer.\n\n### c:bucket(key)\n\nRetrieves a nested bucket by `key`.\nIf the bucket does not exist then it will be created automatically.\n`c` is a tx or a bucket.\n\n### c:buckets([key])\n\nReturns an iterator that can traverse over all key/bucket pairs (start from `key`) in a bucket in sorted order.\n`c` is a tx or a bucket.\n\n### c:delbucket(key)\n\nDeletes a bucket at the given `key`.\n`c` is a tx or a bucket.\n\n### bucket:get(key)\n\nRetrieves the value for a `key` in the bucket.\n\n### bucket:set(key, value)\n\nSets the `value` for the `key` in the bucket.\nIf the `key` exist then it's previous `value` will be overwritten.\n\n### bucket:pairs([key])\n\nReturns an iterator that can traverse over all key/value pairs (start from `key`) in a bucket in sorted order.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdian718%2Flmodbolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferdian718%2Flmodbolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdian718%2Flmodbolt/lists"}