"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[2850],{5548:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>u,frontMatter:()=>a,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"XXTLanControl.lua/tabledb/README","title":"TableDB Overview","description":"LCC.db provides structured storage where every user column is stored as a string and each row has an auto-increment id.","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/tabledb/README.md","sourceDirName":"XXTLanControl.lua/tabledb","slug":"/XXTLanControl.lua/tabledb/","permalink":"/docs/en/XXTLanControl.lua/tabledb/","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":10,"frontMatter":{"sidebar_position":10},"sidebar":"tutorialSidebar","previous":{"title":"Retrieve Queue Length (LCC.kvdb.queue.size)","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/size"},"next":{"title":"Create A Table (LCC.db.create)","permalink":"/docs/en/XXTLanControl.lua/tabledb/create"}}');var o=t(4848),s=t(8453);const a={sidebar_position:10},i="TableDB Overview",l={},d=[{value:"Import the Module",id:"import-the-module",level:2},{value:"Before You Start",id:"before-you-start",level:2}];function c(e){const n={code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"tabledb-overview",children:"TableDB Overview"})}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.code,{children:"LCC.db"})," provides structured storage where every user column is stored as a string and each row has an auto-increment ",(0,o.jsx)(n.code,{children:"id"}),"."]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"create tables, then add, edit, and delete rows in batches"}),"\n",(0,o.jsxs)(n.li,{children:["read rows through ",(0,o.jsx)(n.code,{children:"get"}),", ",(0,o.jsx)(n.code,{children:"list"}),", ",(0,o.jsx)(n.code,{children:"count"}),", and ",(0,o.jsx)(n.code,{children:"fetch_one"})]}),"\n",(0,o.jsxs)(n.li,{children:["use ",(0,o.jsx)(n.code,{children:"fetch_one"})," to claim one row safely under concurrency"]}),"\n",(0,o.jsx)(n.li,{children:"keep using tables that are already maintained in the UI or used by schedules"}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"import-the-module",children:"Import the Module"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-lua",children:'local LCC = require("XXTLanControl")\n'})}),"\n",(0,o.jsx)(n.h2,{id:"before-you-start",children:"Before You Start"}),"\n",(0,o.jsxs)(n.p,{children:["Before using any helper, make sure you either call ",(0,o.jsx)(n.code,{children:"LCC.set_api_url()"})," or start the script from the control center, and always complete initialization with ",(0,o.jsx)(n.code,{children:"LCC.connect()"}),"."]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>i});var r=t(6540);const o={},s=r.createContext(o);function a(e){const n=r.useContext(s);return r.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(o):e.components||o:a(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]);