1 line
5.9 KiB
JavaScript
1 line
5.9 KiB
JavaScript
"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[550],{5428:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>h,contentTitle:()=>i,default:()=>x,frontMatter:()=>d,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"classes/create-table","title":"CreateTable","description":"Creates a new table with a defined structure.","source":"@site/docs/classes/create-table.md","sourceDirName":"classes","slug":"/classes/create-table","permalink":"/awSQL/classes/create-table","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":8,"frontMatter":{"sidebar_position":8},"sidebar":"defaultSidebar","previous":{"title":"Structure","permalink":"/awSQL/classes/structure"},"next":{"title":"AlterTable","permalink":"/awSQL/classes/alter-table"}}');var n=s(4848),c=s(8453);const d={sidebar_position:8},i="CreateTable",h={},l=[{value:"Methods",id:"methods",level:2},{value:"selectDatabase()",id:"selectdatabase",level:3},{value:"name()",id:"name",level:3},{value:"structure()",id:"structure",level:3},{value:"execute()",id:"execute",level:3}];function a(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,c.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"createtable",children:"CreateTable"})}),"\n",(0,n.jsx)(t.p,{children:"Creates a new table with a defined structure."}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h2,{id:"methods",children:"Methods"}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h3,{id:"selectdatabase",children:"selectDatabase()"}),"\n",(0,n.jsxs)(t.p,{children:["\u2192 (",(0,n.jsx)(t.code,{children:"database"})," = ",(0,n.jsx)(t.strong,{children:"String"}),") \u2192 ",(0,n.jsx)(t.code,{children:"this"})]}),"\n",(0,n.jsx)(t.p,{children:"Selects a specific database for the query."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Parameters"})}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"database"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.strong,{children:"String"})}),(0,n.jsx)(t.td,{children:"The name of the database to select."})]})})]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(t.p,{children:["\u2192 ",(0,n.jsx)(t.code,{children:"this"})]}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h3,{id:"name",children:"name()"}),"\n",(0,n.jsxs)(t.p,{children:["\u2192 (",(0,n.jsx)(t.code,{children:"name"})," = ",(0,n.jsx)(t.strong,{children:"String"}),") \u2192 ",(0,n.jsx)(t.code,{children:"this"})]}),"\n",(0,n.jsx)(t.p,{children:"Sets the name of the new table."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Parameters"})}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"name"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.strong,{children:"String"})}),(0,n.jsx)(t.td,{children:"The name of the table."})]})})]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(t.p,{children:["\u2192 ",(0,n.jsx)(t.code,{children:"this"})]}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h3,{id:"structure",children:"structure()"}),"\n",(0,n.jsxs)(t.p,{children:["\u2192 (",(0,n.jsx)(t.code,{children:"structure"})," = ",(0,n.jsx)(t.a,{href:"./structure",children:"Structure"}),") \u2192 ",(0,n.jsx)(t.code,{children:"this"})]}),"\n",(0,n.jsx)(t.p,{children:"Defines the desired structure for the new table."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Parameters"})}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsx)(t.tbody,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"structure"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"./structure",children:"Structure"})}),(0,n.jsx)(t.td,{children:"The structure of the table."})]})})]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(t.p,{children:["\u2192 ",(0,n.jsx)(t.code,{children:"this"})]}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h3,{id:"execute",children:"execute()"}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"async"})," \u2192 () \u2192 ",(0,n.jsx)(t.a,{href:"../typedefs/okpacket",children:"OkPacket"})]}),"\n",(0,n.jsx)(t.p,{children:"Executes the query and creates the table."}),"\n",(0,n.jsx)(t.admonition,{title:"Possible Crash",type:"warning",children:(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.a,{href:"#structure",children:"structure()"})," method ",(0,n.jsx)(t.strong,{children:"must"})," be called before execution."]})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(t.p,{children:["\u2192 ",(0,n.jsx)(t.a,{href:"../typedefs/okpacket",children:"OkPacket"})]}),"\n",(0,n.jsx)(t.hr,{})]})}function x(e={}){const{wrapper:t}={...(0,c.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>d,x:()=>i});var r=s(6540);const n={},c=r.createContext(n);function d(e){const t=r.useContext(c);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:d(e.components),r.createElement(c.Provider,{value:t},e.children)}}}]); |