awSQL/docs/docusaurus/build/assets/js/763f4ffe.61cb9f2b.js
2025-03-14 23:49:58 +01:00

1 line
5.7 KiB
JavaScript

"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[550],{5428:(e,s,r)=>{r.r(s),r.d(s,{assets:()=>l,contentTitle:()=>i,default:()=>o,frontMatter:()=>d,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"classes/create-table","title":"CreateTable","description":"Creates a new table with 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=r(4848),c=r(8453);const d={sidebar_position:8},i="CreateTable",l={},h=[{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 s={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)(s.header,{children:(0,n.jsx)(s.h1,{id:"createtable",children:"CreateTable"})}),"\n",(0,n.jsx)(s.p,{children:"Creates a new table with defined structure."}),"\n",(0,n.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,n.jsx)(s.h3,{id:"selectdatabase",children:"selectDatabase()"}),"\n",(0,n.jsxs)(s.p,{children:["\u2192 (",(0,n.jsx)(s.code,{children:"database"})," = ",(0,n.jsx)(s.strong,{children:"String"}),") \u2192 ",(0,n.jsx)(s.code,{children:"this"})]}),"\n",(0,n.jsx)(s.p,{children:"Selects a different database for this query."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Parameter"}),(0,n.jsx)(s.th,{children:"Type"}),(0,n.jsx)(s.th,{children:"Description"})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"database"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.strong,{children:"String"})}),(0,n.jsx)(s.td,{children:"Name of the database to select"})]})})]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(s.p,{children:["\u2192 ",(0,n.jsx)(s.code,{children:"this"})]}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"name",children:"name()"}),"\n",(0,n.jsxs)(s.p,{children:["\u2192 (",(0,n.jsx)(s.code,{children:"name"})," = ",(0,n.jsx)(s.strong,{children:"String"}),") \u2192 ",(0,n.jsx)(s.code,{children:"this"})]}),"\n",(0,n.jsx)(s.p,{children:"Sets the name of the new table."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Parameter"}),(0,n.jsx)(s.th,{children:"Type"}),(0,n.jsx)(s.th,{children:"Description"})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"name"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.strong,{children:"String"})}),(0,n.jsx)(s.td,{children:"Name for the table"})]})})]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(s.p,{children:["\u2192 ",(0,n.jsx)(s.code,{children:"this"})]}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"structure",children:"structure()"}),"\n",(0,n.jsxs)(s.p,{children:["\u2192 (",(0,n.jsx)(s.code,{children:"structure"})," = ",(0,n.jsx)(s.a,{href:"./structure",children:"Structure"}),") \u2192 ",(0,n.jsx)(s.code,{children:"this"})]}),"\n",(0,n.jsx)(s.p,{children:"The desired structure for the table to get."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Parameter"}),(0,n.jsx)(s.th,{children:"Type"}),(0,n.jsx)(s.th,{children:"Description"})]})}),(0,n.jsx)(s.tbody,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"structure"})}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.a,{href:"./structure",children:"Structure"})}),(0,n.jsx)(s.td,{children:"Structure for the table."})]})})]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(s.p,{children:["\u2192 ",(0,n.jsx)(s.code,{children:"this"})]}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.h3,{id:"execute",children:"execute()"}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"async"})," \u2192 () \u2192 ",(0,n.jsx)(s.strong,{children:"any"})]}),"\n",(0,n.jsx)(s.admonition,{title:"Possible crash",type:"warning",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.a,{href:"#structure",children:"structure()"})," must always be given."]})}),"\n",(0,n.jsx)(s.p,{children:"Executes the prepared query."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"Returns"})}),"\n",(0,n.jsxs)(s.p,{children:["\u2192 ",(0,n.jsx)(s.strong,{children:"any"})," - The result of 'CREATE TABLE [...]'-query"]}),"\n",(0,n.jsx)(s.hr,{})]})}function o(e={}){const{wrapper:s}={...(0,c.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},8453:(e,s,r)=>{r.d(s,{R:()=>d,x:()=>i});var t=r(6540);const n={},c=t.createContext(n);function d(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:d(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]);