1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[162],{184:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>x,frontMatter:()=>t,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"classes/select","title":"Select","description":"Performs a query to retrieve data from a table.","source":"@site/docs/classes/select.md","sourceDirName":"classes","slug":"/classes/select","permalink":"/awSQL/classes/select","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"Instance","permalink":"/awSQL/classes/instance"},"next":{"title":"Insert","permalink":"/awSQL/classes/insert"}}');var d=s(4848),i=s(8453);const t={sidebar_position:3},l="Select",c={},h=[{value:"Methods",id:"methods",level:2},{value:"selectDatabase()",id:"selectdatabase",level:3},{value:"distinct()",id:"distinct",level:3},{value:"where()",id:"where",level:3},{value:"having()",id:"having",level:3},{value:"order()",id:"order",level:3},{value:"count()",id:"count",level:3},{value:"sum()",id:"sum",level:3},{value:"avg()",id:"avg",level:3},{value:"group()",id:"group",level:3},{value:"join()",id:"join",level:3},{value:"limit()",id:"limit",level:3},{value:"pagination()",id:"pagination",level:3},{value:"execute()",id:"execute",level:3}];function j(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.header,{children:(0,d.jsx)(n.h1,{id:"select",children:"Select"})}),"\n",(0,d.jsx)(n.p,{children:"Performs a query to retrieve data from a table."}),"\n",(0,d.jsx)(n.h2,{id:"methods",children:"Methods"}),"\n",(0,d.jsx)(n.h3,{id:"selectdatabase",children:"selectDatabase()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"database"})," = ",(0,d.jsx)(n.strong,{children:"String"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Selects a different database for this query."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsx)(n.tbody,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"database"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"Name of the database to select"})]})})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"distinct",children:"distinct()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 () \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds the 'distinct' keyword to this query"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"With 'distinct' only unique values are returned"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"where",children:"where()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"string"})," = ",(0,d.jsx)(n.strong,{children:"String"}),", ",(0,d.jsx)(n.code,{children:"values"})," = ",(0,d.jsx)(n.strong,{children:"Array"}),"<",(0,d.jsx)(n.strong,{children:"any"}),">) \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds a where-clause to the query"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection"}),"\n",(0,d.jsx)(n.li,{children:"If you are using joins, specify the table and column together: table.column"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"The where-clause as a string with ? representing each values."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"values"})}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.strong,{children:"Array"}),"<",(0,d.jsx)(n.strong,{children:"any"}),">"]}),(0,d.jsx)(n.td,{children:"Array containing values replacing the ? in the string (from left to right)"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"having",children:"having()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"string"})," = ",(0,d.jsx)(n.strong,{children:"String"}),", ",(0,d.jsx)(n.code,{children:"values"})," = ",(0,d.jsx)(n.strong,{children:"Array"}),"<",(0,d.jsx)(n.strong,{children:"any"}),">) \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsxs)(n.p,{children:["Same as ",(0,d.jsx)(n.a,{href:"#where",children:"where()"})," but allows for aggregation."]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection"}),"\n",(0,d.jsx)(n.li,{children:"If you are using joins, specify the table and column together: table.column"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"The having-clause with possible aggregation ? representing each values."})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"values"})}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.strong,{children:"Array"}),"<",(0,d.jsx)(n.strong,{children:"any"}),">"]}),(0,d.jsx)(n.td,{children:"Array containing values replacing the ? in the string (from left to right)"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"order",children:"order()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"column"})," = ",(0,d.jsx)(n.strong,{children:"String"}),", ",(0,d.jsx)(n.code,{children:"desc"})," = ",(0,d.jsx)(n.strong,{children:"Boolean"}),", ",(0,d.jsx)(n.code,{children:"aggregation"})," = ",(0,d.jsx)(n.strong,{children:"Enum"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds a new sort order."}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Can be used multiple times to order by multiple columns"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"column"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"Column to order by"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"desc"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Boolean"})}),(0,d.jsxs)(n.td,{children:["Sort descending? Defaults to ",(0,d.jsx)(n.code,{children:"false"})]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"aggregation"})}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.strong,{children:"Enum"})," \u2192 ",(0,d.jsx)(n.code,{children:"MIN"}),"/",(0,d.jsx)(n.code,{children:"MAX"}),"/",(0,d.jsx)(n.code,{children:"COUNT"}),"/",(0,d.jsx)(n.code,{children:"SUM"}),"/",(0,d.jsx)(n.code,{children:"AVG"})]}),(0,d.jsx)(n.td,{children:"The aggregation type to use"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"count",children:"count()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"doParse"})," = ",(0,d.jsx)(n.strong,{children:"Boolean"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Counts the number of entries of the first selected column."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsx)(n.tbody,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"doParse"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Boolean"})}),(0,d.jsxs)(n.td,{children:["If ",(0,d.jsx)(n.code,{children:"true"})," the query will only return a ",(0,d.jsx)(n.strong,{children:"Number"})," of entries. Defaults to ",(0,d.jsx)(n.code,{children:"false"}),"."]})]})})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"sum",children:"sum()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"doParse"})," = ",(0,d.jsx)(n.strong,{children:"Boolean"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Sums numerical rows of the first selected column."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsx)(n.tbody,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"doParse"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Boolean"})}),(0,d.jsxs)(n.td,{children:["If ",(0,d.jsx)(n.code,{children:"true"})," the query will only return a ",(0,d.jsx)(n.strong,{children:"Number"})," of entries. Defaults to ",(0,d.jsx)(n.code,{children:"false"}),"."]})]})})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"avg",children:"avg()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"doParse"})," = ",(0,d.jsx)(n.strong,{children:"Boolean"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Averages numerical rows of the first selected column."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsx)(n.tbody,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"doParse"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Boolean"})}),(0,d.jsxs)(n.td,{children:["If ",(0,d.jsx)(n.code,{children:"true"})," the query will only return a ",(0,d.jsx)(n.strong,{children:"Number"})," of entries. Defaults to ",(0,d.jsx)(n.code,{children:"false"}),"."]})]})})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"group",children:"group()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"...columns"})," = ",(0,d.jsx)(n.strong,{children:"String"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Groups rows that have the same values into summary rows."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsx)(n.tbody,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"...columns"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"The columns to group by"})]})})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"join",children:"join()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"type"})," = ",(0,d.jsx)(n.strong,{children:"Enum"}),", ",(0,d.jsx)(n.code,{children:"table"})," = ",(0,d.jsx)(n.strong,{children:"String"}),", ",(0,d.jsx)(n.code,{children:"onOriginalColumn"})," = ",(0,d.jsx)(n.strong,{children:"String"}),", ",(0,d.jsx)(n.code,{children:"onJoinedColumn"})," = ",(0,d.jsx)(n.strong,{children:"String"}),", ",(0,d.jsx)(n.code,{children:"...columns"})," = ",(0,d.jsx)(n.strong,{children:"String"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Adds a new join to the query."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"type"})}),(0,d.jsxs)(n.td,{children:[(0,d.jsx)(n.strong,{children:"Enum"})," \u2192 ",(0,d.jsx)(n.code,{children:"LEFT"}),"/",(0,d.jsx)(n.code,{children:"INNER"}),"/",(0,d.jsx)(n.code,{children:"RIGHT"}),"/",(0,d.jsx)(n.code,{children:"FULL OUTER"})]}),(0,d.jsx)(n.td,{children:"The join type"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"table"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"Table to join on"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"onOriginalColumn"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"Column name on the original table to check agains"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"onJoinedColumn"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"Column name of the join table to check against"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"...columns"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"String"})}),(0,d.jsx)(n.td,{children:"The columns to join. OG-columns must be set!"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"limit",children:"limit()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"number"})," = ",(0,d.jsx)(n.strong,{children:"Number"}),", ",(0,d.jsx)(n.code,{children:"offset"})," = ",(0,d.jsx)(n.strong,{children:"Number"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Limits the query and specifies an offset to start at."}),"\n",(0,d.jsx)(n.admonition,{type:"warning",children:(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"offset"})," has no default value and therefore must not be empty!"]})}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"number"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Number"})}),(0,d.jsx)(n.td,{children:"Limits the query by specified rows"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"offset"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Number"})}),(0,d.jsx)(n.td,{children:"Offset to start at."})]})]})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"pagination",children:"pagination()"}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 (",(0,d.jsx)(n.code,{children:"page"})," = ",(0,d.jsx)(n.strong,{children:"Number"}),", ",(0,d.jsx)(n.code,{children:"itemsPerPage"})," = ",(0,d.jsx)(n.strong,{children:"Number"}),") \u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.p,{children:"Paginates the query."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Parameter"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"page"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Number"})}),(0,d.jsx)(n.td,{children:"The page to get (Minimum 1)"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"itemsPerPage"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.strong,{children:"Number"})}),(0,d.jsx)(n.td,{children:"How many items a page should have"})]})]})]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.code,{children:"this"})]}),"\n",(0,d.jsx)(n.hr,{}),"\n",(0,d.jsx)(n.h3,{id:"execute",children:"execute()"}),"\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"async"})," \u2192 () \u2192 ",(0,d.jsx)(n.strong,{children:"any"})]}),"\n",(0,d.jsx)(n.p,{children:"Executes the prepared query."}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"Returns"})}),"\n",(0,d.jsxs)(n.p,{children:["\u2192 ",(0,d.jsx)(n.strong,{children:"any"})," - Query result"]}),"\n",(0,d.jsx)(n.hr,{})]})}function x(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(j,{...e})}):j(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>l});var r=s(6540);const d={},i=r.createContext(d);function t(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:t(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); |