"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[5649],{7030:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>c});const l=JSON.parse('{"id":"XXTLanControl.lua/tabledb/get","title":"\u6309 ID \u83b7\u53d6\u5355\u884c (LCC.db.get)","description":"\u58f0\u660e","source":"@site/docs/XXTLanControl.lua/tabledb/get.md","sourceDirName":"XXTLanControl.lua/tabledb","slug":"/XXTLanControl.lua/tabledb/get","permalink":"/docs/XXTLanControl.lua/tabledb/get","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":90,"frontMatter":{"sidebar_position":90},"sidebar":"tutorialSidebar","previous":{"title":"\u539f\u5b50\u83b7\u53d6\u5e76\u66f4\u65b0\u4e00\u884c (LCC.db.fetch_one)","permalink":"/docs/XXTLanControl.lua/tabledb/fetch_one"}}');var t=r(4848),d=r(8453);const s={sidebar_position:90},i="\u6309 ID \u83b7\u53d6\u5355\u884c (LCC.db.get)",o={},c=[{value:"\u58f0\u660e",id:"\u58f0\u660e",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2},{value:"\u8fd4\u56de\u503c",id:"\u8fd4\u56de\u503c",level:2},{value:"\u8bf4\u660e",id:"\u8bf4\u660e",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function a(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,d.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"\u6309-id-\u83b7\u53d6\u5355\u884c-lccdbget",children:"\u6309 ID \u83b7\u53d6\u5355\u884c (LCC.db.get)"})}),"\n",(0,t.jsx)(n.h2,{id:"\u58f0\u660e",children:"\u58f0\u660e"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"row, err = LCC.db.get(name, id, timeout?)\n"})}),"\n",(0,t.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["name",(0,t.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c\u8868\u540d\u79f0\uff0c\u5fc5\u987b\u975e\u7a7a\u4e14\u4e0d\u8d85\u8fc7 256 \u5b57\u8282"]}),"\n",(0,t.jsxs)(n.li,{children:["id",(0,t.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u8981\u67e5\u8be2\u7684\u884c ",(0,t.jsx)(n.code,{children:"id"}),"\uff0c\u5fc5\u987b\u662f\u5927\u4e8e\u7b49\u4e8e 1 \u7684\u6574\u6570\u503c"]}),"\n",(0,t.jsxs)(n.li,{children:["timeout",(0,t.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u53ef\u9009\uff1b\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09\uff0c\u9ed8\u8ba4 ",(0,t.jsx)(n.code,{children:"60"})]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u8fd4\u56de\u503c",children:"\u8fd4\u56de\u503c"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["row",(0,t.jsx)(n.br,{}),"\n","\u8868\u7c7b\u578b\uff0c\u5bf9\u5e94 ",(0,t.jsx)(n.code,{children:"id"})," \u7684\u884c\u5bf9\u8c61\uff1b\u672a\u627e\u5230\u65f6\u4e3a ",(0,t.jsx)(n.code,{children:"nil"})]}),"\n",(0,t.jsxs)(n.li,{children:["err",(0,t.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\u6216 ",(0,t.jsx)(n.code,{children:"nil"}),"\uff0c\u672a\u627e\u5230\u65f6\u8fd4\u56de ",(0,t.jsx)(n.code,{children:"'not found'"}),"\uff0c\u8868\u4e0d\u5b58\u5728\u65f6\u8fd4\u56de ",(0,t.jsx)(n.code,{children:"'unknown table'"})]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u8bf4\u660e",children:"\u8bf4\u660e"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["\u6309 ",(0,t.jsx)(n.code,{children:"id"})," \u83b7\u53d6\u5355\u884c\u6570\u636e\uff0c\u5e38\u7528\u4e8e\u7f16\u8f91\u8868\u5355\u56de\u586b\u3002",(0,t.jsx)(n.br,{}),"\n","\u8fd4\u56de\u5bf9\u8c61\u4e2d\u7684\u7528\u6237\u5217\u4e3a\u5b57\u7b26\u4e32\uff0c",(0,t.jsx)(n.code,{children:"id"})," \u4e3a\u6570\u503c\u3002",(0,t.jsx)(n.br,{}),"\n",(0,t.jsx)(n.code,{children:"id"})," \u4e0d\u662f\u5927\u4e8e\u7b49\u4e8e 1 \u7684\u6574\u6570\u503c\u65f6\uff0c\u4f1a\u89e6\u53d1 Lua \u53c2\u6570\u6821\u9a8c\u9519\u8bef\u3002"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local row, err = LCC.db.get("\u4efb\u52a1\u8868", 42)\nif row then\n    print("\u4efb\u52a1\u8be6\u60c5", row.\u540d\u79f0, row.\u72b6\u6001)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>i});var l=r(6540);const t={},d=l.createContext(t);function s(e){const n=l.useContext(d);return l.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),l.createElement(d.Provider,{value:n},e.children)}}}]);