"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[976],{7879:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"intro","title":"Introduction","description":"This documentation is far from being finished.","source":"@site/docs/intro.md","sourceDirName":".","slug":"/","permalink":"/awSQL/","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1,"slug":"/"},"sidebar":"defaultSidebar","next":{"title":"Classes","permalink":"/awSQL/category/classes"}}');var i=s(4848),r=s(8453);const o={sidebar_position:1,slug:"/"},a="Introduction",l={},d=[{value:"Getting Started",id:"getting-started",level:2},{value:"Exports",id:"exports",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"introduction",children:"Introduction"})}),"\n",(0,i.jsx)(n.admonition,{title:"Not finished",type:"info",children:(0,i.jsxs)(n.p,{children:["This documentation is far from being finished.",(0,i.jsx)("br",{}),"\nIt holds the most useful information, but lacks depth and examples.",(0,i.jsx)("br",{}),"\nIt will be expanded in the near future."]})}),"\n",(0,i.jsx)(n.p,{children:"awSQL is a fast and reliable database query tool."}),"\n",(0,i.jsx)(n.p,{children:"It is designed to minimize the risk of sql-injections while maximizing usability and safety."}),"\n",(0,i.jsx)(n.p,{children:"It prevents you from altering a whole set of rows by accident."}),"\n",(0,i.jsx)(n.p,{children:"awSQL is designed to programmatically work with databases in an obvious manner. No more writing pesky and confusing sql-queries"}),"\n",(0,i.jsx)(n.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsx)(n.p,{children:"To get started all you need is:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["An hosted database","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Your credentials"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"mysql"})," module from npm."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["To install the ",(0,i.jsx)(n.code,{children:"mysql"})," module, type:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",metastring:"showLineNumbers",children:"npm install mysql\n"})}),"\n",(0,i.jsx)(n.p,{children:"\u2192 Next move the /awSQL folder into your workspace."}),"\n",(0,i.jsx)(n.p,{children:"Now you can access the default exports:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:"index.js showLineNumbers",children:'const {awSQL, Structure} = require("./awSQL");\n\nconst instance = awSQL.createInstance("localhost", "myUser", "myPass");\ninstance.connect();\n\n// Do stuff\n'})}),"\n",(0,i.jsx)(n.h2,{id:"exports",children:"Exports"}),"\n",(0,i.jsx)(n.p,{children:"awSQL exports 2 modules to use:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"./classes/awSQL",children:"awSQL"})," as an instance"]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"./classes/structure",children:"Structure"})}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>a});var t=s(6540);const i={},r=t.createContext(i);function o(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);