awSQL/docs/docusaurus/build/assets/js/3ee20894.1f6e2c20.js
2025-04-13 14:28:04 +02:00

1 line
5.9 KiB
JavaScript

"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[129],{5016:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>i,contentTitle:()=>c,default:()=>u,frontMatter:()=>d,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"typedefs/column-structure","title":"ColumnStructure","description":"Type: Object","source":"@site/docs/typedefs/column-structure.md","sourceDirName":"typedefs","slug":"/typedefs/column-structure","permalink":"/awSQL/typedefs/column-structure","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"OkPacket","permalink":"/awSQL/typedefs/okpacket"},"next":{"title":"ConstraintOptions","permalink":"/awSQL/typedefs/constraint-options"}}');var t=r(4848),l=r(8453);const d={sidebar_position:2},c="ColumnStructure",i={},h=[{value:"Example structure",id:"example-structure",level:2},{value:"Properties",id:"properties",level:2},{value:".Field",id:"field",level:3},{value:".Type",id:"type",level:3},{value:".Null",id:"null",level:3},{value:".Key",id:"key",level:3},{value:".Default",id:"default",level:3},{value:".Extra",id:"extra",level:3}];function o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"columnstructure",children:"ColumnStructure"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Type:"})," ",(0,t.jsx)(n.code,{children:"Object"})]}),"\n",(0,t.jsxs)(n.p,{children:["Represents a single column object used by ",(0,t.jsx)(n.a,{href:"../classes/structure",children:"Structure"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"example-structure",children:"Example structure"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\r\n Field: "Column name",\r\n Type: "Column type",\r\n Null: "YES",\r\n Key: "PRI",\r\n Default: "Some default value",\r\n Extra: ""\r\n}\n'})}),"\n",(0,t.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,t.jsx)(n.h3,{id:"field",children:".Field"}),"\n",(0,t.jsxs)(n.p,{children:["\u2192 ",(0,t.jsx)(n.strong,{children:"String"})]}),"\n",(0,t.jsx)(n.p,{children:"The column name."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"type",children:".Type"}),"\n",(0,t.jsxs)(n.p,{children:["\u2192 ",(0,t.jsx)(n.strong,{children:"String"})]}),"\n",(0,t.jsxs)(n.p,{children:["The column type (e.g., ",(0,t.jsx)(n.code,{children:"VARCHAR(255)"}),", ",(0,t.jsx)(n.code,{children:"INT"}),", ",(0,t.jsx)(n.code,{children:"TEXT"}),")."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"null",children:".Null"}),"\n",(0,t.jsxs)(n.p,{children:["\u2192 ",(0,t.jsx)(n.strong,{children:"Enum"})," \u2192 ",(0,t.jsx)(n.code,{children:"YES"}),"/",(0,t.jsx)(n.code,{children:"NO"})]}),"\n",(0,t.jsxs)(n.p,{children:["Specifies whether the column allows ",(0,t.jsx)(n.code,{children:"NULL"})," values."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"key",children:".Key"}),"\n",(0,t.jsxs)(n.p,{children:["\u2192 ",(0,t.jsx)(n.strong,{children:"Enum"})," \u2192 ",(0,t.jsx)(n.code,{children:" "}),"/",(0,t.jsx)(n.code,{children:"PRI"}),"/",(0,t.jsx)(n.code,{children:"MUL"}),"/",(0,t.jsx)(n.code,{children:"UNI"})]}),"\n",(0,t.jsx)(n.p,{children:"Defines the key type for the column."}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:'""'})," (",(0,t.jsx)(n.em,{children:"empty"}),")"]}),(0,t.jsx)(n.td,{children:"No key"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"PRI"})}),(0,t.jsx)(n.td,{children:"Primary key"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"MUL"})}),(0,t.jsx)(n.td,{children:"Indexed (multiple rows can have the same value)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"UNI"})}),(0,t.jsx)(n.td,{children:"Unique (all values must be distinct)"})]})]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"default",children:".Default"}),"\n",(0,t.jsxs)(n.p,{children:["\u2192 ",(0,t.jsx)(n.strong,{children:"String"})," / ",(0,t.jsx)(n.strong,{children:"null"})]}),"\n",(0,t.jsx)(n.p,{children:"THe default value for the column (if any)."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"extra",children:".Extra"}),"\n",(0,t.jsxs)(n.p,{children:["\u2192 ",(0,t.jsx)(n.strong,{children:"Enum"})," \u2192 ",(0,t.jsx)(n.code,{children:'""'}),"/",(0,t.jsx)(n.code,{children:"auto_increment"})]}),"\n",(0,t.jsx)(n.p,{children:"Additional attributes for the column."}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:'""'})," (",(0,t.jsx)(n.em,{children:"empty"}),")"]}),(0,t.jsx)(n.td,{children:"No extra properties"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"auto_increment"})}),(0,t.jsx)(n.td,{children:"The column value auto-increments (typically for primary keys)"})]})]})]}),"\n",(0,t.jsx)(n.hr,{})]})}function u(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(o,{...e})}):o(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>d,x:()=>c});var s=r(6540);const t={},l=s.createContext(t);function d(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:d(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);