"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[3344],{4757:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>u,frontMatter:()=>s,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"XXTLanControl.lua/kvdb/dict/get_all","title":"Fetch Entire Dictionary (LCC.kvdb.dict.get_all)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/kvdb/dict/get_all.md","sourceDirName":"XXTLanControl.lua/kvdb/dict","slug":"/XXTLanControl.lua/kvdb/dict/get_all","permalink":"/docs/en/XXTLanControl.lua/kvdb/dict/get_all","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":70,"frontMatter":{"sidebar_position":70},"sidebar":"tutorialSidebar","previous":{"title":"Read A Key (LCC.kvdb.dict.get)","permalink":"/docs/en/XXTLanControl.lua/kvdb/dict/get"},"next":{"title":"Delete A Key (LCC.kvdb.dict.delete)","permalink":"/docs/en/XXTLanControl.lua/kvdb/dict/delete"}}');var i=t(4848),l=t(8453);const s={sidebar_position:70},a="Fetch Entire Dictionary (LCC.kvdb.dict.get_all)",d={},c=[{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",level:2}];function o(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"fetch-entire-dictionary-lcckvdbdictget_all",children:"Fetch Entire Dictionary (LCC.kvdb.dict.get_all)"})}),"\n",(0,i.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"values, err = LCC.kvdb.dict.get_all(name, timeout?)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["name",(0,i.jsx)(n.br,{}),"\n","String. Dictionary name (non-empty, max ",(0,i.jsx)(n.code,{children:"256"})," bytes)."]}),"\n",(0,i.jsxs)(n.li,{children:["timeout",(0,i.jsx)(n.br,{}),"\n","Number, optional. Request timeout in seconds, default ",(0,i.jsx)(n.code,{children:"60"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["values",(0,i.jsx)(n.br,{}),"\n","Table. Mapping ",(0,i.jsx)(n.code,{children:"{ key = value }"}),"; returns an empty table when the dictionary is empty, or ",(0,i.jsx)(n.code,{children:"nil"})," on failure."]}),"\n",(0,i.jsxs)(n.li,{children:["err",(0,i.jsx)(n.br,{}),"\n","String or ",(0,i.jsx)(n.code,{children:"nil"}),". Error description when the call fails."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:["Returns a full snapshot of the dictionary as a key/value table.",(0,i.jsx)(n.br,{}),"\n","An empty dictionary returns an empty table, not ",(0,i.jsx)(n.code,{children:"nil"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local dict, err = LCC.kvdb.dict.get_all("settings")\nif dict then\n    for k, v in pairs(dict) do\n        print(k, v)\n    end\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var r=t(6540);const i={},l=r.createContext(i);function s(e){const n=r.useContext(l);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),r.createElement(l.Provider,{value:n},e.children)}}}]);