{"id":20564528,"url":"https://github.com/tarantool/tarantool-lua","last_synced_at":"2025-04-14T15:13:01.876Z","repository":{"id":10724278,"uuid":"12975958","full_name":"tarantool/tarantool-lua","owner":"tarantool","description":"Tarantool connector for Lua","archived":false,"fork":false,"pushed_at":"2022-11-23T23:28:48.000Z","size":357,"stargazers_count":33,"open_issues_count":1,"forks_count":10,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-04-14T15:12:50.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarantool.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":"2013-09-20T14:48:22.000Z","updated_at":"2025-04-06T09:14:43.000Z","dependencies_parsed_at":"2023-01-11T17:56:08.815Z","dependency_job_id":null,"html_url":"https://github.com/tarantool/tarantool-lua","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Ftarantool-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Ftarantool-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Ftarantool-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Ftarantool-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarantool","download_url":"https://codeload.github.com/tarantool/tarantool-lua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904637,"owners_count":21180835,"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":[],"created_at":"2024-11-16T04:27:30.821Z","updated_at":"2025-04-14T15:13:01.854Z","avatar_url":"https://github.com/tarantool.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"lua-tarantool-client\n===================\n\nDriver for tarantool 1.7 on nginx cosockets and plain lua sockets\n\nIntroduction\n------------\n\nA pure Lua driver for the NoSQL database [Tarantool](http://tarantool.org/) using fast nginx cosockets when available, or [luasocket](https://github.com/diegonehab/luasocket) as a fallback.\n\nRequires [lua-MessagePack](https://github.com/fperrad/lua-MessagePack).\n\nluasock\n-------\n\nFor `luasock` sockets, [lua-resty-socket](https://github.com/thibaultcha/lua-resty-socket) and [sha1.lua](https://github.com/kikito/sha1.lua) are required.\n\nThese can be installed using `luarocks install lua-resty-socket` and `luarocks install sha1`\n\n\nSynopsis\n------------\n\n```lua\n\ntarantool = require(\"tarantool\")\n\n-- initialize connection\nlocal tar = tarantool({\n    host           = '127.0.0.1',\n    port           = 3301,\n    user           = 'gg_tester',\n    password       = 'pass',\n    socket_timeout = 2000,\n    connect_now    = true,\n})\n\n-- requests\nlocal data, err = tar:ping()\nlocal data, err = tar:insert('profiles', { 1, \"nick 1\" })\nlocal data, err = tar:insert('profiles', { 2, \"nick 2\" })\nlocal data, err = tar:select(2, 0, 3)\nlocal data, err = tar:select('profiles', 'uid', 3)\nlocal data, err = tar:replace('profiles', {3, \"nick 33\"})\nlocal data, err = tar:delete('profiles', 3)\nlocal data, err = tar:update('profiles', 'uid', 3, {{ '=', 1, 'nick new' }})\nlocal data, err = tar:update('profiles', 'uid', 3, {{ '#', 1, 1 }})\n\n-- disconnect or set_keepalive at the end\nlocal ok, err = tar:disconnect()\nlocal ok, err = tar:set_keepalive()\n\n```\n\nHacking\n-------\n\nModule contains implementations written in Lua and\n[Moonscript][moonscript-url]. First one could be generated using second one\nusing the Moonscript compiler:\n\n```sh\n$ luarocks --local install moonscript\n$ export PATH=$PATH:$(luarocks path --lr-bin)\n$ moonc -o tarantool.lua tarantool.moon\n```\n\n[moonscript-url]: https://moonscript.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Ftarantool-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarantool%2Ftarantool-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Ftarantool-lua/lists"}