"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[9617],{7766:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>u,frontMatter:()=>a,metadata:()=>t,toc:()=>i});const t=JSON.parse('{"id":"XXTLanControl.lua/tabledb/del","title":"Batch Delete Rows (LCC.db.del)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/tabledb/del.md","sourceDirName":"XXTLanControl.lua/tabledb","slug":"/XXTLanControl.lua/tabledb/del","permalink":"/docs/en/XXTLanControl.lua/tabledb/del","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":40,"frontMatter":{"sidebar_position":40},"sidebar":"tutorialSidebar","previous":{"title":"Batch Insert Rows (LCC.db.add)","permalink":"/docs/en/XXTLanControl.lua/tabledb/add"},"next":{"title":"Batch Update Rows (LCC.db.edit)","permalink":"/docs/en/XXTLanControl.lua/tabledb/edit"}}');var l=r(4848),s=r(8453);const a={sidebar_position:40},d="Batch Delete Rows (LCC.db.del)",o={},i=[{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 c(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsx)(n.h1,{id:"batch-delete-rows-lccdbdel",children:"Batch Delete Rows (LCC.db.del)"})}),"\n",(0,l.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"rows, err = LCC.db.del(name, id_rows, timeout?)\n"})}),"\n",(0,l.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["name",(0,l.jsx)(n.br,{}),"\n","String. Table name. Must be non-empty and no longer than 256 bytes."]}),"\n",(0,l.jsxs)(n.li,{children:["id_rows",(0,l.jsx)(n.br,{}),"\n","Table. Array of objects containing ",(0,l.jsx)(n.code,{children:"id"}),", or a plain array of ",(0,l.jsx)(n.code,{children:"id"})," values. Every ",(0,l.jsx)(n.code,{children:"id"})," must be an integer value greater than or equal to ",(0,l.jsx)(n.code,{children:"1"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:["timeout",(0,l.jsx)(n.br,{}),"\n","Number, optional. Request timeout in seconds, default ",(0,l.jsx)(n.code,{children:"60"}),"."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["rows",(0,l.jsx)(n.br,{}),"\n","Table. Rows deleted from the table; ",(0,l.jsx)(n.code,{children:"nil"})," on failure."]}),"\n",(0,l.jsxs)(n.li,{children:["err",(0,l.jsx)(n.br,{}),"\n","String or ",(0,l.jsx)(n.code,{children:"nil"}),". Error message such as ",(0,l.jsx)(n.code,{children:"'unknown table'"}),"."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsxs)(n.p,{children:["Removes rows by ",(0,l.jsx)(n.code,{children:"id"})," and returns the original data for auditing.",(0,l.jsx)(n.br,{}),"\n","Each array element can be a plain numeric ",(0,l.jsx)(n.code,{children:"id"})," or an object containing ",(0,l.jsx)(n.code,{children:"id"}),"; for objects only the ",(0,l.jsx)(n.code,{children:"id"})," field is used.\nAn item whose ",(0,l.jsx)(n.code,{children:"id"})," is not an integer value greater than or equal to ",(0,l.jsx)(n.code,{children:"1"})," triggers a Lua parameter validation error."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:'local removed, err = LCC.db.del("tasks", { {id = 10}, 11, 12 })\nif removed then\n    LCC.log(1, "Deleted rows", #removed)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(c,{...e})}):c(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>d});var t=r(6540);const l={},s=t.createContext(l);function a(e){const n=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]);