-
Notifications
You must be signed in to change notification settings - Fork 0
/
682120c7.d7734098.js
1 lines (1 loc) · 16.7 KB
/
682120c7.d7734098.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{91:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return r})),a.d(t,"metadata",(function(){return c})),a.d(t,"rightToc",(function(){return i})),a.d(t,"default",(function(){return j}));var n=a(2),b=a(6),l=(a(0),a(130)),r={title:"FUNCTION",sidebar_label:"Function"},c={unversionedId:"__guidelines/template/function",id:"__guidelines/template/function",isDocsHomePage:!1,title:"FUNCTION",description:"Function reference pages list one or several (when closely related to each",source:"@site/docs/__guidelines/template/function.md",slug:"/__guidelines/template/function",permalink:"/docs/__guidelines/template/function",version:"current",sidebar_label:"Function"},i=[{value:"function_name",id:"function_name",children:[{value:"Arguments",id:"arguments",children:[]},{value:"Description",id:"description",children:[]},{value:"Examples",id:"examples",children:[]}]},{value:"function_name_2",id:"function_name_2",children:[{value:"Arguments",id:"arguments-1",children:[]},{value:"Description",id:"description-1",children:[]},{value:"Examples",id:"examples-1",children:[]}]}],O={rightToc:i};function j(e){var t=e.components,a=Object(b.a)(e,["components"]);return Object(l.b)("wrapper",Object(n.a)({},O,a,{components:t,mdxType:"MDXLayout"}),Object(l.b)("p",null,"Function reference pages list one or several (when closely related to each\nother) functions. For this reason, it the section should start with a short\nparagraph describing the class of functions described in this page and what they\nare used for. They should also be listed at the top so users can find them\neasily."),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Function"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"One liner description"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("a",Object(n.a)({parentName:"td"},{href:"#function_name"}),"function_name")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"This function only has one syntax.")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("a",Object(n.a)({parentName:"td"},{href:"#function_name_2"}),"function_name_2")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"This function has various possible syntax.")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"..."),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"...")))),Object(l.b)("h2",{id:"function_name"},"function_name"),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Syntax"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Return value"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"function_name(",Object(l.b)("inlineCode",{parentName:"td"},"arg1"),",",Object(l.b)("inlineCode",{parentName:"td"},"arg2"),")"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"BOOLEAN")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"What the function does")))),Object(l.b)("h3",{id:"arguments"},"Arguments"),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Argument"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Type"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"arg1")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"DOUBLE")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sets the argument for the function.")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"arg1")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"STRING")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sets the other argument for the function. Possible values are ",Object(l.b)("inlineCode",{parentName:"td"},"value1")," to do this, and ",Object(l.b)("inlineCode",{parentName:"td"},"value2")," to do that")))),Object(l.b)("h3",{id:"description"},"Description"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"function_name")," requires a longer explanation of the logic because it is a bit\ncomplex. In this case, it is good to describe it with some text. It should start\nby a plain-text explanation. Then branches should be expressed as bullet points.\nFor example a given ",Object(l.b)("inlineCode",{parentName:"p"},"argument")," might have various behaviors depending on value"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"true")," makes it do this. It means that this happens and that might happen."),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"false")," makes the function do that. So ",Object(l.b)("inlineCode",{parentName:"li"},"function_name")," may have this behavior.")),Object(l.b)("h3",{id:"examples"},"Examples"),Object(l.b)("h4",{id:"basic-usage"},"Basic usage"),Object(l.b)("pre",null,Object(l.b)("code",Object(n.a)({parentName:"pre"},{className:"language-questdb-sql",metastring:'title="Example description - Scalar result"',title:'"Example',description:!0,"-":!0,Scalar:!0,'result"':!0}),"SELECT function_name(arg1,arg2) FROM table;\n")),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true")))),Object(l.b)("h4",{id:"with-optional-arguments"},"With optional arguments"),Object(l.b)("pre",null,Object(l.b)("code",Object(n.a)({parentName:"pre"},{className:"language-questdb-sql",metastring:'title="Example description - Table result"',title:'"Example',description:!0,"-":!0,Table:!0,'result"':!0}),"SELECT function_name(arg1,arg2,opt1) FROM table;\n")),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"a"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"b"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53")))),Object(l.b)("h4",{id:"with-null"},"With null"),Object(l.b)("pre",null,Object(l.b)("code",Object(n.a)({parentName:"pre"},{className:"language-questdb-sql",metastring:'title="Example description - Series result"',title:'"Example',description:!0,"-":!0,Series:!0,'result"':!0}),"SELECT function_name(arg1,arg2) FROM table;\n")),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"a"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"b"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"..."),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"..."),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"..."),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"...")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53")))),Object(l.b)("h2",{id:"function_name_2"},"function_name_2"),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Syntax"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Return value"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"function_name()"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"INT")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"What the function does")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"function_name(",Object(l.b)("inlineCode",{parentName:"td"},"arg1"),",",Object(l.b)("inlineCode",{parentName:"td"},"arg2"),")"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"LONG")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"A much longer description of what the function does because in this case it turns out that this particular function is slightly more complicated than other functions which are less complicated.")))),Object(l.b)("h3",{id:"arguments-1"},"Arguments"),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Argument"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Type"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"arg1")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"DOUBLE")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sets the argument for the function.")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"arg1")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"STRING")),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sets the other argument for the function. Possible values are ",Object(l.b)("inlineCode",{parentName:"td"},"value1")," to do this, and ",Object(l.b)("inlineCode",{parentName:"td"},"value2")," to do that")))),Object(l.b)("h3",{id:"description-1"},"Description"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"function_name")," requires a longer explanation of the logic because it is a bit\ncomplex. In this case, it is good to describe it with some text. It should start\nby a plain-text explanation. Then branches should be expressed as bullet points.\nFor example a given ",Object(l.b)("inlineCode",{parentName:"p"},"argument")," might have various behaviors depending on value"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"true")," makes it do this. It means that this happens and that might happen."),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"false")," makes the function do that. So ",Object(l.b)("inlineCode",{parentName:"li"},"function_name")," may have this behavior.")),Object(l.b)("h3",{id:"examples-1"},"Examples"),Object(l.b)("p",null,"At minimum, examples need a descriptive title. An optional description can be\nused to."),Object(l.b)("h4",{id:"basic-usage-1"},"Basic usage"),Object(l.b)("pre",null,Object(l.b)("code",Object(n.a)({parentName:"pre"},{className:"language-questdb-sql",metastring:'title="Example description - Scalar result"',title:'"Example',description:!0,"-":!0,Scalar:!0,'result"':!0}),"SELECT function_name(arg1,arg2) FROM table;\n")),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true")))),Object(l.b)("h4",{id:"with-optional-arguments-1"},"With optional arguments"),Object(l.b)("pre",null,Object(l.b)("code",Object(n.a)({parentName:"pre"},{className:"language-questdb-sql",metastring:'title="Example description - Table result"',title:'"Example',description:!0,"-":!0,Table:!0,'result"':!0}),"SELECT function_name(arg1,arg2) FROM table;\n")),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"a"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"b"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53")))),Object(l.b)("h4",{id:"with-null-1"},"With null"),Object(l.b)("pre",null,Object(l.b)("code",Object(n.a)({parentName:"pre"},{className:"language-questdb-sql",metastring:'title="Example description - Series result"',title:'"Example',description:!0,"-":!0,Series:!0,'result"':!0}),"SELECT function_name(arg1,arg2) FROM table;\n")),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"a"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"b"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"),Object(l.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"function_name"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"true"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"47")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"..."),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"..."),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"..."),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"...")),Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"false"),Object(l.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"53")))))}j.isMDXComponent=!0}}]);