diff --git a/404.html b/404.html index 2473719907..906563a3c5 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Page Not Found | Quickstart - + diff --git a/assets/js/11e11f3b.958ffa2a.js b/assets/js/11e11f3b.958ffa2a.js deleted file mode 100644 index b834fcc610..0000000000 --- a/assets/js/11e11f3b.958ffa2a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8625],{3463:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>u,toc:()=>m});var r=s(5893),t=s(1151),o=s(4866),c=s(5162),l=s(6393),i=s(4379);const a={sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},d="createConnection",u={id:"examples/connections/create-connection",title:"createConnection",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-connection.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-connection",permalink:"/node-mysql2/docs/examples/connections/create-connection",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-connection.mdx",tags:[{label:"createConnection",permalink:"/node-mysql2/docs/tags/create-connection"},{label:"URI",permalink:"/node-mysql2/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/docs/tags/socks"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"Introduction",permalink:"/node-mysql2/docs/examples"},next:{title:"createPool",permalink:"/node-mysql2/docs/examples/connections/create-pool"}},h={},m=[{value:"createConnection(connectionUri)",id:"createconnectionconnectionuri",level:2},{value:"createConnection(config)",id:"createconnectionconfig",level:2},{value:"createConnection(config) \u2014 SHA1",id:"createconnectionconfig--sha1",level:2},{value:"createConnection(config) \u2014 SSL",id:"createconnectionconfig--ssl",level:2},{value:"createConnection(config) \u2014 RDS SSL",id:"createconnectionconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createConnection(config) \u2014 Socks",id:"createconnectionconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ConnectionOptions",id:"connectionoptions",level:3}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createconnection",children:"createConnection"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconnectionuri",children:"createConnection(connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"createConnection(connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n );\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n);\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig",children:"createConnection(config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--sha1",children:"createConnection(config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--ssl",children:"createConnection(config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsxs)(c.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--rds-ssl",children:"createConnection(config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(c.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await connection.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(c.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n connection.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--socks",children:"createConnection(config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst connection = mysql.createConnection({\n stream: socksProxy,\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsx)(c.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst connection = mysql.createConnection({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"connectionoptions",children:"ConnectionOptions"}),"\n",(0,r.jsx)(l.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>c});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var o=s(5893);function c(e){let{children:n,hidden:s,className:c}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,c),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>S});var r=s(7294),t=s(512),o=s(2466),c=s(6550),l=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const t=(0,c.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})}),[o,t])]}function g(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,o=h(e),[c,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[a,u]=p({queryString:s,groupId:t}),[g,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,o]=(0,d.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&o.set(e)}),[s,o])]}({groupId:t}),j=(()=>{const e=a??g;return m({value:e,tabValues:o})?e:null})();(0,l.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:c,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,o]),tabValues:o}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:c,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,o.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),t=l[s].value;t!==r&&(a(n),c(t))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:o}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...o,className:(0,t.Z)("tabs__item",j.tabItem,o?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:t}=e;const o=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),t=s(2263),o=s(9286),c=s(5893);const l=()=>(0,c.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,m]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!0),{siteConfig:x}=(0,t.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let o=!1,c=0,l="";for(const i of r)if(i.includes(t)&&(o=!0),o&&(i.includes("{")&&c++,l+=i+"\n",i.includes("}")&&(c--,0===c)))break;return l.trim()||e})(e,i,a):e;u(n||e),m(!1),g(!1)})).catch((()=>{g(!0),m(!1)})),()=>{e.abort()}}),[f,i,a]),(0,c.jsx)(c.Fragment,{children:h?(0,c.jsx)(l,{}):(0,c.jsx)(c.Fragment,{children:p?(0,c.jsxs)("div",{children:["Unable to access the requested link: ",(0,c.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,c.jsx)(o.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>o});var r=s(4673),t=s(5893);const o=e=>{let{children:n,open:s,title:o}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/11e11f3b.bcef533c.js b/assets/js/11e11f3b.bcef533c.js new file mode 100644 index 0000000000..f6e211883e --- /dev/null +++ b/assets/js/11e11f3b.bcef533c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8625],{3463:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>u,toc:()=>m});var r=s(5893),t=s(1151),o=s(4866),c=s(5162),l=s(6393),i=s(4379);const a={sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},d="createConnection",u={id:"examples/connections/create-connection",title:"createConnection",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-connection.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-connection",permalink:"/node-mysql2/docs/examples/connections/create-connection",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-connection.mdx",tags:[{label:"createConnection",permalink:"/node-mysql2/docs/tags/create-connection"},{label:"URI",permalink:"/node-mysql2/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/docs/tags/socks"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"Introduction",permalink:"/node-mysql2/docs/examples"},next:{title:"createPool",permalink:"/node-mysql2/docs/examples/connections/create-pool"}},h={},m=[{value:"createConnection(connectionUri)",id:"createconnectionconnectionuri",level:2},{value:"createConnection(config)",id:"createconnectionconfig",level:2},{value:"createConnection(config) \u2014 SHA1",id:"createconnectionconfig--sha1",level:2},{value:"createConnection(config) \u2014 SSL",id:"createconnectionconfig--ssl",level:2},{value:"createConnection(config) \u2014 RDS SSL",id:"createconnectionconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createConnection(config) \u2014 Socks",id:"createconnectionconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ConnectionOptions",id:"connectionoptions",level:3}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createconnection",children:"createConnection"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconnectionuri",children:"createConnection(connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"createConnection(connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n );\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n);\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig",children:"createConnection(config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--sha1",children:"createConnection(config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--ssl",children:"createConnection(config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsxs)(c.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--rds-ssl",children:"createConnection(config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(c.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await connection.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(c.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n connection.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--socks",children:"createConnection(config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst connection = mysql.createConnection({\n stream: socksProxy,\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsx)(c.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst connection = mysql.createConnection({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"connectionoptions",children:"ConnectionOptions"}),"\n",(0,r.jsx)(l.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>c});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var o=s(5893);function c(e){let{children:n,hidden:s,className:c}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,c),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>S});var r=s(7294),t=s(512),o=s(2466),c=s(6550),l=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const t=(0,c.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})}),[o,t])]}function g(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,o=h(e),[c,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[a,u]=p({queryString:s,groupId:t}),[g,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,o]=(0,d.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&o.set(e)}),[s,o])]}({groupId:t}),j=(()=>{const e=a??g;return m({value:e,tabValues:o})?e:null})();(0,l.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:c,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,o]),tabValues:o}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:c,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,o.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),t=l[s].value;t!==r&&(a(n),c(t))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:o}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...o,className:(0,t.Z)("tabs__item",j.tabItem,o?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:t}=e;const o=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),t=s(2263),o=s(9286),c=s(5893);const l=()=>(0,c.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,m]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!0),{siteConfig:x}=(0,t.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let o=!1,c=0,l="";for(const i of r)if(i.includes(t)&&(o=!0),o&&(i.includes("{")&&c++,l+=i+"\n",i.includes("}")&&(c--,0===c)))break;return l.trim()||e})(e,i,a):e;u(n||e),m(!1),g(!1)})).catch((()=>{g(!0),m(!1)})),()=>{e.abort()}}),[f,i,a]),(0,c.jsx)(c.Fragment,{children:h?(0,c.jsx)(l,{}):(0,c.jsx)(c.Fragment,{children:p?(0,c.jsxs)("div",{children:["Unable to access the requested link: ",(0,c.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,c.jsx)(o.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>o});var r=s(4673),t=s(5893);const o=e=>{let{children:n,open:s,title:o}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/1568425c.6348d27b.js b/assets/js/1568425c.6348d27b.js deleted file mode 100644 index d85cd86da6..0000000000 --- a/assets/js/1568425c.6348d27b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9458],{904:(e,s,i)=>{i.r(s),i.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>n,metadata:()=>a,toc:()=>o});var r=i(5893),t=i(1151);const n={},l="Simple Queries",a={id:"examples/queries/simple-queries/index",title:"Simple Queries",description:"For Prepared Statements or Placeholders / Parameters examples, please see here.",source:"@site/docs/examples/queries/simple-queries/index.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/",permalink:"/node-mysql2/docs/examples/queries/simple-queries/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"createPoolCluster",permalink:"/node-mysql2/docs/examples/connections/createPoolCluster"},next:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/simple-queries/insert"}},c={},o=[];function d(e){const s={a:"a",admonition:"admonition",h1:"h1",hr:"hr",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{id:"simple-queries",children:"Simple Queries"}),"\n",(0,r.jsx)(s.admonition,{type:"info",children:(0,r.jsxs)(s.p,{children:["For ",(0,r.jsx)(s.strong,{children:"Prepared Statements"})," or ",(0,r.jsx)(s.strong,{children:"Placeholders"})," / ",(0,r.jsx)(s.strong,{children:"Parameters"})," examples, please see ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements",children:"here"}),"."]})}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,r.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/insert",children:(0,r.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/select",children:(0,r.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/update",children:(0,r.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/delete",children:(0,r.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function p(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},1151:(e,s,i)=>{i.d(s,{Z:()=>a,a:()=>l});var r=i(7294);const t={},n=r.createContext(t);function l(e){const s=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),r.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1568425c.9968efa5.js b/assets/js/1568425c.9968efa5.js new file mode 100644 index 0000000000..b1918a85c8 --- /dev/null +++ b/assets/js/1568425c.9968efa5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9458],{904:(e,s,i)=>{i.r(s),i.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>n,metadata:()=>a,toc:()=>o});var r=i(5893),t=i(1151);const n={},l="Simple Queries",a={id:"examples/queries/simple-queries/index",title:"Simple Queries",description:"For Prepared Statements or Placeholders / Parameters examples, please see here.",source:"@site/docs/examples/queries/simple-queries/index.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/",permalink:"/node-mysql2/docs/examples/queries/simple-queries/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"createPoolCluster",permalink:"/node-mysql2/docs/examples/connections/createPoolCluster"},next:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/simple-queries/insert"}},c={},o=[];function d(e){const s={a:"a",admonition:"admonition",h1:"h1",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{id:"simple-queries",children:"Simple Queries"}),"\n",(0,r.jsx)(s.admonition,{type:"info",children:(0,r.jsxs)(s.p,{children:["For ",(0,r.jsx)(s.strong,{children:"Prepared Statements"})," or ",(0,r.jsx)(s.strong,{children:"Placeholders"})," / ",(0,r.jsx)(s.strong,{children:"Parameters"})," examples, please see ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements",children:"here"}),"."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,r.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/insert",children:(0,r.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/select",children:(0,r.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/update",children:(0,r.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/delete",children:(0,r.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function p(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},1151:(e,s,i)=>{i.d(s,{Z:()=>a,a:()=>l});var r=i(7294);const t={},n=r.createContext(t);function l(e){const s=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),r.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1df93b7f.7c544ac9.js b/assets/js/1df93b7f.7c544ac9.js new file mode 100644 index 0000000000..33182a81c7 --- /dev/null +++ b/assets/js/1df93b7f.7c544ac9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{9754:(e,s,n)=>{n.r(s),n.d(s,{default:()=>i});var t=n(6550),c=n(2263),u=n(5893);const i=function(){const{i18n:e,siteConfig:s}=(0,c.Z)(),{baseUrl:n}=s,i=e.currentLocale,o="en"===i||n.includes(i)?`${n}docs`:`${n}${i}/docs`;return(0,u.jsx)(t.l_,{to:o})}}}]); \ No newline at end of file diff --git a/assets/js/1df93b7f.8f7e93f0.js b/assets/js/1df93b7f.8f7e93f0.js deleted file mode 100644 index 6dfb81a400..0000000000 --- a/assets/js/1df93b7f.8f7e93f0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{9754:(e,s,t)=>{t.r(s),t.d(s,{default:()=>r});var n=t(6550),c=t(2263),o=t(5893);const r=function(){const{i18n:e,siteConfig:s}=(0,c.Z)(),{baseUrl:t}=s,r=e.currentLocale,u="en"===r?`${t}docs`:`${t}${r}/docs`;return(0,o.jsx)(n.l_,{to:u})}}}]); \ No newline at end of file diff --git a/assets/js/2bc14e22.4e0be83f.js b/assets/js/2bc14e22.4e0be83f.js new file mode 100644 index 0000000000..fc2c3ac353 --- /dev/null +++ b/assets/js/2bc14e22.4e0be83f.js @@ -0,0 +1,2 @@ +/*! For license information please see 2bc14e22.4e0be83f.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2839],{4760:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>x,frontMatter:()=>a,metadata:()=>i,toc:()=>h});var t=s(5893),r=s(1151),l=s(8609),c=s(3901);const a={},o="Using MySQL2 with TypeScript",i={id:"documentation/typescript-examples",title:"Using MySQL2 with TypeScript",description:"Installation",source:"@site/docs/documentation/typescript-examples.mdx",sourceDirName:"documentation",slug:"/documentation/typescript-examples",permalink:"/node-mysql2/docs/documentation/typescript-examples",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/typescript-examples.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Promise Wrappers",permalink:"/node-mysql2/docs/documentation/promise-wrapper"},next:{title:"API and Configuration",permalink:"/node-mysql2/docs/api-and-configurations"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"Usage",id:"usage",level:2},{value:"Connection",id:"connection",level:3},{value:"Pool Connection",id:"pool-connection",level:3},{value:"Query and Execute",id:"query-and-execute",level:3},{value:"A simple query",id:"a-simple-query",level:4},{value:"Type Specification",id:"type-specification",level:2},{value:"RowDataPacket[]",id:"rowdatapacket",level:3},{value:"RowDataPacket[][]",id:"rowdatapacket-1",level:3},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"ResultSetHeader[]",id:"resultsetheader-1",level:3},{value:"ProcedureCallPacket",id:"procedurecallpacket",level:3},{value:"OkPacket",id:"okpacket",level:3},{value:"Examples",id:"examples",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"using-mysql2-with-typescript",children:"Using MySQL2 with TypeScript"}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"@types/node"})," ensure the proper interaction between ",(0,t.jsx)(n.strong,{children:"TypeScript"})," and the ",(0,t.jsx)(n.strong,{children:"Node.js"})," modules used by ",(0,t.jsx)(n.strong,{children:"MySQL2"})," (",(0,t.jsx)(n.em,{children:"net"}),", ",(0,t.jsx)(n.em,{children:"events"}),", ",(0,t.jsx)(n.em,{children:"stream"}),", ",(0,t.jsx)(n.em,{children:"tls"}),", etc.)."]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires ",(0,t.jsx)(n.strong,{children:"TypeScript"})," ",(0,t.jsx)(n.code,{children:">=4.5.2"}),"."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["You can import ",(0,t.jsx)(n.strong,{children:"MySQL2"})," in two ways:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"true"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql from 'mysql2';\nimport mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"false"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import * as mysql from 'mysql2';\nimport * as mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsx)(n.h3,{id:"connection",children:"Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ConnectionOptions } from 'mysql2';\n\nconst access: ConnectionOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createConnection(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"pool-connection",children:"Pool Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { PoolOptions } from 'mysql2';\n\nconst access: PoolOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createPool(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"query-and-execute",children:"Query and Execute"}),"\n",(0,t.jsx)(n.h4,{id:"a-simple-query",children:"A simple query"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\nconn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"rows"})," output will be these possible types:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[][]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"In this example, you need to manually check the output types"}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"type-specification",children:"Type Specification"}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket",children:"RowDataPacket[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(n.p,{children:"An array with the returned rows, for example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n// SELECT\nconn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { Tables_in_test: 'test' } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"rowsAsArray"})," option as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n rowsAsArray: true,\n});\n\n// SELECT\nconn.query(\n 'SELECT 1 + 1 AS test, 2 + 2 AS test;',\n (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 2, 4 ] ]\n */\n }\n);\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 'test' ] ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket-1",children:"RowDataPacket[][]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," option as ",(0,t.jsx)(n.code,{children:"true"})," with multiple queries:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SELECT 1 + 1 AS test;\n SELECT 2 + 2 AS test;\n`;\n\nconn.query(sql, (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"changedRows"})," option is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"affectedRows"})," instead."]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc.:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\nconst sql = `\n SET @1 = 1;\n`;\n\nconn.query(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader-1",children:"ResultSetHeader[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ResultSetHeader[]"})]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For multiples ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc. when using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SET @1 = 1;\n SET @2 = 2;\n`;\n\nconn.query(sql, (_err, results) => {\n console.log(results);\n /**\n * @results: [\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 10,\n warningStatus: 0,\n changedRows: 0\n },\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"procedurecallpacket",children:"ProcedureCallPacket"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ProcedureCallPacket"})]})]}]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["By performing a ",(0,t.jsx)(n.strong,{children:"Call Procedure"})," using ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", etc., the return will be a ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})," (even if you perform multiples queries and set ",(0,t.jsx)(n.code,{children:"multipleStatements"})," to ",(0,t.jsx)(n.code,{children:"true"}),"):"]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n/** ResultSetHeader */\nconn.query('DROP PROCEDURE IF EXISTS myProcedure');\n\n/** ResultSetHeader */\nconn.query(`\n CREATE PROCEDURE myProcedure()\n BEGIN\n SET @1 = 1;\n SET @2 = 2;\n END\n `);\n\n/** ProcedureCallPacket */\nconst sql = 'CALL myProcedure()';\n\nconn.query>(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"CREATE PROCEDURE"})," and ",(0,t.jsx)(n.code,{children:"DROP PROCEDURE"}),", these returns will be the ",(0,t.jsx)(n.em,{children:"default"})," ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["By using ",(0,t.jsx)(n.code,{children:"SELECT"})," and ",(0,t.jsx)(n.code,{children:"SHOW"})," queries in a ",(0,t.jsx)(n.strong,{children:"Procedure Call"}),", it groups the results as:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"/** ProcedureCallPacket */\n[RowDataPacket[], ResultSetHeader]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"}),", please see the following examples."]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"okpacket",children:"OkPacket"}),"\n",(0,t.jsx)(c.X,{level:0,message:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,t.jsxs)(n.p,{children:["You can also check some code examples using ",(0,t.jsx)(n.strong,{children:"MySQL2"})," and ",(0,t.jsx)(n.strong,{children:"TypeScript"})," to understand advanced concepts:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/index",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array-multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"}),", ",(0,t.jsx)(n.code,{children:"rowAsArray"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/index",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/row-as-array",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/basic-custom-class",children:["Creating a basic custom ",(0,t.jsx)(n.strong,{children:"MySQL2"})," ",(0,t.jsx)(n.strong,{children:"Class"})]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4673:(e,n,s)=>{s.d(n,{Z:()=>p});var t=s(7294),r=s(512),l=s(2389),c=s(6043);const a={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var o=s(5893);function i(e){return!!e&&("SUMMARY"===e.tagName||i(e.parentElement))}function d(e,n){return!!e&&(e===n||d(e.parentElement,n))}function h(e){let{summary:n,children:s,...h}=e;const u=(0,l.Z)(),x=(0,t.useRef)(null),{collapsed:p,setCollapsed:j}=(0,c.u)({initialState:!h.open}),[m,y]=(0,t.useState)(h.open),g=t.isValidElement(n)?n:(0,o.jsx)("summary",{children:n??"Details"});return(0,o.jsxs)("details",{...h,ref:x,open:m,"data-collapsed":p,className:(0,r.Z)(a.details,u&&a.isBrowser,h.className),onMouseDown:e=>{i(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;i(n)&&d(n,x.current)&&(e.preventDefault(),p?(j(!1),y(!0)):j(!0))},children:[g,(0,o.jsx)(c.z,{lazy:!1,collapsed:p,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),y(!e)},children:(0,o.jsx)("div",{className:a.collapsibleContent,children:s})})]})}const u={details:"details_b_Ee"},x="alert alert--info";function p(e){let{...n}=e;return(0,o.jsx)(h,{...n,className:(0,r.Z)(x,u.details,n.className)})}},8609:(e,n,s)=>{s.d(n,{A:()=>c});var t=s(4673);const r=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var l=s(5893);const c=e=>{let{records:n,open:s}=e;return(0,l.jsx)(t.Z,{open:s,summary:(0,l.jsxs)("summary",{children:[(0,l.jsx)(r,{})," History"]}),className:"history",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Version"}),(0,l.jsx)("th",{children:"Changes"})]})}),(0,l.jsx)("tbody",{children:n.map(((e,n)=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,l.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>u});var t=s(3692),r=s(4297);const l=(0,r.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),c=(0,r.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),a=(0,r.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),o=(0,r.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),i=(0,r.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,r.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:n,message:s}=e;const r={0:{title:"Deprecated",icon:(0,h.jsx)(l,{})},1:{title:"Experimental",icon:(0,h.jsx)(c,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(a,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(o,{})},2:{title:"Stable",icon:(0,h.jsx)(i,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:r[n].title}),r[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(7294),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:o="",children:i,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...r,width:l,height:l,stroke:s,strokeWidth:a?24*Number(c)/Number(l):c,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,o].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(i)?i:[i]]);var u}));return s.displayName=`${e}`,s}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>c});var t=s(7294);const r={},l=t.createContext(r);function c(e){const n=t.useContext(l);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(r):e.components||r:c(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2bc14e22.684b748e.js.LICENSE.txt b/assets/js/2bc14e22.4e0be83f.js.LICENSE.txt similarity index 100% rename from assets/js/2bc14e22.684b748e.js.LICENSE.txt rename to assets/js/2bc14e22.4e0be83f.js.LICENSE.txt diff --git a/assets/js/2bc14e22.684b748e.js b/assets/js/2bc14e22.684b748e.js deleted file mode 100644 index b82d00d6db..0000000000 --- a/assets/js/2bc14e22.684b748e.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 2bc14e22.684b748e.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2839],{4760:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>x,frontMatter:()=>a,metadata:()=>i,toc:()=>h});var t=s(5893),r=s(1151),l=s(8609),c=s(3901);const a={},o="Using MySQL2 with TypeScript",i={id:"documentation/typescript-examples",title:"Using MySQL2 with TypeScript",description:"Installation",source:"@site/docs/documentation/typescript-examples.mdx",sourceDirName:"documentation",slug:"/documentation/typescript-examples",permalink:"/node-mysql2/docs/documentation/typescript-examples",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/typescript-examples.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Promise Wrappers",permalink:"/node-mysql2/docs/documentation/promise-wrapper"},next:{title:"API and Configuration",permalink:"/node-mysql2/docs/api-and-configurations"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"Usage",id:"usage",level:2},{value:"Connection",id:"connection",level:3},{value:"Pool Connection",id:"pool-connection",level:3},{value:"Query and Execute",id:"query-and-execute",level:3},{value:"A simple query",id:"a-simple-query",level:4},{value:"Type Specification",id:"type-specification",level:2},{value:"RowDataPacket[]",id:"rowdatapacket",level:3},{value:"RowDataPacket[][]",id:"rowdatapacket-1",level:3},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"ResultSetHeader[]",id:"resultsetheader-1",level:3},{value:"ProcedureCallPacket",id:"procedurecallpacket",level:3},{value:"OkPacket",id:"okpacket",level:3},{value:"Examples",id:"examples",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"using-mysql2-with-typescript",children:"Using MySQL2 with TypeScript"}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"@types/node"})," ensure the proper interaction between ",(0,t.jsx)(n.strong,{children:"TypeScript"})," and the ",(0,t.jsx)(n.strong,{children:"Node.js"})," modules used by ",(0,t.jsx)(n.strong,{children:"MySQL2"})," (",(0,t.jsx)(n.em,{children:"net"}),", ",(0,t.jsx)(n.em,{children:"events"}),", ",(0,t.jsx)(n.em,{children:"stream"}),", ",(0,t.jsx)(n.em,{children:"tls"}),", etc.)."]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires ",(0,t.jsx)(n.strong,{children:"TypeScript"})," ",(0,t.jsx)(n.code,{children:">=4.5.2"}),"."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["You can import ",(0,t.jsx)(n.strong,{children:"MySQL2"})," in two ways:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"true"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql from 'mysql2';\nimport mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"false"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import * as mysql from 'mysql2';\nimport * as mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsx)(n.h3,{id:"connection",children:"Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ConnectionOptions } from 'mysql2';\n\nconst access: ConnectionOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createConnection(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"pool-connection",children:"Pool Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { PoolOptions } from 'mysql2';\n\nconst access: PoolOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createPool(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"query-and-execute",children:"Query and Execute"}),"\n",(0,t.jsx)(n.h4,{id:"a-simple-query",children:"A simple query"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\nconn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"rows"})," output will be these possible types:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[][]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"In this example, you need to manually check the output types"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"type-specification",children:"Type Specification"}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket",children:"RowDataPacket[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(n.p,{children:"An array with the returned rows, for example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n// SELECT\nconn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { Tables_in_test: 'test' } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"rowsAsArray"})," option as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n rowsAsArray: true,\n});\n\n// SELECT\nconn.query(\n 'SELECT 1 + 1 AS test, 2 + 2 AS test;',\n (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 2, 4 ] ]\n */\n }\n);\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 'test' ] ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket-1",children:"RowDataPacket[][]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," option as ",(0,t.jsx)(n.code,{children:"true"})," with multiple queries:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SELECT 1 + 1 AS test;\n SELECT 2 + 2 AS test;\n`;\n\nconn.query(sql, (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"changedRows"})," option is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"affectedRows"})," instead."]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc.:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\nconst sql = `\n SET @1 = 1;\n`;\n\nconn.query(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader-1",children:"ResultSetHeader[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ResultSetHeader[]"})]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For multiples ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc. when using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SET @1 = 1;\n SET @2 = 2;\n`;\n\nconn.query(sql, (_err, results) => {\n console.log(results);\n /**\n * @results: [\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 10,\n warningStatus: 0,\n changedRows: 0\n },\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"procedurecallpacket",children:"ProcedureCallPacket"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ProcedureCallPacket"})]})]}]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["By performing a ",(0,t.jsx)(n.strong,{children:"Call Procedure"})," using ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", etc., the return will be a ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})," (even if you perform multiples queries and set ",(0,t.jsx)(n.code,{children:"multipleStatements"})," to ",(0,t.jsx)(n.code,{children:"true"}),"):"]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n/** ResultSetHeader */\nconn.query('DROP PROCEDURE IF EXISTS myProcedure');\n\n/** ResultSetHeader */\nconn.query(`\n CREATE PROCEDURE myProcedure()\n BEGIN\n SET @1 = 1;\n SET @2 = 2;\n END\n `);\n\n/** ProcedureCallPacket */\nconst sql = 'CALL myProcedure()';\n\nconn.query>(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"CREATE PROCEDURE"})," and ",(0,t.jsx)(n.code,{children:"DROP PROCEDURE"}),", these returns will be the ",(0,t.jsx)(n.em,{children:"default"})," ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["By using ",(0,t.jsx)(n.code,{children:"SELECT"})," and ",(0,t.jsx)(n.code,{children:"SHOW"})," queries in a ",(0,t.jsx)(n.strong,{children:"Procedure Call"}),", it groups the results as:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"/** ProcedureCallPacket */\n[RowDataPacket[], ResultSetHeader]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"}),", please see the following examples."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"okpacket",children:"OkPacket"}),"\n",(0,t.jsx)(c.X,{level:0,message:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,t.jsxs)(n.p,{children:["You can also check some code examples using ",(0,t.jsx)(n.strong,{children:"MySQL2"})," and ",(0,t.jsx)(n.strong,{children:"TypeScript"})," to understand advanced concepts:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/index",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array-multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"}),", ",(0,t.jsx)(n.code,{children:"rowAsArray"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/index",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/row-as-array",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/basic-custom-class",children:["Creating a basic custom ",(0,t.jsx)(n.strong,{children:"MySQL2"})," ",(0,t.jsx)(n.strong,{children:"Class"})]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4673:(e,n,s)=>{s.d(n,{Z:()=>p});var t=s(7294),r=s(512),l=s(2389),c=s(6043);const a={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var o=s(5893);function i(e){return!!e&&("SUMMARY"===e.tagName||i(e.parentElement))}function d(e,n){return!!e&&(e===n||d(e.parentElement,n))}function h(e){let{summary:n,children:s,...h}=e;const u=(0,l.Z)(),x=(0,t.useRef)(null),{collapsed:p,setCollapsed:j}=(0,c.u)({initialState:!h.open}),[m,y]=(0,t.useState)(h.open),g=t.isValidElement(n)?n:(0,o.jsx)("summary",{children:n??"Details"});return(0,o.jsxs)("details",{...h,ref:x,open:m,"data-collapsed":p,className:(0,r.Z)(a.details,u&&a.isBrowser,h.className),onMouseDown:e=>{i(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;i(n)&&d(n,x.current)&&(e.preventDefault(),p?(j(!1),y(!0)):j(!0))},children:[g,(0,o.jsx)(c.z,{lazy:!1,collapsed:p,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),y(!e)},children:(0,o.jsx)("div",{className:a.collapsibleContent,children:s})})]})}const u={details:"details_b_Ee"},x="alert alert--info";function p(e){let{...n}=e;return(0,o.jsx)(h,{...n,className:(0,r.Z)(x,u.details,n.className)})}},8609:(e,n,s)=>{s.d(n,{A:()=>c});var t=s(4673);const r=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var l=s(5893);const c=e=>{let{records:n,open:s}=e;return(0,l.jsx)(t.Z,{open:s,summary:(0,l.jsxs)("summary",{children:[(0,l.jsx)(r,{})," History"]}),className:"history",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Version"}),(0,l.jsx)("th",{children:"Changes"})]})}),(0,l.jsx)("tbody",{children:n.map(((e,n)=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,l.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>u});var t=s(3692),r=s(4297);const l=(0,r.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),c=(0,r.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),a=(0,r.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),o=(0,r.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),i=(0,r.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,r.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:n,message:s}=e;const r={0:{title:"Deprecated",icon:(0,h.jsx)(l,{})},1:{title:"Experimental",icon:(0,h.jsx)(c,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(a,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(o,{})},2:{title:"Stable",icon:(0,h.jsx)(i,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:r[n].title}),r[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(7294),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:o="",children:i,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...r,width:l,height:l,stroke:s,strokeWidth:a?24*Number(c)/Number(l):c,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,o].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(i)?i:[i]]);var u}));return s.displayName=`${e}`,s}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>c});var t=s(7294);const r={},l=t.createContext(r);function c(e){const n=t.useContext(l);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(r):e.components||r:c(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4edc808e.1929d38c.js b/assets/js/4edc808e.1929d38c.js deleted file mode 100644 index 41a64b873a..0000000000 --- a/assets/js/4edc808e.1929d38c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4173],{7559:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>u,toc:()=>h});var t=s(5893),o=s(1151),r=s(4866),a=s(5162),l=s(4442);const i={slug:"/",position:1,title:"Quickstart",description:"MySQL client for Node.js with focus on performance"},c="MySQL2",u={id:"index",title:"Quickstart",description:"MySQL client for Node.js with focus on performance",source:"@site/docs/index.mdx",sourceDirName:".",slug:"/",permalink:"/node-mysql2/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/index.mdx",tags:[],version:"current",frontMatter:{slug:"/",position:1,title:"Quickstart",description:"MySQL client for Node.js with focus on performance"},sidebar:"docs",next:{title:"History and Why MySQL2",permalink:"/node-mysql2/docs/history-and-why-mysq2"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"First Query",id:"first-query",level:3},{value:"Using Prepared Statements",id:"using-prepared-statements",level:3},{value:"Using Connection Pools",id:"using-connection-pools",level:3},{value:"Using Promise Wrapper",id:"using-promise-wrapper",level:3},{value:"Array Results",id:"array-results",level:3},{value:"Connection Level",id:"connection-level",level:4},{value:"Query Level",id:"query-level",level:4}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.V,{title:"MySQL2 | Quickstart"}),"\n",(0,t.jsx)(n.h1,{id:"mysql2",children:"MySQL2"}),"\n","\n",(0,t.jsx)(n.p,{children:"MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more."}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/v/mysql2.svg",alt:"NPM Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/dm/mysql2.svg",alt:"NPM Downloads"})}),"\n",(0,t.jsx)(n.a,{href:"https://nodejs.org/download/",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/node/v/mysql2.svg",alt:"Node.js Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/blob/master/License",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000",alt:"License"})})]}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues."}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\n"})})}),(0,t.jsxs)(a.Z,{value:"TypeScript",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),(0,t.jsxs)(n.p,{children:["For TypeScript documentation and examples, see ",(0,t.jsx)(n.a,{href:"/docs/documentation/typescript-examples",children:"here"}),"."]})]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"first-query",children:"First Query"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more queries examples, please visit the example sections ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,t.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// Get the client\nimport mysql from 'mysql2/promise';\n\n// Create the connection to database\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// A simple SELECT query\ntry {\n const [results, fields] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45'\n );\n\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n} catch (err) {\n console.log(err);\n}\n\n// Using placeholders\ntry {\n const [results] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45]\n );\n\n console.log(results);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// Get the client\nconst mysql = require('mysql2');\n\n// Create the connection to database\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// A simple SELECT query\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45',\n function (err, results, fields) {\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n }\n);\n\n// Using placeholders\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45],\n function (err, results) {\n console.log(results);\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"using-prepared-statements",children:"Using Prepared Statements"}),"\n",(0,t.jsx)(n.p,{children:"With MySQL2 you also get the prepared statements. With prepared statements MySQL doesn't have to prepare plan for same query every time, this results in better performance. If you don't know why they are important, please check these discussions:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks",children:"How prepared statements can protect from SQL Injection attacks"})}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 provides ",(0,t.jsx)(n.code,{children:"execute"})," helper which will prepare and query the statement. You can also manually prepare / unprepare statement with ",(0,t.jsx)(n.code,{children:"prepare"})," / ",(0,t.jsx)(n.code,{children:"unprepare"})," methods."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Prepared Statements and Placeholders examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // create the connection to database\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // execute will internally call prepare and query\n const [results, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53]\n );\n\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// create the connection to database\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// execute will internally call prepare and query\nconnection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53],\n function (err, results, fields) {\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsx)(n.p,{children:"If you execute same statement again, it will be picked from a LRU cache which will save query preparation time and give better performance."})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"using-connection-pools",children:"Using Connection Pools"}),"\n",(0,t.jsx)(n.p,{children:"Connection pools help reduce the time spent connecting to the MySQL server by reusing a previous connection, leaving them open instead of closing when you are done with them."}),"\n",(0,t.jsx)(n.p,{children:"This improves the latency of queries as you avoid all of the overhead that comes with establishing a new connection."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Connection Pools examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/connections/create-pool",children:(0,t.jsx)(n.strong,{children:"createPool"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\n// Create the connection pool. The pool-specific settings are the defaults\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// Create the connection pool. The pool-specific settings are the defaults\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"The pool does not create all connections upfront but creates them on demand until the connection limit is reached."})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsxs)(n.p,{children:["You can use the pool in the same way as connections (using ",(0,t.jsx)(n.code,{children:"pool.query()"})," and ",(0,t.jsx)(n.code,{children:"pool.execute()"}),"):"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n // For pool initialization, see above\n const [rows, fields] = await pool.query('SELECT `field` FROM `table`');\n // Connection is automatically released when query resolves\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.query('SELECT `field` FROM `table`', function (err, rows, fields) {\n // Connection is automatically released when query resolves\n});\n"})})})]}),"\n",(0,t.jsx)(n.p,{children:"Alternatively, there is also the possibility of manually acquiring a connection from the pool and returning it later:"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\nconst conn = await pool.getConnection();\n\n// Do something with the connection\nawait conn.query(/* ... */);\n\n// Don't forget to release the connection when finished!\npool.releaseConnection(conn);\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.getConnection(function (err, conn) {\n // Do something with the connection\n conn.query(/* ... */);\n\n // Don't forget to release the connection when finished!\n pool.releaseConnection(conn);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Additionally, directly release the connection using the ",(0,t.jsx)(n.code,{children:"connection"})," object:"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"conn.release();\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"using-promise-wrapper",children:"Using Promise Wrapper"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 also support Promise API. Which works very well with ES7 async await."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nasync function main() {\n // create the connection\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // query database\n const [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n );\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 use default ",(0,t.jsx)(n.code,{children:"Promise"})," object available in scope. But you can choose which ",(0,t.jsx)(n.code,{children:"Promise"})," implementation you want to use."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// get the client\nimport mysql from 'mysql2/promise';\n\n// get the promise implementation, we will use bluebird\nimport bluebird from 'bluebird';\n\n// create the connection, specify bluebird as Promise\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n Promise: bluebird,\n});\n\n// query database\nconst [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n);\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 also exposes a ",(0,t.jsx)(n.code,{children:".promise()"})," function on Pools, so you can create a promise/non-promise connections from the same pool."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2';\n\nasync function main() {\n // create the pool\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // now get a Promise wrapped instance of that pool\n const promisePool = pool.promise();\n\n // query database using promises\n const [rows, fields] = await promisePool.query('SELECT 1');\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 exposes a ",(0,t.jsx)(n.code,{children:".promise()"}),' function on Connections, to "upgrade" an existing non-promise connection to use promise.']}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const mysql = require('mysql2');\n\n// create the connection\nconst conn = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\nconn\n .promise()\n .query('SELECT 1')\n .then(([rows, fields]) => {\n console.log(rows);\n })\n .catch(console.log)\n .then(() => conn.end());\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"array-results",children:"Array Results"}),"\n",(0,t.jsxs)(n.p,{children:["If you have two columns with the same name, you might want to get results as an array rather than an object to prevent them from clashing. This is a deviation from the ",(0,t.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," library."]}),"\n",(0,t.jsxs)(n.p,{children:["For example: ",(0,t.jsx)(n.code,{children:"SELECT 1 AS `foo`, 2 AS `foo`"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"You can enable this setting at either the connection level (applies to all queries), or at the query level (applies only to that specific query)."}),"\n",(0,t.jsx)(n.h4,{id:"connection-level",children:"Connection Level"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = await mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})})]}),"\n",(0,t.jsx)(n.h4,{id:"query-level",children:"Query Level"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"try {\n const [results, fields] = await conn.query({\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n });\n\n console.log(results); // in this query, results will be an array of arrays rather than an array of objects\n console.log(fields); // fields are unchanged\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"conn.query(\n {\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n },\n function (err, results, fields) {\n console.log(results); // in this query, results will be an array of arrays rather than an array of objects\n console.log(fields); // fields are unchanged\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.admonition,{title:"Getting Help",type:"tip",children:(0,t.jsxs)(n.p,{children:["Need help? Ask your question on ",(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/tagged/mysql2",children:"Stack Overflow"})," or ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions",children:"GitHub"}),".\nIf you've encountered an issue, please ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues",children:"file it on GitHub"}),"."]})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const o={tabItem:"tabItem_Ymn6"};var r=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.Z)(o.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),o=s(512),r=s(2466),a=s(6550),l=s(469),i=s(1980),c=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:o}}=e;return{value:n,label:s,attributes:t,default:o}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const o=(0,a.k6)(),r=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(r),(0,t.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(o.location.search);n.set(r,e),o.replace({...o.location,search:n.toString()})}),[r,o])]}function x(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r}))),[c,d]=p({queryString:s,groupId:o}),[x,y]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,r]=(0,u.Nk)(s);return[o,(0,t.useCallback)((e=>{s&&r.set(e)}),[s,r])]}({groupId:o}),f=(()=>{const e=c??x;return m({value:e,tabValues:r})?e:null})();(0,l.Z)((()=>{f&&i(f)}),[f]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),y(e)}),[d,y,r]),tabValues:r}}var y=s(2389);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=s(5893);function g(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.o5)(),u=e=>{const n=e.currentTarget,s=i.indexOf(n),o=l[s].value;o!==t&&(c(n),a(o))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...r,className:(0,o.Z)("tabs__item",f.tabItem,r?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const r=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===o));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function v(e){const n=x(e);return(0,j.jsxs)("div",{className:(0,o.Z)("tabs-container",f.tabList),children:[(0,j.jsx)(g,{...e,...n}),(0,j.jsx)(b,{...e,...n})]})}function q(e){const n=(0,y.Z)();return(0,j.jsx)(v,{...e,children:d(e.children)},String(n))}},4442:(e,n,s)=>{s.d(n,{V:()=>r});var t=s(5742),o=s(5893);const r=e=>{let{title:n}=e;return(0,o.jsx)(t.Z,{children:(0,o.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>a});var t=s(7294);const o={},r=t.createContext(o);function a(e){const n=t.useContext(r);return t.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(o):e.components||o:a(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4edc808e.7f854e52.js b/assets/js/4edc808e.7f854e52.js new file mode 100644 index 0000000000..cf99d9616a --- /dev/null +++ b/assets/js/4edc808e.7f854e52.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4173],{7559:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>u,toc:()=>h});var t=s(5893),o=s(1151),r=s(4866),a=s(5162),l=s(4442);const i={slug:"/",position:1,title:"Quickstart",description:"MySQL client for Node.js with focus on performance"},c="MySQL2",u={id:"index",title:"Quickstart",description:"MySQL client for Node.js with focus on performance",source:"@site/docs/index.mdx",sourceDirName:".",slug:"/",permalink:"/node-mysql2/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/index.mdx",tags:[],version:"current",frontMatter:{slug:"/",position:1,title:"Quickstart",description:"MySQL client for Node.js with focus on performance"},sidebar:"docs",next:{title:"History and Why MySQL2",permalink:"/node-mysql2/docs/history-and-why-mysq2"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"First Query",id:"first-query",level:3},{value:"Using Prepared Statements",id:"using-prepared-statements",level:3},{value:"Using Connection Pools",id:"using-connection-pools",level:3},{value:"Using Promise Wrapper",id:"using-promise-wrapper",level:3},{value:"Array Results",id:"array-results",level:3},{value:"Connection Level",id:"connection-level",level:4},{value:"Query Level",id:"query-level",level:4}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.V,{title:"MySQL2 | Quickstart"}),"\n",(0,t.jsx)(n.h1,{id:"mysql2",children:"MySQL2"}),"\n","\n",(0,t.jsx)(n.p,{children:"MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more."}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/v/mysql2.svg",alt:"NPM Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/dm/mysql2.svg",alt:"NPM Downloads"})}),"\n",(0,t.jsx)(n.a,{href:"https://nodejs.org/download/",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/node/v/mysql2.svg",alt:"Node.js Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/blob/master/License",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000",alt:"License"})})]}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues."}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\n"})})}),(0,t.jsxs)(a.Z,{value:"TypeScript",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),(0,t.jsxs)(n.p,{children:["For TypeScript documentation and examples, see ",(0,t.jsx)(n.a,{href:"/docs/documentation/typescript-examples",children:"here"}),"."]})]})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"first-query",children:"First Query"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more queries examples, please visit the example sections ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,t.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// Get the client\nimport mysql from 'mysql2/promise';\n\n// Create the connection to database\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// A simple SELECT query\ntry {\n const [results, fields] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45'\n );\n\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n} catch (err) {\n console.log(err);\n}\n\n// Using placeholders\ntry {\n const [results] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45]\n );\n\n console.log(results);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// Get the client\nconst mysql = require('mysql2');\n\n// Create the connection to database\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// A simple SELECT query\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45',\n function (err, results, fields) {\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n }\n);\n\n// Using placeholders\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45],\n function (err, results) {\n console.log(results);\n }\n);\n"})})})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"using-prepared-statements",children:"Using Prepared Statements"}),"\n",(0,t.jsx)(n.p,{children:"With MySQL2 you also get the prepared statements. With prepared statements MySQL doesn't have to prepare plan for same query every time, this results in better performance. If you don't know why they are important, please check these discussions:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks",children:"How prepared statements can protect from SQL Injection attacks"})}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 provides ",(0,t.jsx)(n.code,{children:"execute"})," helper which will prepare and query the statement. You can also manually prepare / unprepare statement with ",(0,t.jsx)(n.code,{children:"prepare"})," / ",(0,t.jsx)(n.code,{children:"unprepare"})," methods."]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Prepared Statements and Placeholders examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // create the connection to database\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // execute will internally call prepare and query\n const [results, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53]\n );\n\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// create the connection to database\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// execute will internally call prepare and query\nconnection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53],\n function (err, results, fields) {\n console.log(results); // results contains rows returned by server\n console.log(fields); // fields contains extra meta data about results, if available\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsx)(n.p,{children:"If you execute same statement again, it will be picked from a LRU cache which will save query preparation time and give better performance."})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"using-connection-pools",children:"Using Connection Pools"}),"\n",(0,t.jsx)(n.p,{children:"Connection pools help reduce the time spent connecting to the MySQL server by reusing a previous connection, leaving them open instead of closing when you are done with them."}),"\n",(0,t.jsx)(n.p,{children:"This improves the latency of queries as you avoid all of the overhead that comes with establishing a new connection."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Connection Pools examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/connections/create-pool",children:(0,t.jsx)(n.strong,{children:"createPool"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\n// Create the connection pool. The pool-specific settings are the defaults\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// Create the connection pool. The pool-specific settings are the defaults\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"The pool does not create all connections upfront but creates them on demand until the connection limit is reached."})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsxs)(n.p,{children:["You can use the pool in the same way as connections (using ",(0,t.jsx)(n.code,{children:"pool.query()"})," and ",(0,t.jsx)(n.code,{children:"pool.execute()"}),"):"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n // For pool initialization, see above\n const [rows, fields] = await pool.query('SELECT `field` FROM `table`');\n // Connection is automatically released when query resolves\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.query('SELECT `field` FROM `table`', function (err, rows, fields) {\n // Connection is automatically released when query resolves\n});\n"})})})]}),"\n",(0,t.jsx)(n.p,{children:"Alternatively, there is also the possibility of manually acquiring a connection from the pool and returning it later:"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\nconst conn = await pool.getConnection();\n\n// Do something with the connection\nawait conn.query(/* ... */);\n\n// Don't forget to release the connection when finished!\npool.releaseConnection(conn);\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.getConnection(function (err, conn) {\n // Do something with the connection\n conn.query(/* ... */);\n\n // Don't forget to release the connection when finished!\n pool.releaseConnection(conn);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Additionally, directly release the connection using the ",(0,t.jsx)(n.code,{children:"connection"})," object:"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"conn.release();\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"using-promise-wrapper",children:"Using Promise Wrapper"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 also support Promise API. Which works very well with ES7 async await."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nasync function main() {\n // create the connection\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // query database\n const [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n );\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 use default ",(0,t.jsx)(n.code,{children:"Promise"})," object available in scope. But you can choose which ",(0,t.jsx)(n.code,{children:"Promise"})," implementation you want to use."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// get the client\nimport mysql from 'mysql2/promise';\n\n// get the promise implementation, we will use bluebird\nimport bluebird from 'bluebird';\n\n// create the connection, specify bluebird as Promise\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n Promise: bluebird,\n});\n\n// query database\nconst [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n);\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 also exposes a ",(0,t.jsx)(n.code,{children:".promise()"})," function on Pools, so you can create a promise/non-promise connections from the same pool."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2';\n\nasync function main() {\n // create the pool\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // now get a Promise wrapped instance of that pool\n const promisePool = pool.promise();\n\n // query database using promises\n const [rows, fields] = await promisePool.query('SELECT 1');\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 exposes a ",(0,t.jsx)(n.code,{children:".promise()"}),' function on Connections, to "upgrade" an existing non-promise connection to use promise.']}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const mysql = require('mysql2');\n\n// create the connection\nconst conn = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\nconn\n .promise()\n .query('SELECT 1')\n .then(([rows, fields]) => {\n console.log(rows);\n })\n .catch(console.log)\n .then(() => conn.end());\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"array-results",children:"Array Results"}),"\n",(0,t.jsxs)(n.p,{children:["If you have two columns with the same name, you might want to get results as an array rather than an object to prevent them from clashing. This is a deviation from the ",(0,t.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," library."]}),"\n",(0,t.jsxs)(n.p,{children:["For example: ",(0,t.jsx)(n.code,{children:"SELECT 1 AS `foo`, 2 AS `foo`"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"You can enable this setting at either the connection level (applies to all queries), or at the query level (applies only to that specific query)."}),"\n",(0,t.jsx)(n.h4,{id:"connection-level",children:"Connection Level"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = await mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})})]}),"\n",(0,t.jsx)(n.h4,{id:"query-level",children:"Query Level"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(a.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"try {\n const [results, fields] = await conn.query({\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n });\n\n console.log(results); // in this query, results will be an array of arrays rather than an array of objects\n console.log(fields); // fields are unchanged\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"conn.query(\n {\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n },\n function (err, results, fields) {\n console.log(results); // in this query, results will be an array of arrays rather than an array of objects\n console.log(fields); // fields are unchanged\n }\n);\n"})})})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.admonition,{title:"Getting Help",type:"tip",children:(0,t.jsxs)(n.p,{children:["Need help? Ask your question on ",(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/tagged/mysql2",children:"Stack Overflow"})," or ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions",children:"GitHub"}),".\nIf you've encountered an issue, please ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues",children:"file it on GitHub"}),"."]})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const o={tabItem:"tabItem_Ymn6"};var r=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.Z)(o.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),o=s(512),r=s(2466),a=s(6550),l=s(469),i=s(1980),c=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:o}}=e;return{value:n,label:s,attributes:t,default:o}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const o=(0,a.k6)(),r=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(r),(0,t.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(o.location.search);n.set(r,e),o.replace({...o.location,search:n.toString()})}),[r,o])]}function x(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r}))),[c,d]=p({queryString:s,groupId:o}),[x,y]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,r]=(0,u.Nk)(s);return[o,(0,t.useCallback)((e=>{s&&r.set(e)}),[s,r])]}({groupId:o}),f=(()=>{const e=c??x;return m({value:e,tabValues:r})?e:null})();(0,l.Z)((()=>{f&&i(f)}),[f]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),y(e)}),[d,y,r]),tabValues:r}}var y=s(2389);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=s(5893);function g(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.o5)(),u=e=>{const n=e.currentTarget,s=i.indexOf(n),o=l[s].value;o!==t&&(c(n),a(o))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...r,className:(0,o.Z)("tabs__item",f.tabItem,r?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const r=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===o));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function v(e){const n=x(e);return(0,j.jsxs)("div",{className:(0,o.Z)("tabs-container",f.tabList),children:[(0,j.jsx)(g,{...e,...n}),(0,j.jsx)(b,{...e,...n})]})}function q(e){const n=(0,y.Z)();return(0,j.jsx)(v,{...e,children:d(e.children)},String(n))}},4442:(e,n,s)=>{s.d(n,{V:()=>r});var t=s(5742),o=s(5893);const r=e=>{let{title:n}=e;return(0,o.jsx)(t.Z,{children:(0,o.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>a});var t=s(7294);const o={},r=t.createContext(o);function a(e){const n=t.useContext(r);return t.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(o):e.components||o:a(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/54768732.2ebf0dd6.js b/assets/js/54768732.2ebf0dd6.js new file mode 100644 index 0000000000..8220e1eb31 --- /dev/null +++ b/assets/js/54768732.2ebf0dd6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[576],{3990:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>u,metadata:()=>d,toc:()=>p});var t=r(5893),s=r(1151),l=r(4866),a=r(5162),o=r(6393),i=r(4379);const u={sidebar_position:2,tags:["query"]},c="UPDATE",d={id:"examples/queries/simple-queries/update",title:"UPDATE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/update.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/update",permalink:"/node-mysql2/docs/examples/queries/simple-queries/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/update.mdx",tags:[{label:"query",permalink:"/node-mysql2/docs/tags/query"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["query"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/docs/examples/queries/simple-queries/select"},next:{title:"DELETE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/delete"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,t.jsxs)(n.p,{children:["The examples below also work for the ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,t.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["query(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>a});r(7294);var t=r(512);const s={tabItem:"tabItem_Ymn6"};var l=r(5893);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var t=r(7294),s=r(512),l=r(2466),a=r(6550),o=r(469),i=r(1980),u=r(7392),c=r(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,u.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[u,d]=m({queryString:r,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,c.Nk)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),b=(()=>{const e=u??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=r(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=r(5893);function j(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.o5)(),c=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(u(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:c,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function q(e){let{lazy:n,children:r,selectedValue:s}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...n}),(0,g.jsx)(q,{...e,...n})]})}function v(e){const n=(0,f.Z)();return(0,g.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var t=r(7294),s=r(2263),l=r(9286),a=r(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:u}=e;const[c,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(n)?`${b}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(g,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&u?((e,n,r)=>{const t=e.split("\n"),s=`${r} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,u):e;d(n||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,u]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${r}`,children:c})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var t=r(4673),s=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,s.jsx)(t.Z,{open:r,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/54768732.7adc3ec4.js b/assets/js/54768732.7adc3ec4.js deleted file mode 100644 index 2238e60c91..0000000000 --- a/assets/js/54768732.7adc3ec4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[576],{3990:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>u,metadata:()=>d,toc:()=>p});var t=n(5893),s=n(1151),l=n(4866),a=n(5162),o=n(6393),i=n(4379);const u={sidebar_position:2,tags:["query"]},c="UPDATE",d={id:"examples/queries/simple-queries/update",title:"UPDATE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/update.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/update",permalink:"/node-mysql2/docs/examples/queries/simple-queries/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/update.mdx",tags:[{label:"query",permalink:"/node-mysql2/docs/tags/query"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["query"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/docs/examples/queries/simple-queries/select"},next:{title:"DELETE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/delete"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const r={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.h1,{id:"update",children:"UPDATE"}),"\n",(0,t.jsxs)(r.p,{children:["The examples below also work for the ",(0,t.jsx)(r.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,t.jsx)(r.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(r.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsxs)(r.strong,{children:["query(options: ",(0,t.jsx)(r.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(r.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(r.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,r,n)=>{n.d(r,{Z:()=>a});n(7294);var t=n(512);const s={tabItem:"tabItem_Ymn6"};var l=n(5893);function a(e){let{children:r,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:n,children:r})}},4866:(e,r,n)=>{n.d(r,{Z:()=>v});var t=n(7294),s=n(512),l=n(2466),a=n(6550),o=n(469),i=n(1980),u=n(7392),c=n(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:n}=e;return(0,t.useMemo)((()=>{const e=r??function(e){return d(e).map((e=>{let{props:{value:r,label:n,attributes:t,default:s}}=e;return{value:r,label:n,attributes:t,default:s}}))}(n);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,n])}function p(e){let{value:r,tabValues:n}=e;return n.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:n}=e;const s=(0,a.k6)(),l=function(e){let{queryString:r=!1,groupId:n}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:r,groupId:n});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const r=new URLSearchParams(s.location.search);r.set(l,e),s.replace({...s.location,search:r.toString()})}),[l,s])]}function x(e){const{defaultValue:r,queryString:n=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:r,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:r,tabValues:l}))),[u,d]=m({queryString:n,groupId:s}),[x,f]=function(e){let{groupId:r}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,l]=(0,c.Nk)(n);return[s,(0,t.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:s}),b=(()=>{const e=u??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(5893);function j(e){let{className:r,block:n,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.o5)(),c=e=>{const r=e.currentTarget,n=i.indexOf(r),s=o[n].value;s!==t&&(u(r),a(s))},d=e=>{let r=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;r=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;r=i[n]??i[i.length-1];break}}r?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},r),children:o.map((e=>{let{value:r,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===r?0:-1,"aria-selected":t===r,ref:e=>i.push(e),onKeyDown:d,onClick:c,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===r}),children:n??r},r)}))})}function q(e){let{lazy:r,children:n,selectedValue:s}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(r){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,r)=>(0,t.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function y(e){const r=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...r}),(0,g.jsx)(q,{...e,...r})]})}function v(e){const r=(0,f.Z)();return(0,g.jsx)(y,{...e,children:d(e.children)},String(r))}},4379:(e,r,n)=>{n.d(r,{I:()=>i});var t=n(7294),s=n(2263),l=n(9286),a=n(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:r,language:n,extractMethod:i,methodType:u}=e;const[c,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(r)?`${b}${r}`:r;return(0,t.useEffect)((()=>{const e=new AbortController,r=e.signal;return fetch(g,{signal:r}).then((e=>e.text())).then((e=>{const r=i&&u?((e,r,n)=>{const t=e.split("\n"),s=`${n} ${r}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,u):e;d(r||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,u]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${n}`,children:c})})})}},6393:(e,r,n)=>{n.d(r,{Z:()=>l});var t=n(4673),s=n(5893);const l=e=>{let{children:r,open:n,title:l}=e;return(0,s.jsx)(t.Z,{open:n,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:r})})}}}]); \ No newline at end of file diff --git a/assets/js/54eaaaae.09adf8e5.js b/assets/js/54eaaaae.09adf8e5.js new file mode 100644 index 0000000000..b64ed775f3 --- /dev/null +++ b/assets/js/54eaaaae.09adf8e5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1420],{1:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>h,toc:()=>p});var s=o(5893),r=o(1151),l=o(4866),t=o(5162),c=o(6393),i=o(4379);const a={sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},d="createPool",h={id:"examples/connections/create-pool",title:"createPool",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-pool.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-pool",permalink:"/node-mysql2/docs/examples/connections/create-pool",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-pool.mdx",tags:[{label:"createPool",permalink:"/node-mysql2/docs/tags/create-pool"},{label:"URI",permalink:"/node-mysql2/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/docs/tags/socks"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createConnection",permalink:"/node-mysql2/docs/examples/connections/create-connection"},next:{title:"createPoolCluster",permalink:"/node-mysql2/docs/examples/connections/createPoolCluster"}},u={},p=[{value:"createPool(connectionUri)",id:"createpoolconnectionuri",level:2},{value:"createPool(config)",id:"createpoolconfig",level:2},{value:"createPool(config) \u2014 SHA1",id:"createpoolconfig--sha1",level:2},{value:"createPool(config) \u2014 SSL",id:"createpoolconfig--ssl",level:2},{value:"createPool(config) \u2014 RDS SSL",id:"createpoolconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createPool(config) \u2014 Socks",id:"createpoolconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"createpool",children:"createPool"}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["For queries please see the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,s.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,s.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconnectionuri",children:"createPool(connectionUri)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"createPool(connectionUri: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig",children:"createPool(config)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--sha1",children:"createPool(config) \u2014 SHA1"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--ssl",children:"createPool(config) \u2014 SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,s.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,s.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["See ",(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--rds-ssl",children:"createPool(config) \u2014 RDS SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can use ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,s.jsxs)(n.p,{children:["In that case ",(0,s.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await pool.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,s.jsxs)(t.Z,{value:"callback.js",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n pool.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Issues"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--socks",children:"createPool(config) \u2014 Socks"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"A.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst pool = mysql.createPool({\n stream: socksProxy,\n});\n// highlight-end\n"})})}),(0,s.jsx)(t.Z,{value:"B.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst pool = mysql.createPool({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,s.jsxs)("blockquote",{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,s.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),(0,s.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]}),"\n",(0,s.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},5162:(e,n,o)=>{o.d(n,{Z:()=>t});o(7294);var s=o(512);const r={tabItem:"tabItem_Ymn6"};var l=o(5893);function t(e){let{children:n,hidden:o,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,t),hidden:o,children:n})}},4866:(e,n,o)=>{o.d(n,{Z:()=>S});var s=o(7294),r=o(512),l=o(2466),t=o(6550),c=o(469),i=o(1980),a=o(7392),d=o(12);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:o,attributes:s,default:r}}=e;return{value:n,label:o,attributes:s,default:r}}))}(o);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function p(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:o}=e;const r=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function g(e){const{defaultValue:n,queryString:o=!1,groupId:r}=e,l=u(e),[t,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=o.find((e=>e.default))??o[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[a,h]=m({queryString:o,groupId:r}),[g,x]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,d.Nk)(o);return[r,(0,s.useCallback)((e=>{o&&l.set(e)}),[o,l])]}({groupId:r}),j=(()=>{const e=a??g;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)}),[h,x,l]),tabValues:l}}var x=o(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=o(5893);function y(e){let{className:n,block:o,selectedValue:s,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,o=i.indexOf(n),r=c[o].value;r!==s&&(a(n),t(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":o},n),children:c.map((e=>{let{value:n,label:o,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:h,onClick:d,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:o??n},n)}))})}function b(e){let{lazy:n,children:o,selectedValue:r}=e;const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:h(e.children)},String(n))}},4379:(e,n,o)=>{o.d(n,{I:()=>i});var s=o(7294),r=o(2263),l=o(9286),t=o(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:o,extractMethod:i,methodType:a}=e;const[d,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(!0),[m,g]=(0,s.useState)(!0),{siteConfig:x}=(0,r.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,o)=>{const s=e.split("\n"),r=`${o} ${n}`;let l=!1,t=0,c="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;h(n||e),p(!1),g(!1)})).catch((()=>{g(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:u?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:m?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${o}`,children:d})})})}},6393:(e,n,o)=>{o.d(n,{Z:()=>l});var s=o(4673),r=o(5893);const l=e=>{let{children:n,open:o,title:l}=e;return(0,r.jsx)(s.Z,{open:o,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/54eaaaae.22d6bdf5.js b/assets/js/54eaaaae.22d6bdf5.js deleted file mode 100644 index 6798dab7c5..0000000000 --- a/assets/js/54eaaaae.22d6bdf5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1420],{1:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>h,toc:()=>p});var s=o(5893),r=o(1151),l=o(4866),t=o(5162),c=o(6393),i=o(4379);const a={sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},d="createPool",h={id:"examples/connections/create-pool",title:"createPool",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-pool.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-pool",permalink:"/node-mysql2/docs/examples/connections/create-pool",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-pool.mdx",tags:[{label:"createPool",permalink:"/node-mysql2/docs/tags/create-pool"},{label:"URI",permalink:"/node-mysql2/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/docs/tags/socks"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createConnection",permalink:"/node-mysql2/docs/examples/connections/create-connection"},next:{title:"createPoolCluster",permalink:"/node-mysql2/docs/examples/connections/createPoolCluster"}},u={},p=[{value:"createPool(connectionUri)",id:"createpoolconnectionuri",level:2},{value:"createPool(config)",id:"createpoolconfig",level:2},{value:"createPool(config) \u2014 SHA1",id:"createpoolconfig--sha1",level:2},{value:"createPool(config) \u2014 SSL",id:"createpoolconfig--ssl",level:2},{value:"createPool(config) \u2014 RDS SSL",id:"createpoolconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createPool(config) \u2014 Socks",id:"createpoolconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"createpool",children:"createPool"}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["For queries please see the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,s.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,s.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconnectionuri",children:"createPool(connectionUri)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"createPool(connectionUri: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig",children:"createPool(config)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--sha1",children:"createPool(config) \u2014 SHA1"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--ssl",children:"createPool(config) \u2014 SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,s.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,s.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["See ",(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--rds-ssl",children:"createPool(config) \u2014 RDS SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can use ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,s.jsxs)(n.p,{children:["In that case ",(0,s.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await pool.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,s.jsxs)(t.Z,{value:"callback.js",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n pool.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Issues"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--socks",children:"createPool(config) \u2014 Socks"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"A.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst pool = mysql.createPool({\n stream: socksProxy,\n});\n// highlight-end\n"})})}),(0,s.jsx)(t.Z,{value:"B.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst pool = mysql.createPool({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,s.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),"\n",(0,s.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})}),"\n"]}),"\n",(0,s.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},5162:(e,n,o)=>{o.d(n,{Z:()=>t});o(7294);var s=o(512);const r={tabItem:"tabItem_Ymn6"};var l=o(5893);function t(e){let{children:n,hidden:o,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,t),hidden:o,children:n})}},4866:(e,n,o)=>{o.d(n,{Z:()=>S});var s=o(7294),r=o(512),l=o(2466),t=o(6550),c=o(469),i=o(1980),a=o(7392),d=o(12);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:o,attributes:s,default:r}}=e;return{value:n,label:o,attributes:s,default:r}}))}(o);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function p(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:o}=e;const r=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function g(e){const{defaultValue:n,queryString:o=!1,groupId:r}=e,l=u(e),[t,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=o.find((e=>e.default))??o[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[a,h]=m({queryString:o,groupId:r}),[g,x]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,d.Nk)(o);return[r,(0,s.useCallback)((e=>{o&&l.set(e)}),[o,l])]}({groupId:r}),j=(()=>{const e=a??g;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)}),[h,x,l]),tabValues:l}}var x=o(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=o(5893);function y(e){let{className:n,block:o,selectedValue:s,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,o=i.indexOf(n),r=c[o].value;r!==s&&(a(n),t(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":o},n),children:c.map((e=>{let{value:n,label:o,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:h,onClick:d,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:o??n},n)}))})}function b(e){let{lazy:n,children:o,selectedValue:r}=e;const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:h(e.children)},String(n))}},4379:(e,n,o)=>{o.d(n,{I:()=>i});var s=o(7294),r=o(2263),l=o(9286),t=o(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:o,extractMethod:i,methodType:a}=e;const[d,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(!0),[m,g]=(0,s.useState)(!0),{siteConfig:x}=(0,r.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,o)=>{const s=e.split("\n"),r=`${o} ${n}`;let l=!1,t=0,c="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;h(n||e),p(!1),g(!1)})).catch((()=>{g(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:u?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:m?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${o}`,children:d})})})}},6393:(e,n,o)=>{o.d(n,{Z:()=>l});var s=o(4673),r=o(5893);const l=e=>{let{children:n,open:o,title:l}=e;return(0,r.jsx)(s.Z,{open:o,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/57495183.a3a923b6.js b/assets/js/57495183.a3a923b6.js new file mode 100644 index 0000000000..d6ae0272f6 --- /dev/null +++ b/assets/js/57495183.a3a923b6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5003],{4304:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>t,metadata:()=>c,toc:()=>o});var r=s(5893),i=s(1151);const t={},l="MySQL Server API",c={id:"documentation/mysql-server",title:"MySQL Server API",description:"Server",source:"@site/docs/documentation/mysql-server.mdx",sourceDirName:"documentation",slug:"/documentation/mysql-server",permalink:"/node-mysql2/docs/documentation/mysql-server",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/mysql-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Extra Features",permalink:"/node-mysql2/docs/documentation/extras"},next:{title:"Prepared Statements",permalink:"/node-mysql2/docs/documentation/prepared-statements"}},d={},o=[{value:"Server",id:"server",level:2},{value:"Events",id:"events",level:3},{value:"Connection",id:"connection",level:2},{value:"Events",id:"events-1",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"mysql-server-api",children:"MySQL Server API"}),"\n",(0,r.jsx)(n.h2,{id:"server",children:"Server"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"createServer()"})," - creates server instance"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Server.listen"})," - listen port / unix socket (same arguments as ",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback",children:"net.Server.listen"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events",children:"Events"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"connect"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"new incoming connection."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"connection",children:"Connection"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send server handshake initialisation packet, wait handshake response and start listening for commands"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeOk({ affectedRows: num, insertId: num })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["send ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/overview.html#packet-OK_Packet",children:"OK packet"})," to client"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeEof(warnings, statusFlags)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send EOF packet"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextResult(rows, fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["write query result to client. Rows and fields are in the same format as in ",(0,r.jsx)(n.code,{children:"connection.query"})," callback."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeColumns(fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write fields + EOF packets."}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextRow(row)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write array (not hash!) of values as result row"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"TODO:"})," binary protocol"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events-1",children:"Events"}),"\n",(0,r.jsxs)(n.p,{children:["Every command packet received by the server will be emitted as a ",(0,r.jsx)(n.strong,{children:"packet"})," event with the parameters:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"packet:"})," Packet","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The packet itself"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"knownCommand:"})," boolean","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"is this command known to the server"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"*commandCode:"})," number","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"the parsed command code (first byte)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["In addition special events are emitted for ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/text-protocol.html",children:"commands"})," received from the client. If no listener is present a fallback behavior will be invoked."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"quit()"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: close the connection"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"init_db(schemaName: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return OK"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"query(sql: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"field_list(table: string, fields: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return ER_WARN_DEPRECATED_SYNTAX"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"ping()"})," - Default: return OK"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>l});var r=s(7294);const i={},t=r.createContext(i);function l(e){const n=r.useContext(t);return r.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(i):e.components||i:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/57495183.d7fc7e0f.js b/assets/js/57495183.d7fc7e0f.js deleted file mode 100644 index 711601395d..0000000000 --- a/assets/js/57495183.d7fc7e0f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5003],{4304:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>t,metadata:()=>c,toc:()=>o});var r=s(5893),i=s(1151);const t={},l="MySQL Server API",c={id:"documentation/mysql-server",title:"MySQL Server API",description:"Server",source:"@site/docs/documentation/mysql-server.mdx",sourceDirName:"documentation",slug:"/documentation/mysql-server",permalink:"/node-mysql2/docs/documentation/mysql-server",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/mysql-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Extra Features",permalink:"/node-mysql2/docs/documentation/extras"},next:{title:"Prepared Statements",permalink:"/node-mysql2/docs/documentation/prepared-statements"}},d={},o=[{value:"Server",id:"server",level:2},{value:"Events",id:"events",level:3},{value:"Connection",id:"connection",level:2},{value:"Events",id:"events-1",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"mysql-server-api",children:"MySQL Server API"}),"\n",(0,r.jsx)(n.h2,{id:"server",children:"Server"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"createServer()"})," - creates server instance"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Server.listen"})," - listen port / unix socket (same arguments as ",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback",children:"net.Server.listen"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events",children:"Events"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"connect"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"new incoming connection."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"connection",children:"Connection"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send server handshake initialisation packet, wait handshake response and start listening for commands"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeOk({ affectedRows: num, insertId: num })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["send ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/overview.html#packet-OK_Packet",children:"OK packet"})," to client"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeEof(warnings, statusFlags)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send EOF packet"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextResult(rows, fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["write query result to client. Rows and fields are in the same format as in ",(0,r.jsx)(n.code,{children:"connection.query"})," callback."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeColumns(fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write fields + EOF packets."}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextRow(row)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write array (not hash!) of values as result row"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"TODO:"})," binary protocol"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events-1",children:"Events"}),"\n",(0,r.jsxs)(n.p,{children:["Every command packet received by the server will be emitted as a ",(0,r.jsx)(n.strong,{children:"packet"})," event with the parameters:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"packet:"})," Packet","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The packet itself"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"knownCommand:"})," boolean","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"is this command known to the server"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"*commandCode:"})," number","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"the parsed command code (first byte)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["In addition special events are emitted for ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/text-protocol.html",children:"commands"})," received from the client. If no listener is present a fallback behavior will be invoked."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"quit()"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: close the connection"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"init_db(schemaName: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return OK"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"query(sql: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"field_list(table: string, fields: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return ER_WARN_DEPRECATED_SYNTAX"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"ping()"})," - Default: return OK"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>l});var r=s(7294);const i={},t=r.createContext(i);function l(e){const n=r.useContext(t);return r.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(i):e.components||i:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/59e52bc2.2b8c3e3c.js b/assets/js/59e52bc2.2b8c3e3c.js deleted file mode 100644 index dbcc2dc863..0000000000 --- a/assets/js/59e52bc2.2b8c3e3c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[641],{8602:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>h,contentTitle:()=>u,default:()=>x,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=n(5893),s=n(1151),l=n(4866),a=n(5162),o=n(6393),i=n(4379);const c={sidebar_position:3,tags:["query"]},u="DELETE",d={id:"examples/queries/simple-queries/delete",title:"DELETE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/delete.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/delete",permalink:"/node-mysql2/docs/examples/queries/simple-queries/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/delete.mdx",tags:[{label:"query",permalink:"/node-mysql2/docs/tags/query"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["query"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/update"},next:{title:"Prepared Statements",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const r={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.h1,{id:"delete",children:"DELETE"}),"\n",(0,t.jsxs)(r.p,{children:["The examples below also work for the ",(0,t.jsx)(r.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,t.jsx)(r.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(r.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsxs)(r.strong,{children:["query(options: ",(0,t.jsx)(r.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(r.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(r.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,r,n)=>{n.d(r,{Z:()=>a});n(7294);var t=n(512);const s={tabItem:"tabItem_Ymn6"};var l=n(5893);function a(e){let{children:r,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:n,children:r})}},4866:(e,r,n)=>{n.d(r,{Z:()=>v});var t=n(7294),s=n(512),l=n(2466),a=n(6550),o=n(469),i=n(1980),c=n(7392),u=n(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:n}=e;return(0,t.useMemo)((()=>{const e=r??function(e){return d(e).map((e=>{let{props:{value:r,label:n,attributes:t,default:s}}=e;return{value:r,label:n,attributes:t,default:s}}))}(n);return function(e){const r=(0,c.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,n])}function p(e){let{value:r,tabValues:n}=e;return n.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:n}=e;const s=(0,a.k6)(),l=function(e){let{queryString:r=!1,groupId:n}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:r,groupId:n});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const r=new URLSearchParams(s.location.search);r.set(l,e),s.replace({...s.location,search:r.toString()})}),[l,s])]}function x(e){const{defaultValue:r,queryString:n=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:r,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:r,tabValues:l}))),[c,d]=m({queryString:n,groupId:s}),[x,f]=function(e){let{groupId:r}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,l]=(0,u.Nk)(n);return[s,(0,t.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:s}),b=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(5893);function j(e){let{className:r,block:n,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const r=e.currentTarget,n=i.indexOf(r),s=o[n].value;s!==t&&(c(r),a(s))},d=e=>{let r=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;r=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;r=i[n]??i[i.length-1];break}}r?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},r),children:o.map((e=>{let{value:r,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===r?0:-1,"aria-selected":t===r,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===r}),children:n??r},r)}))})}function y(e){let{lazy:r,children:n,selectedValue:s}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(r){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,r)=>(0,t.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function q(e){const r=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...r}),(0,g.jsx)(y,{...e,...r})]})}function v(e){const r=(0,f.Z)();return(0,g.jsx)(q,{...e,children:d(e.children)},String(r))}},4379:(e,r,n)=>{n.d(r,{I:()=>i});var t=n(7294),s=n(2263),l=n(9286),a=n(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:r,language:n,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(r)?`${b}${r}`:r;return(0,t.useEffect)((()=>{const e=new AbortController,r=e.signal;return fetch(g,{signal:r}).then((e=>e.text())).then((e=>{const r=i&&c?((e,r,n)=>{const t=e.split("\n"),s=`${n} ${r}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(r||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${n}`,children:u})})})}},6393:(e,r,n)=>{n.d(r,{Z:()=>l});var t=n(4673),s=n(5893);const l=e=>{let{children:r,open:n,title:l}=e;return(0,s.jsx)(t.Z,{open:n,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:r})})}}}]); \ No newline at end of file diff --git a/assets/js/59e52bc2.58047b61.js b/assets/js/59e52bc2.58047b61.js new file mode 100644 index 0000000000..b52988890b --- /dev/null +++ b/assets/js/59e52bc2.58047b61.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[641],{8602:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>x,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=r(5893),s=r(1151),l=r(4866),a=r(5162),o=r(6393),i=r(4379);const c={sidebar_position:3,tags:["query"]},u="DELETE",d={id:"examples/queries/simple-queries/delete",title:"DELETE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/delete.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/delete",permalink:"/node-mysql2/docs/examples/queries/simple-queries/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/delete.mdx",tags:[{label:"query",permalink:"/node-mysql2/docs/tags/query"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["query"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/update"},next:{title:"Prepared Statements",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,t.jsxs)(n.p,{children:["The examples below also work for the ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,t.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["query(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>a});r(7294);var t=r(512);const s={tabItem:"tabItem_Ymn6"};var l=r(5893);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var t=r(7294),s=r(512),l=r(2466),a=r(6550),o=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=m({queryString:r,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,u.Nk)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),b=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=r(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=r(5893);function j(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(c(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:s}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function q(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...n}),(0,g.jsx)(y,{...e,...n})]})}function v(e){const n=(0,f.Z)();return(0,g.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var t=r(7294),s=r(2263),l=r(9286),a=r(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(n)?`${b}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(g,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const t=e.split("\n"),s=`${r} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var t=r(4673),s=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,s.jsx)(t.Z,{open:r,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/7ccab252.53d7e12b.js b/assets/js/7ccab252.53d7e12b.js deleted file mode 100644 index 083a7a7911..0000000000 --- a/assets/js/7ccab252.53d7e12b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8054],{3467:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>a,metadata:()=>d,toc:()=>l});var n=t(5893),r=t(1151);const a={},i="Prepared Statements",d={id:"examples/queries/prepared-statements/index",title:"Prepared Statements",description:"MySQL2 provides execute helper which will prepare and query the statement.",source:"@site/docs/examples/queries/prepared-statements/index.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"DELETE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/delete"},next:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/insert"}},c={},l=[];function p(e){const s={a:"a",admonition:"admonition",code:"code",h1:"h1",hr:"hr",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h1,{id:"prepared-statements",children:"Prepared Statements"}),"\n",(0,n.jsxs)(s.p,{children:["MySQL2 provides ",(0,n.jsx)(s.code,{children:"execute"})," helper which will prepare and query the statement.\nYou can also manually prepare / unprepare statement with ",(0,n.jsx)(s.code,{children:"prepare"})," / ",(0,n.jsx)(s.code,{children:"unprepare"})," methods."]}),"\n",(0,n.jsxs)(s.p,{children:["See detailed documentaion in ",(0,n.jsx)(s.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"}),"."]}),"\n",(0,n.jsx)(s.admonition,{type:"tip",children:(0,n.jsxs)(s.p,{children:["If you execute same statement again, it will be picked form a ",(0,n.jsx)(s.strong,{children:"LRU cache"})," which will save query preparation time and give better performance."]})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,n.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/insert",children:(0,n.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,n.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,n.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,n.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function o(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},1151:(e,s,t)=>{t.d(s,{Z:()=>d,a:()=>i});var n=t(7294);const r={},a=n.createContext(r);function i(e){const s=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7ccab252.f82d2892.js b/assets/js/7ccab252.f82d2892.js new file mode 100644 index 0000000000..595b85c081 --- /dev/null +++ b/assets/js/7ccab252.f82d2892.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8054],{3467:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>a,metadata:()=>d,toc:()=>l});var n=t(5893),r=t(1151);const a={},i="Prepared Statements",d={id:"examples/queries/prepared-statements/index",title:"Prepared Statements",description:"MySQL2 provides execute helper which will prepare and query the statement.",source:"@site/docs/examples/queries/prepared-statements/index.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"DELETE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/delete"},next:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/insert"}},c={},l=[];function p(e){const s={a:"a",admonition:"admonition",code:"code",h1:"h1",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h1,{id:"prepared-statements",children:"Prepared Statements"}),"\n",(0,n.jsxs)(s.p,{children:["MySQL2 provides ",(0,n.jsx)(s.code,{children:"execute"})," helper which will prepare and query the statement.\nYou can also manually prepare / unprepare statement with ",(0,n.jsx)(s.code,{children:"prepare"})," / ",(0,n.jsx)(s.code,{children:"unprepare"})," methods."]}),"\n",(0,n.jsxs)(s.p,{children:["See detailed documentaion in ",(0,n.jsx)(s.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"}),"."]}),"\n",(0,n.jsx)(s.admonition,{type:"tip",children:(0,n.jsxs)(s.p,{children:["If you execute same statement again, it will be picked form a ",(0,n.jsx)(s.strong,{children:"LRU cache"})," which will save query preparation time and give better performance."]})}),"\n",(0,n.jsx)("hr",{}),"\n",(0,n.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,n.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/insert",children:(0,n.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,n.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,n.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,n.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function o(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},1151:(e,s,t)=>{t.d(s,{Z:()=>d,a:()=>i});var n=t(7294);const r={},a=n.createContext(r);function i(e){const s=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7fbd6b3a.80d8bb64.js b/assets/js/7fbd6b3a.80d8bb64.js new file mode 100644 index 0000000000..b111f2d015 --- /dev/null +++ b/assets/js/7fbd6b3a.80d8bb64.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9964],{8937:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>i,metadata:()=>d,toc:()=>p});var r=s(5893),t=s(1151),l=s(4866),a=s(5162),o=s(6393),c=s(4379);const i={sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="SELECT",d={id:"examples/queries/prepared-statements/select",title:"SELECT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/select.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/select",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/select.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/update"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,r.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-next-line\n const [rows, fields] = await connection.execute(sql, values);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(sql, values, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,r.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,r.jsx)(c.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var r=s(7294),t=s(512),l=s(2466),a=s(6550),o=s(469),c=s(1980),i=s(7392),u=s(12);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,i.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const t=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,l=h(e),[a,c]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[i,d]=x({queryString:s,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:t}),j=(()=>{const e=i??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&c(j)}),[j]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:r,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),t=o[s].value;t!==r&&(i(n),a(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>c.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:t}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var r=s(7294),t=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:i}=e;const[u,d]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[x,m]=(0,r.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&i?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let l=!1,a=0,o="";for(const c of r)if(c.includes(t)&&(l=!0),l&&(c.includes("{")&&a++,o+=c+"\n",c.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,c,i):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,c,i]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),t=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/7fbd6b3a.b2a4ea36.js b/assets/js/7fbd6b3a.b2a4ea36.js deleted file mode 100644 index 964d33c3b0..0000000000 --- a/assets/js/7fbd6b3a.b2a4ea36.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9964],{8937:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>i,metadata:()=>d,toc:()=>p});var r=s(5893),t=s(1151),l=s(4866),a=s(5162),o=s(6393),c=s(4379);const i={sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="SELECT",d={id:"examples/queries/prepared-statements/select",title:"SELECT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/select.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/select",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/select.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/update"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,r.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-next-line\n const [rows, fields] = await connection.execute(sql, values);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(sql, values, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,r.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,r.jsx)(c.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var r=s(7294),t=s(512),l=s(2466),a=s(6550),o=s(469),c=s(1980),i=s(7392),u=s(12);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,i.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const t=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,l=h(e),[a,c]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[i,d]=x({queryString:s,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:t}),j=(()=>{const e=i??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&c(j)}),[j]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:r,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),t=o[s].value;t!==r&&(i(n),a(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>c.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:t}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var r=s(7294),t=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:i}=e;const[u,d]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[x,m]=(0,r.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&i?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let l=!1,a=0,o="";for(const c of r)if(c.includes(t)&&(l=!0),l&&(c.includes("{")&&a++,o+=c+"\n",c.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,c,i):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,c,i]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),t=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/8b8ccc10.1c3b82e9.js b/assets/js/8b8ccc10.1c3b82e9.js deleted file mode 100644 index e6c661f578..0000000000 --- a/assets/js/8b8ccc10.1c3b82e9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8534],{3961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="DELETE",d={id:"examples/queries/prepared-statements/delete",title:"DELETE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/delete.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/delete",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/delete.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/update"},next:{title:"Binlog Watcher",permalink:"/node-mysql2/docs/examples/binlog-watcher"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/8b8ccc10.a9b6fe0b.js b/assets/js/8b8ccc10.a9b6fe0b.js new file mode 100644 index 0000000000..1a7a31faef --- /dev/null +++ b/assets/js/8b8ccc10.a9b6fe0b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8534],{3961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="DELETE",d={id:"examples/queries/prepared-statements/delete",title:"DELETE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/delete.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/delete",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/delete.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/update"},next:{title:"Binlog Watcher",permalink:"/node-mysql2/docs/examples/binlog-watcher"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/8fcb4d7f.439505a5.js b/assets/js/8fcb4d7f.439505a5.js new file mode 100644 index 0000000000..decd0ba0d2 --- /dev/null +++ b/assets/js/8fcb4d7f.439505a5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[81],{3050:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=r(5893),t=r(1151),l=r(4866),o=r(5162),a=r(6393),i=r(4379);const c={sidebar_position:1,tags:["query"]},u="SELECT",d={id:"examples/queries/simple-queries/select",title:"SELECT",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/select.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/select",permalink:"/node-mysql2/docs/examples/queries/simple-queries/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/select.mdx",tags:[{label:"query",permalink:"/node-mysql2/docs/tags/query"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["query"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/simple-queries/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/update"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"query(options) \u2014 Row as Array",id:"queryoptions--row-as-array",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions-1",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,s.jsxs)(n.p,{children:["The examples below also work for the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,s.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,s.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-next-line\n const [rows, fields] = await connection.query(sql);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(sql, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions--row-as-array",children:"query(options) \u2014 Row as Array"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n rowsAsArray: true,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n rowsAsArray: true,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server as array"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,s.jsx)(a.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>o});r(7294);var s=r(512);const t={tabItem:"tabItem_Ymn6"};var l=r(5893);function o(e){let{children:n,hidden:r,className:o}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(t.tabItem,o),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var s=r(7294),t=r(512),l=r(2466),o=r(6550),a=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:s,default:t}}=e;return{value:n,label:r,attributes:s,default:t}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:r}=e;const t=(0,o.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:r=!1,groupId:t}=e,l=h(e),[o,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=r.find((e=>e.default))??r[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:r,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(r);return[t,(0,s.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:t}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,a.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:o,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=r(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=r(5893);function b(e){let{className:n,block:r,selectedValue:s,selectValue:o,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),t=a[r].value;t!==s&&(c(n),o(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":r},n),children:a.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:t}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(y,{...e,...n})]})}function v(e){const n=(0,g.Z)();return(0,f.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var s=r(7294),t=r(2263),l=r(9286),o=r(5893);const a=()=>(0,o.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const s=e.split("\n"),t=`${r} ${n}`;let l=!1,o=0,a="";for(const i of s)if(i.includes(t)&&(l=!0),l&&(i.includes("{")&&o++,a+=i+"\n",i.includes("}")&&(o--,0===o)))break;return a.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,o.jsx)(o.Fragment,{children:h?(0,o.jsx)(a,{}):(0,o.jsx)(o.Fragment,{children:x?(0,o.jsxs)("div",{children:["Unable to access the requested link: ",(0,o.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,o.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var s=r(4673),t=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/8fcb4d7f.775cd8a1.js b/assets/js/8fcb4d7f.775cd8a1.js deleted file mode 100644 index 55097f9e4b..0000000000 --- a/assets/js/8fcb4d7f.775cd8a1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[81],{3050:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=r(5893),t=r(1151),l=r(4866),o=r(5162),a=r(6393),i=r(4379);const c={sidebar_position:1,tags:["query"]},u="SELECT",d={id:"examples/queries/simple-queries/select",title:"SELECT",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/select.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/select",permalink:"/node-mysql2/docs/examples/queries/simple-queries/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/select.mdx",tags:[{label:"query",permalink:"/node-mysql2/docs/tags/query"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["query"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/docs/examples/queries/simple-queries/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/docs/examples/queries/simple-queries/update"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"query(options) \u2014 Row as Array",id:"queryoptions--row-as-array",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions-1",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,s.jsxs)(n.p,{children:["The examples below also work for the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,s.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,s.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-next-line\n const [rows, fields] = await connection.query(sql);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(sql, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions--row-as-array",children:"query(options) \u2014 Row as Array"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n rowsAsArray: true,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n rowsAsArray: true,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server as array"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,s.jsx)(a.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>o});r(7294);var s=r(512);const t={tabItem:"tabItem_Ymn6"};var l=r(5893);function o(e){let{children:n,hidden:r,className:o}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(t.tabItem,o),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var s=r(7294),t=r(512),l=r(2466),o=r(6550),a=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:s,default:t}}=e;return{value:n,label:r,attributes:s,default:t}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:r}=e;const t=(0,o.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:r=!1,groupId:t}=e,l=h(e),[o,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=r.find((e=>e.default))??r[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:r,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(r);return[t,(0,s.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:t}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,a.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:o,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=r(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=r(5893);function b(e){let{className:n,block:r,selectedValue:s,selectValue:o,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),t=a[r].value;t!==s&&(c(n),o(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":r},n),children:a.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:t}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(y,{...e,...n})]})}function v(e){const n=(0,g.Z)();return(0,f.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var s=r(7294),t=r(2263),l=r(9286),o=r(5893);const a=()=>(0,o.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const s=e.split("\n"),t=`${r} ${n}`;let l=!1,o=0,a="";for(const i of s)if(i.includes(t)&&(l=!0),l&&(i.includes("{")&&o++,a+=i+"\n",i.includes("}")&&(o--,0===o)))break;return a.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,o.jsx)(o.Fragment,{children:h?(0,o.jsx)(a,{}):(0,o.jsx)(o.Fragment,{children:x?(0,o.jsxs)("div",{children:["Unable to access the requested link: ",(0,o.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,o.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var s=r(4673),t=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/9e767aa9.244f9a95.js b/assets/js/9e767aa9.244f9a95.js new file mode 100644 index 0000000000..4e88269bbc --- /dev/null +++ b/assets/js/9e767aa9.244f9a95.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8806],{7372:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>a});var i=s(5893),t=s(1151),o=s(4442);const r={slug:"/documentation",title:"Introduction"},l="Documentation",c={id:"documentation/index",title:"Introduction",description:"[node-mysql]//github.com/mysqljs/mysql",source:"@site/docs/documentation/00-index.mdx",sourceDirName:"documentation",slug:"/documentation",permalink:"/node-mysql2/docs/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/00-index.mdx",tags:[],version:"current",sidebarPosition:0,frontMatter:{slug:"/documentation",title:"Introduction"},sidebar:"docs",previous:{title:"Stability Badges",permalink:"/node-mysql2/docs/stability-badges"},next:{title:"Authentication Switch Request",permalink:"/node-mysql2/docs/documentation/authentication-switch"}},d={},a=[{value:"Examples",id:"examples",level:2},{value:"Known incompatibilities with Node MySQL",id:"known-incompatibilities-with-node-mysql",level:2},{value:"Other Resources",id:"other-resources",level:2},{value:"Benchmarks",id:"benchmarks",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.V,{title:"Documentation"}),"\n",(0,i.jsx)(n.h1,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n.p,{children:["MySQL2 aims to be a drop in replacement for ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["If you see any API incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", please report via github issue."]})})}),"\n",(0,i.jsxs)(n.p,{children:["Not only ",(0,i.jsx)(n.strong,{children:"MySQL2"})," offers better performance over ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", we also support these additional features:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/promise-wrapper",children:"Promise Wrapper"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/authentication-switch",children:"Authentication Switch"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/extras",children:"More Features"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/mysql-server",children:"MySQL Server"})}),"\n",(0,i.jsx)(n.li,{children:"Pooling"}),"\n",(0,i.jsx)(n.li,{children:"SSL"}),"\n",(0,i.jsx)(n.li,{children:"MySQL Compression"}),"\n",(0,i.jsx)(n.li,{children:"Binary Log Protocol Client"}),"\n"]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,i.jsxs)(n.p,{children:["Please check these ",(0,i.jsx)(n.a,{href:"/docs/examples",children:"examples"})," for ",(0,i.jsx)(n.strong,{children:"MySQL2"}),"."]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsxs)(n.h2,{id:"known-incompatibilities-with-node-mysql",children:["Known incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"zeroFill"})," flag is ignored in type conversion.\nYou need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"DECIMAL"})," and ",(0,i.jsx)(n.code,{children:"NEWDECIMAL"})," types always returned as ",(0,i.jsx)(n.code,{children:"string"})," unless you pass this config option:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"{\n decimalNumbers: true,\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"This option could lose precision on the number as Javascript Number is a Float!"})}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"other-resources",children:"Other Resources"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/client-server-protocol.html",children:"Wire protocol documentation"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," - Most popular node.js mysql client library"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mariasql/",children:"node-mariasql"})," - Bindings to libmariasql. One of the fastest clients"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/Sannis/node-mysql-libmysqlclient",children:"node-libmysqlclient"})," - Bindings to libmysqlclient"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/siddontang/go-mysql",children:"go-mysql"})," - MySQL Go client (prepared statements, binlog protocol, server)"]}),"\n"]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"benchmarks",children:"Benchmarks"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b",children:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"npm run benchmarks"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mysql-benchmarks",children:"node-mysql-benchmarks"})}),"\n",(0,i.jsxs)(n.li,{children:["try to run example ",(0,i.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/benchmarks",children:"benchmarks"})," on your system"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},4442:(e,n,s)=>{s.d(n,{V:()=>o});var i=s(5742),t=s(5893);const o=e=>{let{title:n}=e;return(0,t.jsx)(i.Z,{children:(0,t.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>r});var i=s(7294);const t={},o=i.createContext(t);function r(e){const n=i.useContext(o);return i.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(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9e767aa9.33391d2e.js b/assets/js/9e767aa9.33391d2e.js deleted file mode 100644 index 630746ae4f..0000000000 --- a/assets/js/9e767aa9.33391d2e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8806],{7372:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>h});var i=s(5893),t=s(1151),o=s(4442);const r={slug:"/documentation",title:"Introduction"},l="Documentation",c={id:"documentation/index",title:"Introduction",description:"[node-mysql]//github.com/mysqljs/mysql",source:"@site/docs/documentation/00-index.mdx",sourceDirName:"documentation",slug:"/documentation",permalink:"/node-mysql2/docs/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/00-index.mdx",tags:[],version:"current",sidebarPosition:0,frontMatter:{slug:"/documentation",title:"Introduction"},sidebar:"docs",previous:{title:"Stability Badges",permalink:"/node-mysql2/docs/stability-badges"},next:{title:"Authentication Switch Request",permalink:"/node-mysql2/docs/documentation/authentication-switch"}},d={},h=[{value:"Examples",id:"examples",level:2},{value:"Known incompatibilities with Node MySQL",id:"known-incompatibilities-with-node-mysql",level:2},{value:"Other Resources",id:"other-resources",level:2},{value:"Benchmarks",id:"benchmarks",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.V,{title:"Documentation"}),"\n",(0,i.jsx)(n.h1,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n.p,{children:["MySQL2 aims to be a drop in replacement for ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["If you see any API incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", please report via github issue."]})})}),"\n",(0,i.jsxs)(n.p,{children:["Not only ",(0,i.jsx)(n.strong,{children:"MySQL2"})," offers better performance over ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", we also support these additional features:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/promise-wrapper",children:"Promise Wrapper"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/authentication-switch",children:"Authentication Switch"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/extras",children:"More Features"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/mysql-server",children:"MySQL Server"})}),"\n",(0,i.jsx)(n.li,{children:"Pooling"}),"\n",(0,i.jsx)(n.li,{children:"SSL"}),"\n",(0,i.jsx)(n.li,{children:"MySQL Compression"}),"\n",(0,i.jsx)(n.li,{children:"Binary Log Protocol Client"}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,i.jsxs)(n.p,{children:["Please check these ",(0,i.jsx)(n.a,{href:"/docs/examples",children:"examples"})," for ",(0,i.jsx)(n.strong,{children:"MySQL2"}),"."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"known-incompatibilities-with-node-mysql",children:["Known incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"zeroFill"})," flag is ignored in type conversion.\nYou need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"DECIMAL"})," and ",(0,i.jsx)(n.code,{children:"NEWDECIMAL"})," types always returned as ",(0,i.jsx)(n.code,{children:"string"})," unless you pass this config option:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"{\n decimalNumbers: true,\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"This option could lose precision on the number as Javascript Number is a Float!"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"other-resources",children:"Other Resources"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/client-server-protocol.html",children:"Wire protocol documentation"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," - Most popular node.js mysql client library"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mariasql/",children:"node-mariasql"})," - Bindings to libmariasql. One of the fastest clients"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/Sannis/node-mysql-libmysqlclient",children:"node-libmysqlclient"})," - Bindings to libmysqlclient"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/siddontang/go-mysql",children:"go-mysql"})," - MySQL Go client (prepared statements, binlog protocol, server)"]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"benchmarks",children:"Benchmarks"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b",children:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"npm run benchmarks"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mysql-benchmarks",children:"node-mysql-benchmarks"})}),"\n",(0,i.jsxs)(n.li,{children:["try to run example ",(0,i.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/benchmarks",children:"benchmarks"})," on your system"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},4442:(e,n,s)=>{s.d(n,{V:()=>o});var i=s(5742),t=s(5893);const o=e=>{let{title:n}=e;return(0,t.jsx)(i.Z,{children:(0,t.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>r});var i=s(7294);const t={},o=i.createContext(t);function r(e){const n=i.useContext(o);return i.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(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b07748b5.6c0d5c52.js b/assets/js/b07748b5.6c0d5c52.js new file mode 100644 index 0000000000..0c45613adf --- /dev/null +++ b/assets/js/b07748b5.6c0d5c52.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4403],{214:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>u,toc:()=>p});var r=s(5893),o=s(1151),l=s(4866),t=s(5162),c=s(6393),i=s(4379);const a={sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},d="createPoolCluster",u={id:"examples/connections/createPoolCluster",title:"createPoolCluster",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/createPoolCluster.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/createPoolCluster",permalink:"/node-mysql2/docs/examples/connections/createPoolCluster",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/createPoolCluster.mdx",tags:[{label:"createPoolCluster",permalink:"/node-mysql2/docs/tags/create-pool-cluster"},{label:"URI",permalink:"/node-mysql2/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/docs/tags/socks"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createPool",permalink:"/node-mysql2/docs/examples/connections/create-pool"},next:{title:"Simple Queries",permalink:"/node-mysql2/docs/examples/queries/simple-queries/"}},h={},p=[{value:"add(group, connectionUri)",id:"addgroup-connectionuri",level:2},{value:"add(group, config)",id:"addgroup-config",level:2},{value:"add(group, config) \u2014 SHA1",id:"addgroup-config--sha1",level:2},{value:"add(group, config) \u2014 SSL",id:"addgroup-config--ssl",level:2},{value:"add(group, config) \u2014 RDS SSL",id:"addgroup-config--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"add(group, config) \u2014 Socks",id:"addgroup-config--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function g(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createpoolcluster",children:"createPoolCluster"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-connectionuri",children:"add(group, connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"add(group: string, connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config",children:"add(group, config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--sha1",children:"add(group, config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--ssl",children:"add(group, config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,r.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--rds-ssl",children:"add(group, config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await poolCluster.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(t.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n poolCluster.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--socks",children:"add(group, config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n stream: socksProxy,\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})}),(0,r.jsx)(t.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,r.jsxs)("blockquote",{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,r.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),(0,r.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]}),"\n",(0,r.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var r=s(512);const o={tabItem:"tabItem_Ymn6"};var l=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>C});var r=s(7294),o=s(512),l=s(2466),t=s(6550),c=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:o}}=e;return{value:n,label:s,attributes:r,default:o}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:s}=e;const o=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(o.location.search);n.set(l,e),o.replace({...o.location,search:n.toString()})}),[l,o])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,l=h(e),[t,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[a,u]=g({queryString:s,groupId:o}),[m,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,l]=(0,d.Nk)(s);return[o,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:o}),j=(()=>{const e=a??m;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,l]),tabValues:l}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=c[s].value;o!==r&&(a(n),t(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:c.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...l,className:(0,o.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function C(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),o=s(2263),l=s(9286),t=s(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[g,m]=(0,r.useState)(!0),{siteConfig:x}=(0,o.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),o=`${s} ${n}`;let l=!1,t=0,c="";for(const i of r)if(i.includes(o)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;u(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:h?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:g?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),o=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,o.jsx)(r.Z,{open:s,className:"faq",summary:(0,o.jsx)("summary",{children:(0,o.jsx)("strong",{children:l})}),children:(0,o.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/b07748b5.e822c15e.js b/assets/js/b07748b5.e822c15e.js deleted file mode 100644 index d157a941fd..0000000000 --- a/assets/js/b07748b5.e822c15e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4403],{214:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>u,toc:()=>p});var r=s(5893),o=s(1151),l=s(4866),t=s(5162),c=s(6393),i=s(4379);const a={sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},d="createPoolCluster",u={id:"examples/connections/createPoolCluster",title:"createPoolCluster",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/createPoolCluster.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/createPoolCluster",permalink:"/node-mysql2/docs/examples/connections/createPoolCluster",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/createPoolCluster.mdx",tags:[{label:"createPoolCluster",permalink:"/node-mysql2/docs/tags/create-pool-cluster"},{label:"URI",permalink:"/node-mysql2/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/docs/tags/socks"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createPool",permalink:"/node-mysql2/docs/examples/connections/create-pool"},next:{title:"Simple Queries",permalink:"/node-mysql2/docs/examples/queries/simple-queries/"}},h={},p=[{value:"add(group, connectionUri)",id:"addgroup-connectionuri",level:2},{value:"add(group, config)",id:"addgroup-config",level:2},{value:"add(group, config) \u2014 SHA1",id:"addgroup-config--sha1",level:2},{value:"add(group, config) \u2014 SSL",id:"addgroup-config--ssl",level:2},{value:"add(group, config) \u2014 RDS SSL",id:"addgroup-config--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"add(group, config) \u2014 Socks",id:"addgroup-config--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function g(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createpoolcluster",children:"createPoolCluster"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-connectionuri",children:"add(group, connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"add(group: string, connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config",children:"add(group, config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--sha1",children:"add(group, config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--ssl",children:"add(group, config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,r.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--rds-ssl",children:"add(group, config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await poolCluster.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(t.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n poolCluster.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--socks",children:"add(group, config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n stream: socksProxy,\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})}),(0,r.jsx)(t.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,r.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),"\n",(0,r.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})}),"\n"]}),"\n",(0,r.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var r=s(512);const o={tabItem:"tabItem_Ymn6"};var l=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>C});var r=s(7294),o=s(512),l=s(2466),t=s(6550),c=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:o}}=e;return{value:n,label:s,attributes:r,default:o}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:s}=e;const o=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(o.location.search);n.set(l,e),o.replace({...o.location,search:n.toString()})}),[l,o])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,l=h(e),[t,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[a,u]=g({queryString:s,groupId:o}),[m,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,l]=(0,d.Nk)(s);return[o,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:o}),j=(()=>{const e=a??m;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,l]),tabValues:l}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=c[s].value;o!==r&&(a(n),t(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:c.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...l,className:(0,o.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function C(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),o=s(2263),l=s(9286),t=s(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[g,m]=(0,r.useState)(!0),{siteConfig:x}=(0,o.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),o=`${s} ${n}`;let l=!1,t=0,c="";for(const i of r)if(i.includes(o)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;u(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:h?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:g?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),o=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,o.jsx)(r.Z,{open:s,className:"faq",summary:(0,o.jsx)("summary",{children:(0,o.jsx)("strong",{children:l})}),children:(0,o.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/b80d201b.074f18ce.js b/assets/js/b80d201b.074f18ce.js deleted file mode 100644 index eb83841abc..0000000000 --- a/assets/js/b80d201b.074f18ce.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6061],{1384:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="UPDATE",d={id:"examples/queries/prepared-statements/update",title:"UPDATE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/update.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/update",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/update.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/select"},next:{title:"DELETE",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/delete"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),g=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),j(e)}),[d,j,l]),tabValues:l}}var j=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:j}=(0,r.Z)(),g=j.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${g}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/b80d201b.9b7031af.js b/assets/js/b80d201b.9b7031af.js new file mode 100644 index 0000000000..8ff181a1ef --- /dev/null +++ b/assets/js/b80d201b.9b7031af.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6061],{1384:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="UPDATE",d={id:"examples/queries/prepared-statements/update",title:"UPDATE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/update.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/update",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/update.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/select"},next:{title:"DELETE",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/delete"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),g=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),j(e)}),[d,j,l]),tabValues:l}}var j=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:j}=(0,r.Z)(),g=j.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${g}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/cdbda324.5473c064.js b/assets/js/cdbda324.5473c064.js new file mode 100644 index 0000000000..26efbbbb05 --- /dev/null +++ b/assets/js/cdbda324.5473c064.js @@ -0,0 +1,2 @@ +/*! For license information please see cdbda324.5473c064.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4116],{1851:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>i,default:()=>g,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var s=r(5893),t=r(1151),o=r(6393),l=r(3901);const c={},i="How to handle errors?",a={id:"faq/how-to-handle-errors",title:"How to handle errors?",description:"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.",source:"@site/docs/faq/how-to-handle-errors.mdx",sourceDirName:"faq",slug:"/faq/how-to-handle-errors",permalink:"/node-mysql2/docs/faq/how-to-handle-errors",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/faq/how-to-handle-errors.mdx",tags:[],version:"current",frontMatter:{},sidebar:"faq",previous:{title:"Introduction",permalink:"/node-mysql2/docs/faq"}},h={},d=[{value:"Using callbacks",id:"using-callbacks",level:2},{value:"Using promises",id:"using-promises",level:2},{value:"Related Links",id:"related-links",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"how-to-handle-errors",children:"How to handle errors?"}),"\n",(0,s.jsxs)(n.p,{children:["This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"}),", ",(0,s.jsx)(n.code,{children:"createPoolCluster"}),", ",(0,s.jsx)(n.code,{children:"execute"})," and ",(0,s.jsx)(n.code,{children:"query"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"using-callbacks",children:"Using callbacks"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsx)(n.p,{children:"Handling connection errors by adding an error event listener:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconnection = mysql.createConnection({\n host: '',\n user: '',\n database: '',\n});\n\n// highlight-start\nconnection.addListener('error', (err) => {\n if (err instanceof Error) {\n console.log(`createConnection error:`, err);\n }\n});\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\npool.getConnection((err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('pool.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\npoolCluster.getConnection('NodeI', (err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('poolCluster.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.execute('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('execute error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.query('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('query error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.h2,{id:"using-promises",children:"Using promises"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n const connection = await mysql.createConnection({\n host: '',\n user: '',\n database: '',\n });\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n const connection = await pool.getConnection();\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n await poolCluster.getConnection('NodeI');\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('createConnection error:', err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.execute('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('execute error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.query('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('query error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Discussions","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/1998",children:"#1998"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/2282",children:"#2282"})}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},4673:(e,n,r)=>{r.d(n,{Z:()=>x});var s=r(7294),t=r(512),o=r(2389),l=r(6043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var i=r(5893);function a(e){return!!e&&("SUMMARY"===e.tagName||a(e.parentElement))}function h(e,n){return!!e&&(e===n||h(e.parentElement,n))}function d(e){let{summary:n,children:r,...d}=e;const u=(0,o.Z)(),g=(0,s.useRef)(null),{collapsed:x,setCollapsed:j}=(0,l.u)({initialState:!d.open}),[p,m]=(0,s.useState)(d.open),y=s.isValidElement(n)?n:(0,i.jsx)("summary",{children:n??"Details"});return(0,i.jsxs)("details",{...d,ref:g,open:p,"data-collapsed":x,className:(0,t.Z)(c.details,u&&c.isBrowser,d.className),onMouseDown:e=>{a(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;a(n)&&h(n,g.current)&&(e.preventDefault(),x?(j(!1),m(!0)):j(!0))},children:[y,(0,i.jsx)(l.z,{lazy:!1,collapsed:x,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),m(!e)},children:(0,i.jsx)("div",{className:c.collapsibleContent,children:r})})]})}const u={details:"details_b_Ee"},g="alert alert--info";function x(e){let{...n}=e;return(0,i.jsx)(d,{...n,className:(0,t.Z)(g,u.details,n.className)})}},6393:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(4673),t=r(5893);const o=e=>{let{children:n,open:r,title:o}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}},3901:(e,n,r)=>{r.d(n,{X:()=>u});var s=r(3692),t=r(4297);const o=(0,t.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,t.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),c=(0,t.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),i=(0,t.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,t.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),h=(0,t.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var d=r(5893);const u=e=>{let{level:n,message:r}=e;const t={0:{title:"Deprecated",icon:(0,d.jsx)(o,{})},1:{title:"Experimental",icon:(0,d.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,d.jsx)(c,{})},1.2:{title:"Release Candidate",icon:(0,d.jsx)(i,{})},2:{title:"Stable",icon:(0,d.jsx)(a,{})},3:{title:"Legacy",icon:(0,d.jsx)(h,{})}};return(0,d.jsxs)("section",{className:"stability","data-level":n,children:[(0,d.jsx)(s.Z,{to:"/docs/stability-badges",children:(0,d.jsxs)("header",{children:[(0,d.jsx)("strong",{children:n}),(0,d.jsx)("span",{children:t[n].title}),t[n].icon]})}),r?(0,d.jsx)("p",{children:r}):null]})}},4297:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(7294),t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const o=(e,n)=>{const r=(0,s.forwardRef)((({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:i="",children:a,...h},d)=>{return(0,s.createElement)("svg",{ref:d,...t,width:o,height:o,stroke:r,strokeWidth:c?24*Number(l)/Number(o):l,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...h},[...n.map((([e,n])=>(0,s.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var u}));return r.displayName=`${e}`,r}},1151:(e,n,r)=>{r.d(n,{Z:()=>c,a:()=>l});var s=r(7294);const t={},o=s.createContext(t);function l(e){const n=s.useContext(o);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:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/cdbda324.fbef41bf.js.LICENSE.txt b/assets/js/cdbda324.5473c064.js.LICENSE.txt similarity index 100% rename from assets/js/cdbda324.fbef41bf.js.LICENSE.txt rename to assets/js/cdbda324.5473c064.js.LICENSE.txt diff --git a/assets/js/cdbda324.fbef41bf.js b/assets/js/cdbda324.fbef41bf.js deleted file mode 100644 index 65b1abd1de..0000000000 --- a/assets/js/cdbda324.fbef41bf.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see cdbda324.fbef41bf.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4116],{1851:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>i,default:()=>g,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var s=r(5893),t=r(1151),o=r(6393),l=r(3901);const c={},i="How to handle errors?",a={id:"faq/how-to-handle-errors",title:"How to handle errors?",description:"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.",source:"@site/docs/faq/how-to-handle-errors.mdx",sourceDirName:"faq",slug:"/faq/how-to-handle-errors",permalink:"/node-mysql2/docs/faq/how-to-handle-errors",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/faq/how-to-handle-errors.mdx",tags:[],version:"current",frontMatter:{},sidebar:"faq",previous:{title:"Introduction",permalink:"/node-mysql2/docs/faq"}},h={},d=[{value:"Using callbacks",id:"using-callbacks",level:2},{value:"Using promises",id:"using-promises",level:2},{value:"Related Links",id:"related-links",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"how-to-handle-errors",children:"How to handle errors?"}),"\n",(0,s.jsxs)(n.p,{children:["This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"}),", ",(0,s.jsx)(n.code,{children:"createPoolCluster"}),", ",(0,s.jsx)(n.code,{children:"execute"})," and ",(0,s.jsx)(n.code,{children:"query"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"using-callbacks",children:"Using callbacks"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsx)(n.p,{children:"Handling connection errors by adding an error event listener:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconnection = mysql.createConnection({\n host: '',\n user: '',\n database: '',\n});\n\n// highlight-start\nconnection.addListener('error', (err) => {\n if (err instanceof Error) {\n console.log(`createConnection error:`, err);\n }\n});\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\npool.getConnection((err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('pool.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\npoolCluster.getConnection('NodeI', (err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('poolCluster.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.execute('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('execute error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.query('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('query error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.h2,{id:"using-promises",children:"Using promises"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n const connection = await mysql.createConnection({\n host: '',\n user: '',\n database: '',\n });\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n const connection = await pool.getConnection();\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n await poolCluster.getConnection('NodeI');\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('createConnection error:', err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.execute('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('execute error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.query('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('query error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Discussions","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/1998",children:"#1998"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/2282",children:"#2282"})}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},4673:(e,n,r)=>{r.d(n,{Z:()=>x});var s=r(7294),t=r(512),o=r(2389),l=r(6043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var i=r(5893);function a(e){return!!e&&("SUMMARY"===e.tagName||a(e.parentElement))}function h(e,n){return!!e&&(e===n||h(e.parentElement,n))}function d(e){let{summary:n,children:r,...d}=e;const u=(0,o.Z)(),g=(0,s.useRef)(null),{collapsed:x,setCollapsed:j}=(0,l.u)({initialState:!d.open}),[p,m]=(0,s.useState)(d.open),y=s.isValidElement(n)?n:(0,i.jsx)("summary",{children:n??"Details"});return(0,i.jsxs)("details",{...d,ref:g,open:p,"data-collapsed":x,className:(0,t.Z)(c.details,u&&c.isBrowser,d.className),onMouseDown:e=>{a(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;a(n)&&h(n,g.current)&&(e.preventDefault(),x?(j(!1),m(!0)):j(!0))},children:[y,(0,i.jsx)(l.z,{lazy:!1,collapsed:x,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),m(!e)},children:(0,i.jsx)("div",{className:c.collapsibleContent,children:r})})]})}const u={details:"details_b_Ee"},g="alert alert--info";function x(e){let{...n}=e;return(0,i.jsx)(d,{...n,className:(0,t.Z)(g,u.details,n.className)})}},6393:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(4673),t=r(5893);const o=e=>{let{children:n,open:r,title:o}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}},3901:(e,n,r)=>{r.d(n,{X:()=>u});var s=r(3692),t=r(4297);const o=(0,t.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,t.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),c=(0,t.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),i=(0,t.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,t.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),h=(0,t.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var d=r(5893);const u=e=>{let{level:n,message:r}=e;const t={0:{title:"Deprecated",icon:(0,d.jsx)(o,{})},1:{title:"Experimental",icon:(0,d.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,d.jsx)(c,{})},1.2:{title:"Release Candidate",icon:(0,d.jsx)(i,{})},2:{title:"Stable",icon:(0,d.jsx)(a,{})},3:{title:"Legacy",icon:(0,d.jsx)(h,{})}};return(0,d.jsxs)("section",{className:"stability","data-level":n,children:[(0,d.jsx)(s.Z,{to:"/docs/stability-badges",children:(0,d.jsxs)("header",{children:[(0,d.jsx)("strong",{children:n}),(0,d.jsx)("span",{children:t[n].title}),t[n].icon]})}),r?(0,d.jsx)("p",{children:r}):null]})}},4297:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(7294),t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const o=(e,n)=>{const r=(0,s.forwardRef)((({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:i="",children:a,...h},d)=>{return(0,s.createElement)("svg",{ref:d,...t,width:o,height:o,stroke:r,strokeWidth:c?24*Number(l)/Number(o):l,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...h},[...n.map((([e,n])=>(0,s.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var u}));return r.displayName=`${e}`,r}},1151:(e,n,r)=>{r.d(n,{Z:()=>c,a:()=>l});var s=r(7294);const t={},o=s.createContext(t);function l(e){const n=s.useContext(o);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:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/db044f71.a1084822.js b/assets/js/db044f71.a1084822.js deleted file mode 100644 index 0439a549a2..0000000000 --- a/assets/js/db044f71.a1084822.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see db044f71.a1084822.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6159],{8009:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>d});var a=s(5893),i=s(1151),n=s(3901);const r={},o="Stability Badges",l={id:"stability-badges",title:"Stability Badges",description:"The Stability Badges are indications of a section's stability.",source:"@site/docs/stability-badges.mdx",sourceDirName:".",slug:"/stability-badges",permalink:"/node-mysql2/docs/stability-badges",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/stability-badges.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"History and Why MySQL2",permalink:"/node-mysql2/docs/history-and-why-mysq2"},next:{title:"Introduction",permalink:"/node-mysql2/docs/documentation"}},c={},d=[];function h(e){const t={blockquote:"blockquote",h1:"h1",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"stability-badges",children:"Stability Badges"}),"\n",(0,a.jsxs)(t.p,{children:["The ",(0,a.jsx)(t.strong,{children:"Stability Badges"})," are indications of a section's stability."]}),"\n",(0,a.jsx)(t.p,{children:"The stability indices are as follows:"}),"\n",(0,a.jsx)(n.X,{level:0,message:"The feature might generate warnings and does not assure backward compatibility."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.strong,{children:"Experimental"}),": These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged."]}),"\n",(0,a.jsxs)(t.blockquote,{children:["\n",(0,a.jsx)(t.p,{children:"Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features."}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"Experimental features are classified into stages:"}),"\n",(0,a.jsx)(n.X,{level:1,message:"Experimental features at this stage are currently in development and prone to considerable changes."}),"\n",(0,a.jsx)(n.X,{level:1.1,message:"Experimental features at this stage are approaching minimum viability."}),"\n",(0,a.jsx)(n.X,{level:1.2,message:"Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsx)(n.X,{level:2,message:"Compatibility with the MySQL ecosystem is a high priority."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsx)(n.X,{level:3,message:"This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available."}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed."}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},3901:(e,t,s)=>{s.d(t,{X:()=>u});var a=s(3692),i=s(4297);const n=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),r=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),l=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),c=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:t,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(n,{})},1:{title:"Experimental",icon:(0,h.jsx)(r,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(l,{})},2:{title:"Stable",icon:(0,h.jsx)(c,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":t,children:[(0,h.jsx)(a.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:t}),(0,h.jsx)("span",{children:i[t].title}),i[t].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const n=(e,t)=>{const s=(0,a.forwardRef)((({color:s="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>{return(0,a.createElement)("svg",{ref:h,...i,width:n,height:n,stroke:s,strokeWidth:o?24*Number(r)/Number(n):r,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,l].join(" "),...d},[...t.map((([e,t])=>(0,a.createElement)(e,t))),...Array.isArray(c)?c:[c]]);var u}));return s.displayName=`${e}`,s}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>r});var a=s(7294);const i={},n=a.createContext(i);function r(e){const t=a.useContext(n);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/db044f71.ad539a4f.js b/assets/js/db044f71.bd4db484.js similarity index 88% rename from zh-CN/assets/js/db044f71.ad539a4f.js rename to assets/js/db044f71.bd4db484.js index 164ede27bb..e8b6b9613d 100644 --- a/zh-CN/assets/js/db044f71.ad539a4f.js +++ b/assets/js/db044f71.bd4db484.js @@ -1,2 +1,2 @@ -/*! For license information please see db044f71.ad539a4f.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6159],{8009:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>d});var a=s(5893),i=s(1151),n=s(3901);const r={},o="Stability Badges",l={id:"stability-badges",title:"Stability Badges",description:"The Stability Badges are indications of a section's stability.",source:"@site/docs/stability-badges.mdx",sourceDirName:".",slug:"/stability-badges",permalink:"/node-mysql2/zh-CN/docs/stability-badges",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/stability-badges.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"MySQL2\u7684\u5386\u53f2\u4ee5\u53ca\u9009\u62e9\u539f\u56e0",permalink:"/node-mysql2/zh-CN/docs/history-and-why-mysq2"},next:{title:"Introduction",permalink:"/node-mysql2/zh-CN/docs/documentation"}},c={},d=[];function h(e){const t={blockquote:"blockquote",h1:"h1",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"stability-badges",children:"Stability Badges"}),"\n",(0,a.jsxs)(t.p,{children:["The ",(0,a.jsx)(t.strong,{children:"Stability Badges"})," are indications of a section's stability."]}),"\n",(0,a.jsx)(t.p,{children:"The stability indices are as follows:"}),"\n",(0,a.jsx)(n.X,{level:0,message:"The feature might generate warnings and does not assure backward compatibility."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.strong,{children:"Experimental"}),": These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged."]}),"\n",(0,a.jsxs)(t.blockquote,{children:["\n",(0,a.jsx)(t.p,{children:"Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features."}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"Experimental features are classified into stages:"}),"\n",(0,a.jsx)(n.X,{level:1,message:"Experimental features at this stage are currently in development and prone to considerable changes."}),"\n",(0,a.jsx)(n.X,{level:1.1,message:"Experimental features at this stage are approaching minimum viability."}),"\n",(0,a.jsx)(n.X,{level:1.2,message:"Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsx)(n.X,{level:2,message:"Compatibility with the MySQL ecosystem is a high priority."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsx)(n.X,{level:3,message:"This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available."}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed."}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},3901:(e,t,s)=>{s.d(t,{X:()=>u});var a=s(3692),i=s(4297);const n=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),r=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),l=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),c=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:t,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(n,{})},1:{title:"Experimental",icon:(0,h.jsx)(r,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(l,{})},2:{title:"Stable",icon:(0,h.jsx)(c,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":t,children:[(0,h.jsx)(a.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:t}),(0,h.jsx)("span",{children:i[t].title}),i[t].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const n=(e,t)=>{const s=(0,a.forwardRef)((({color:s="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>{return(0,a.createElement)("svg",{ref:h,...i,width:n,height:n,stroke:s,strokeWidth:o?24*Number(r)/Number(n):r,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,l].join(" "),...d},[...t.map((([e,t])=>(0,a.createElement)(e,t))),...Array.isArray(c)?c:[c]]);var u}));return s.displayName=`${e}`,s}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>r});var a=s(7294);const i={},n=a.createContext(i);function r(e){const t=a.useContext(n);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file +/*! For license information please see db044f71.bd4db484.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6159],{8009:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>d});var a=s(5893),i=s(1151),n=s(3901);const r={},o="Stability Badges",l={id:"stability-badges",title:"Stability Badges",description:"The Stability Badges are indications of a section's stability.",source:"@site/docs/stability-badges.mdx",sourceDirName:".",slug:"/stability-badges",permalink:"/node-mysql2/docs/stability-badges",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/stability-badges.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"History and Why MySQL2",permalink:"/node-mysql2/docs/history-and-why-mysq2"},next:{title:"Introduction",permalink:"/node-mysql2/docs/documentation"}},c={},d=[];function h(e){const t={blockquote:"blockquote",h1:"h1",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"stability-badges",children:"Stability Badges"}),"\n",(0,a.jsxs)(t.p,{children:["The ",(0,a.jsx)(t.strong,{children:"Stability Badges"})," are indications of a section's stability."]}),"\n",(0,a.jsx)(t.p,{children:"The stability indices are as follows:"}),"\n",(0,a.jsx)(n.X,{level:0,message:"The feature might generate warnings and does not assure backward compatibility."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.strong,{children:"Experimental"}),": These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged."]}),"\n",(0,a.jsxs)(t.blockquote,{children:["\n",(0,a.jsx)(t.p,{children:"Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features."}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"Experimental features are classified into stages:"}),"\n",(0,a.jsx)(n.X,{level:1,message:"Experimental features at this stage are currently in development and prone to considerable changes."}),"\n",(0,a.jsx)(n.X,{level:1.1,message:"Experimental features at this stage are approaching minimum viability."}),"\n",(0,a.jsx)(n.X,{level:1.2,message:"Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsx)(n.X,{level:2,message:"Compatibility with the MySQL ecosystem is a high priority."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsx)(n.X,{level:3,message:"This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available."}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed."}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},3901:(e,t,s)=>{s.d(t,{X:()=>u});var a=s(3692),i=s(4297);const n=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),r=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),l=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),c=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:t,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(n,{})},1:{title:"Experimental",icon:(0,h.jsx)(r,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(l,{})},2:{title:"Stable",icon:(0,h.jsx)(c,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":t,children:[(0,h.jsx)(a.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:t}),(0,h.jsx)("span",{children:i[t].title}),i[t].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const n=(e,t)=>{const s=(0,a.forwardRef)((({color:s="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>{return(0,a.createElement)("svg",{ref:h,...i,width:n,height:n,stroke:s,strokeWidth:o?24*Number(r)/Number(n):r,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,l].join(" "),...d},[...t.map((([e,t])=>(0,a.createElement)(e,t))),...Array.isArray(c)?c:[c]]);var u}));return s.displayName=`${e}`,s}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>r});var a=s(7294);const i={},n=a.createContext(i);function r(e){const t=a.useContext(n);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/db044f71.a1084822.js.LICENSE.txt b/assets/js/db044f71.bd4db484.js.LICENSE.txt similarity index 100% rename from assets/js/db044f71.a1084822.js.LICENSE.txt rename to assets/js/db044f71.bd4db484.js.LICENSE.txt diff --git a/assets/js/e19cd79a.cb693707.js b/assets/js/e19cd79a.cb693707.js new file mode 100644 index 0000000000..764fd5677e --- /dev/null +++ b/assets/js/e19cd79a.cb693707.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1429],{2998:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=s(5893),r=s(1151),l=s(4866),a=s(5162),o=s(6393),i=s(4379);const c={sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="INSERT",d={id:"examples/queries/prepared-statements/insert",title:"INSERT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/insert.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/insert",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/insert",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/insert.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:0,frontMatter:{sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"Prepared Statements",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/"},next:{title:"SELECT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/select"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"insert",children:"INSERT"}),"\n",(0,t.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const r={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),r=s(512),l=s(2466),a=s(6550),o=s(469),i=s(1980),c=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:r}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:s,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(s);return[r,(0,t.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=i.indexOf(n),r=o[s].value;r!==t&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:r}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var t=s(7294),r=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[x,m]=(0,t.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,s)=>{const t=e.split("\n"),r=`${s} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(4673),r=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,r.jsx)(t.Z,{open:s,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/e19cd79a.d82572fa.js b/assets/js/e19cd79a.d82572fa.js deleted file mode 100644 index b4363af77e..0000000000 --- a/assets/js/e19cd79a.d82572fa.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1429],{2998:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=s(5893),r=s(1151),l=s(4866),a=s(5162),o=s(6393),i=s(4379);const c={sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="INSERT",d={id:"examples/queries/prepared-statements/insert",title:"INSERT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/insert.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/insert",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/insert",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/insert.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/docs/tags/execute"}],version:"current",sidebarPosition:0,frontMatter:{sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"Prepared Statements",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/"},next:{title:"SELECT",permalink:"/node-mysql2/docs/examples/queries/prepared-statements/select"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"insert",children:"INSERT"}),"\n",(0,t.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const r={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),r=s(512),l=s(2466),a=s(6550),o=s(469),i=s(1980),c=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:r}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:s,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(s);return[r,(0,t.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=i.indexOf(n),r=o[s].value;r!==t&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:r}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var t=s(7294),r=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[x,m]=(0,t.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,s)=>{const t=e.split("\n"),r=`${s} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(4673),r=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,r.jsx)(t.Z,{open:s,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/assets/js/f8d74a12.2efd1f29.js b/assets/js/f8d74a12.2efd1f29.js new file mode 100644 index 0000000000..e0ee205e24 --- /dev/null +++ b/assets/js/f8d74a12.2efd1f29.js @@ -0,0 +1,2 @@ +/*! For license information please see f8d74a12.2efd1f29.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5807],{7330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>x,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>h,toc:()=>m});var t=s(5893),i=s(1151),r=s(6393),l=s(8609),o=s(3901),c=s(4379);const a={title:"Documentation Site"},d="Website Contributing Guidelines",h={id:"contributing/website",title:"Documentation Site",description:"This website is built using Docusaurus 3, a modern static website generator.",source:"@site/docs/contributing/website.mdx",sourceDirName:"contributing",slug:"/contributing/website",permalink:"/node-mysql2/docs/contributing/website",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/contributing/website.mdx",tags:[],version:"current",frontMatter:{title:"Documentation Site"},sidebar:"docs",previous:{title:"MySQL2",permalink:"/node-mysql2/docs/contributing"}},x={},m=[{value:"Environment",id:"environment",level:2},{value:"Development",id:"development",level:2},{value:"Extras Components",id:"extras-components",level:2},{value:"History",id:"history",level:3},{value:"Stability",id:"stability",level:3},{value:"FAQ",id:"faq",level:3},{value:"ExternalCodeEmbed",id:"externalcodeembed",level:3},{value:"Running Tests",id:"running-tests",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"website-contributing-guidelines",children:"Website Contributing Guidelines"}),"\n",(0,t.jsxs)(n.p,{children:["This website is built using ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/",children:"Docusaurus 3"}),", a modern static website generator."]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"environment",children:"Environment"}),"\n",(0,t.jsx)(n.p,{children:"You will need these tools installed on your system:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://nodejs.org/",children:"Node.js (18.x or higher)"})}),"\n"]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"development",children:"Development"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Fork the ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2",children:"MySQL2"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Download your forked repository locally. The website's workspace is the \"",(0,t.jsx)(n.em,{children:"website"}),'" directory in ',(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new branch from ",(0,t.jsx)(n.code,{children:"master"})," (optional)."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"cd website"})," to enter the website workspace."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm ci"})," to install the dependecies from ",(0,t.jsx)(n.em,{children:"package-lock.json"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm start"})," to starting the local development."]}),"\n"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server."}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.strong,{children:"Docusaurus"})," complete documentation, please ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs",children:"see here"}),"."]}),"\n",(0,t.jsx)(r.Z,{title:"CLI example",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/sidorares/node-mysql2.git\ngit checkout -b website # optional\ncd /path-to/node-mysql2/website\nnpm ci\nnpm start\n"})})}),"\n",(0,t.jsxs)(n.p,{children:["Documentation is auto-generated from ",(0,t.jsx)(n.strong,{children:"MDX"})," files placed in these directories:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/documentation"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/examples"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/faq"})}),"\n"]}),"\n",(0,t.jsxs)(n.admonition,{title:"Caution",type:"danger",children:[(0,t.jsxs)(n.p,{children:["Note that the website has its own ",(0,t.jsx)(n.em,{children:"package.json"}),"."]}),(0,t.jsxs)(n.p,{children:["Please, do not install dependencies for the website in ",(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"extras-components",children:"Extras Components"}),"\n",(0,t.jsx)(n.p,{children:"Every extra component is thoroughly documented with complete typings descriptions."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs/markdown-features",children:(0,t.jsx)(n.strong,{children:"Docusaurus Markdown Features:"})})," The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"history",children:"History"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"History"})," component displays version changes in a table format, listing version numbers alongside their changes."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { History } from '@site/src/components/History';\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"changes"})," option."]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(l.A,{records:[{version:"1.0.0",changes:["Some change message."]}]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"stability",children:"Stability"}),"\n",(0,t.jsxs)(n.p,{children:["See the ",(0,t.jsx)(n.a,{href:"/docs/stability-badges",children:"Stability Badges"})," for more detais."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { Stability } from '@site/src/components/Stability';\n\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"message"})," option."]})}),"\n",(0,t.jsxs)(n.p,{children:["Available levels: ",(0,t.jsx)(n.code,{children:"0"}),", ",(0,t.jsx)(n.code,{children:"1"}),", ",(0,t.jsx)(n.code,{children:"1.1"}),", ",(0,t.jsx)(n.code,{children:"1.2"}),", ",(0,t.jsx)(n.code,{children:"2"})," and ",(0,t.jsx)(n.code,{children:"3"}),"."]}),"\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(o.X,{level:2}),(0,t.jsx)(o.X,{level:2,message:"Some message."})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"faq",children:"FAQ"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { FAQ } from '@site/src/components/FAQ';\n\n\n\n > Some markdown (**MDX**) content.\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.strong,{children:"FAQ"})," component can be utilized in any section or page."]}),"\n",(0,t.jsxs)(n.li,{children:["Code blocks are compatible and can be used within the ",(0,t.jsx)(n.strong,{children:"FAQ"})," component."]}),"\n"]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(r.Z,{title:"Title",children:(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["Some markdown (",(0,t.jsx)(n.strong,{children:"MDX"}),") content."]}),"\n"]})})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"externalcodeembed",children:"ExternalCodeEmbed"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed';\n\n\n\n\n"})}),"\n","\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/.prettierrc",language:"json"}),(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/tools/parse-row.js",language:"js",extractMethod:"parseC",methodType:"function"})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"running-tests",children:"Running Tests"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run test\n"})}),"\n",(0,t.jsxs)(r.Z,{title:"Check Prettier and ESLint rules for compliance",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lintcheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Check for typings errors",children:[(0,t.jsx)(o.X,{level:1,message:(0,t.jsxs)(t.Fragment,{children:["Checks for ",(0,t.jsx)(n.strong,{children:"MDX"})," components are missing."]})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run typecheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Clear and build the website",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run clear\nnpm run build\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Fix issues from Prettier and ESLint rules",open:!0,children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lint\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"To prevent lint issues, it is recommended to execute this command before creating your commit."}),"\n",(0,t.jsxs)(n.li,{children:["Not included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),i=s(2263),r=s(9286),l=s(5893);const o=()=>(0,l.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:a}=e;const[d,h]=(0,t.useState)(""),[x,m]=(0,t.useState)(!0),[u,p]=(0,t.useState)(!0),{siteConfig:j}=(0,i.Z)(),g=j.baseUrl.replace(/\/$/,""),b=/^\//.test(n)?`${g}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(b,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&a?((e,n,s)=>{const t=e.split("\n"),i=`${s} ${n}`;let r=!1,l=0,o="";for(const c of t)if(c.includes(i)&&(r=!0),r&&(c.includes("{")&&l++,o+=c+"\n",c.includes("}")&&(l--,0===l)))break;return o.trim()||e})(e,c,a):e;h(n||e),m(!1),p(!1)})).catch((()=>{p(!0),m(!1)})),()=>{e.abort()}}),[b,c,a]),(0,l.jsx)(l.Fragment,{children:x?(0,l.jsx)(o,{}):(0,l.jsx)(l.Fragment,{children:u?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:b}),". Please verify the link or try again later."]}):(0,l.jsx)(r.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(4673),i=s(5893);const r=e=>{let{children:n,open:s,title:r}=e;return(0,i.jsx)(t.Z,{open:s,className:"faq",summary:(0,i.jsx)("summary",{children:(0,i.jsx)("strong",{children:r})}),children:(0,i.jsx)("section",{children:n})})}},8609:(e,n,s)=>{s.d(n,{A:()=>l});var t=s(4673);const i=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var r=s(5893);const l=e=>{let{records:n,open:s}=e;return(0,r.jsx)(t.Z,{open:s,summary:(0,r.jsxs)("summary",{children:[(0,r.jsx)(i,{})," History"]}),className:"history",children:(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Version"}),(0,r.jsx)("th",{children:"Changes"})]})}),(0,r.jsx)("tbody",{children:n.map(((e,n)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,r.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>x});var t=s(3692),i=s(4297);const r=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),c=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const x=e=>{let{level:n,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(r,{})},1:{title:"Experimental",icon:(0,h.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(c,{})},2:{title:"Stable",icon:(0,h.jsx)(a,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:i[n].title}),i[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:a,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...i,width:r,height:r,stroke:s,strokeWidth:o?24*Number(l)/Number(r):l,className:["lucide",`lucide-${x=e,x.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,c].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var x}));return s.displayName=`${e}`,s}}}]); \ No newline at end of file diff --git a/assets/js/f8d74a12.650ad441.js.LICENSE.txt b/assets/js/f8d74a12.2efd1f29.js.LICENSE.txt similarity index 100% rename from assets/js/f8d74a12.650ad441.js.LICENSE.txt rename to assets/js/f8d74a12.2efd1f29.js.LICENSE.txt diff --git a/assets/js/f8d74a12.650ad441.js b/assets/js/f8d74a12.650ad441.js deleted file mode 100644 index c8dd76897c..0000000000 --- a/assets/js/f8d74a12.650ad441.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see f8d74a12.650ad441.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5807],{7330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>x,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>h,toc:()=>m});var t=s(5893),i=s(1151),r=s(6393),l=s(8609),o=s(3901),c=s(4379);const a={title:"Documentation Site"},d="Website Contributing Guidelines",h={id:"contributing/website",title:"Documentation Site",description:"This website is built using Docusaurus 3, a modern static website generator.",source:"@site/docs/contributing/website.mdx",sourceDirName:"contributing",slug:"/contributing/website",permalink:"/node-mysql2/docs/contributing/website",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/contributing/website.mdx",tags:[],version:"current",frontMatter:{title:"Documentation Site"},sidebar:"docs",previous:{title:"MySQL2",permalink:"/node-mysql2/docs/contributing"}},x={},m=[{value:"Environment",id:"environment",level:2},{value:"Development",id:"development",level:2},{value:"Extras Components",id:"extras-components",level:2},{value:"History",id:"history",level:3},{value:"Stability",id:"stability",level:3},{value:"FAQ",id:"faq",level:3},{value:"ExternalCodeEmbed",id:"externalcodeembed",level:3},{value:"Running Tests",id:"running-tests",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"website-contributing-guidelines",children:"Website Contributing Guidelines"}),"\n",(0,t.jsxs)(n.p,{children:["This website is built using ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/",children:"Docusaurus 3"}),", a modern static website generator."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"environment",children:"Environment"}),"\n",(0,t.jsx)(n.p,{children:"You will need these tools installed on your system:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://nodejs.org/",children:"Node.js (18.x or higher)"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"development",children:"Development"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Fork the ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2",children:"MySQL2"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Download your forked repository locally. The website's workspace is the \"",(0,t.jsx)(n.em,{children:"website"}),'" directory in ',(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new branch from ",(0,t.jsx)(n.code,{children:"master"})," (optional)."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"cd website"})," to enter the website workspace."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm ci"})," to install the dependecies from ",(0,t.jsx)(n.em,{children:"package-lock.json"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm start"})," to starting the local development."]}),"\n"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server."}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.strong,{children:"Docusaurus"})," complete documentation, please ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs",children:"see here"}),"."]}),"\n",(0,t.jsx)(r.Z,{title:"CLI example",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/sidorares/node-mysql2.git\ngit checkout -b website # optional\ncd /path-to/node-mysql2/website\nnpm ci\nnpm start\n"})})}),"\n",(0,t.jsxs)(n.p,{children:["Documentation is auto-generated from ",(0,t.jsx)(n.strong,{children:"MDX"})," files placed in these directories:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/documentation"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/examples"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/faq"})}),"\n"]}),"\n",(0,t.jsxs)(n.admonition,{title:"Caution",type:"danger",children:[(0,t.jsxs)(n.p,{children:["Note that the website has its own ",(0,t.jsx)(n.em,{children:"package.json"}),"."]}),(0,t.jsxs)(n.p,{children:["Please, do not install dependencies for the website in ",(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"extras-components",children:"Extras Components"}),"\n",(0,t.jsx)(n.p,{children:"Every extra component is thoroughly documented with complete typings descriptions."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs/markdown-features",children:(0,t.jsx)(n.strong,{children:"Docusaurus Markdown Features:"})})," The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"history",children:"History"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"History"})," component displays version changes in a table format, listing version numbers alongside their changes."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { History } from '@site/src/components/History';\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"changes"})," option."]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(l.A,{records:[{version:"1.0.0",changes:["Some change message."]}]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"stability",children:"Stability"}),"\n",(0,t.jsxs)(n.p,{children:["See the ",(0,t.jsx)(n.a,{href:"/docs/stability-badges",children:"Stability Badges"})," for more detais."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { Stability } from '@site/src/components/Stability';\n\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"message"})," option."]})}),"\n",(0,t.jsxs)(n.p,{children:["Available levels: ",(0,t.jsx)(n.code,{children:"0"}),", ",(0,t.jsx)(n.code,{children:"1"}),", ",(0,t.jsx)(n.code,{children:"1.1"}),", ",(0,t.jsx)(n.code,{children:"1.2"}),", ",(0,t.jsx)(n.code,{children:"2"})," and ",(0,t.jsx)(n.code,{children:"3"}),"."]}),"\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(o.X,{level:2}),(0,t.jsx)(o.X,{level:2,message:"Some message."})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"faq",children:"FAQ"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { FAQ } from '@site/src/components/FAQ';\n\n\n\n > Some markdown (**MDX**) content.\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.strong,{children:"FAQ"})," component can be utilized in any section or page."]}),"\n",(0,t.jsxs)(n.li,{children:["Code blocks are compatible and can be used within the ",(0,t.jsx)(n.strong,{children:"FAQ"})," component."]}),"\n"]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(r.Z,{title:"Title",children:(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["Some markdown (",(0,t.jsx)(n.strong,{children:"MDX"}),") content."]}),"\n"]})})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"externalcodeembed",children:"ExternalCodeEmbed"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed';\n\n\n\n\n"})}),"\n","\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/.prettierrc",language:"json"}),(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/tools/parse-row.js",language:"js",extractMethod:"parseC",methodType:"function"})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"running-tests",children:"Running Tests"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run test\n"})}),"\n",(0,t.jsxs)(r.Z,{title:"Check Prettier and ESLint rules for compliance",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lintcheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Check for typings errors",children:[(0,t.jsx)(o.X,{level:1,message:(0,t.jsxs)(t.Fragment,{children:["Checks for ",(0,t.jsx)(n.strong,{children:"MDX"})," components are missing."]})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run typecheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Clear and build the website",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run clear\nnpm run build\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Fix issues from Prettier and ESLint rules",open:!0,children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lint\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"To prevent lint issues, it is recommended to execute this command before creating your commit."}),"\n",(0,t.jsxs)(n.li,{children:["Not included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),i=s(2263),r=s(9286),l=s(5893);const o=()=>(0,l.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:a}=e;const[d,h]=(0,t.useState)(""),[x,m]=(0,t.useState)(!0),[u,p]=(0,t.useState)(!0),{siteConfig:j}=(0,i.Z)(),g=j.baseUrl.replace(/\/$/,""),b=/^\//.test(n)?`${g}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(b,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&a?((e,n,s)=>{const t=e.split("\n"),i=`${s} ${n}`;let r=!1,l=0,o="";for(const c of t)if(c.includes(i)&&(r=!0),r&&(c.includes("{")&&l++,o+=c+"\n",c.includes("}")&&(l--,0===l)))break;return o.trim()||e})(e,c,a):e;h(n||e),m(!1),p(!1)})).catch((()=>{p(!0),m(!1)})),()=>{e.abort()}}),[b,c,a]),(0,l.jsx)(l.Fragment,{children:x?(0,l.jsx)(o,{}):(0,l.jsx)(l.Fragment,{children:u?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:b}),". Please verify the link or try again later."]}):(0,l.jsx)(r.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(4673),i=s(5893);const r=e=>{let{children:n,open:s,title:r}=e;return(0,i.jsx)(t.Z,{open:s,className:"faq",summary:(0,i.jsx)("summary",{children:(0,i.jsx)("strong",{children:r})}),children:(0,i.jsx)("section",{children:n})})}},8609:(e,n,s)=>{s.d(n,{A:()=>l});var t=s(4673);const i=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var r=s(5893);const l=e=>{let{records:n,open:s}=e;return(0,r.jsx)(t.Z,{open:s,summary:(0,r.jsxs)("summary",{children:[(0,r.jsx)(i,{})," History"]}),className:"history",children:(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Version"}),(0,r.jsx)("th",{children:"Changes"})]})}),(0,r.jsx)("tbody",{children:n.map(((e,n)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,r.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>x});var t=s(3692),i=s(4297);const r=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),c=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const x=e=>{let{level:n,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(r,{})},1:{title:"Experimental",icon:(0,h.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(c,{})},2:{title:"Stable",icon:(0,h.jsx)(a,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:i[n].title}),i[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:a,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...i,width:r,height:r,stroke:s,strokeWidth:o?24*Number(l)/Number(r):l,className:["lucide",`lucide-${x=e,x.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,c].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var x}));return s.displayName=`${e}`,s}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.212a933d.js b/assets/js/runtime~main.4212af77.js similarity index 58% rename from assets/js/runtime~main.212a933d.js rename to assets/js/runtime~main.4212af77.js index 8cce907456..02e99ece60 100644 --- a/assets/js/runtime~main.212a933d.js +++ b/assets/js/runtime~main.4212af77.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,f,c,d,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var f=t[e]={exports:{}};return b[e].call(f.exports,f,f.exports,r),f.exports}r.m=b,e=[],r.O=(a,f,c,d)=>{if(!f){var b=1/0;for(i=0;i=d)&&Object.keys(r.O).every((e=>r.O[e](f[o])))?f.splice(o--,1):(t=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[f,c,d]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var d=Object.create(null);r.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(d,b),d},r.d=(e,a)=>{for(var f in a)r.o(a,f)&&!r.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,f)=>(r.f[f](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",81:"8fcb4d7f",384:"1cee01a7",452:"a55c4658",505:"f1dc11e5",556:"22161331",576:"54768732",630:"f54f1246",641:"59e52bc2",979:"4e6d26eb",1233:"c84c75a7",1411:"20afe101",1420:"54eaaaae",1429:"e19cd79a",1437:"bc31cbdb",1465:"fb880757",1611:"822ff0a2",2002:"d2b048c9",2030:"ad7b17cf",2456:"c2813336",2496:"13833ed5",2714:"2a05ee09",2839:"2bc14e22",2991:"ed06a4b6",2995:"32f1b34f",3237:"1df93b7f",3326:"f4597ecd",3433:"76dfa484",3561:"5814edec",3586:"4e92b6b6",3751:"3720c009",3776:"f76f5ab7",4116:"cdbda324",4121:"55960ee5",4173:"4edc808e",4243:"3226d26d",4368:"a94703ab",4403:"b07748b5",5003:"57495183",5072:"0e27d5d9",5775:"11a54026",5807:"f8d74a12",5909:"f43af5ae",6061:"b80d201b",6159:"db044f71",7272:"0fd3066c",7435:"b825a63d",7918:"17896441",7920:"1a4e3797",8054:"7ccab252",8263:"546b1c5f",8406:"cffacdf0",8453:"508f32b9",8518:"a7bd4aaa",8534:"8b8ccc10",8625:"11e11f3b",8722:"5834a125",8806:"9e767aa9",8882:"3945bec1",9140:"df04d3c8",9308:"8e56b1fa",9380:"ac5f2e4a",9458:"1568425c",9594:"3be0564c",9661:"5e95c892",9924:"df203c0f",9961:"f11325fe",9964:"7fbd6b3a"}[e]||e)+"."+{53:"2459718c",81:"775cd8a1",384:"67bafbd9",452:"d2d37fb7",505:"e9c930e2",556:"bdd78c44",576:"7adc3ec4",630:"3d0942fa",641:"2b8c3e3c",979:"3058face",1233:"bc5502d7",1411:"be6389dc",1420:"22d6bdf5",1429:"d82572fa",1437:"ea3bd4c2",1465:"7c9dd290",1611:"d2b9e2d9",1772:"b0ede415",2002:"7ea067b0",2030:"9952a969",2456:"514f73c4",2496:"3d37ad7a",2714:"1e59c012",2839:"684b748e",2991:"46e32666",2995:"be941bc6",3237:"8f7e93f0",3326:"a48e25c9",3433:"abc20e14",3561:"dcf7d68b",3586:"4e5b1065",3751:"8c42b22a",3776:"8bdadfff",4116:"fbef41bf",4121:"4f929515",4173:"1929d38c",4243:"e340bb5c",4368:"265346fe",4403:"e822c15e",5003:"d7fc7e0f",5020:"614bd897",5072:"777a9488",5525:"36b2ab15",5775:"7e616dd9",5807:"650ad441",5909:"b162e030",6061:"074f18ce",6159:"a1084822",7272:"e8dbfbc3",7435:"cf070d2a",7918:"569c1c67",7920:"b37fdfae",8054:"53d7e12b",8263:"a8bfad30",8406:"7e0341de",8443:"30345cef",8453:"cc76f031",8518:"687d6c08",8534:"1c3b82e9",8625:"958ffa2a",8722:"6ad752fa",8806:"33391d2e",8882:"42f65154",9140:"1dfc1fb6",9308:"bbf9e2fc",9380:"75c0af2a",9458:"6348d27b",9594:"99fbf261",9661:"5a7f2413",9924:"56844b1b",9961:"0f31a6f3",9964:"b2a4ea36"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},d="website:",r.l=(e,a,f,b)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var d=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),d&&d.forEach((e=>e(f))),a)return a(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/node-mysql2/",r.gca=function(e){return e={17896441:"7918",22161331:"556",54768732:"576",57495183:"5003","935f2afb":"53","8fcb4d7f":"81","1cee01a7":"384",a55c4658:"452",f1dc11e5:"505",f54f1246:"630","59e52bc2":"641","4e6d26eb":"979",c84c75a7:"1233","20afe101":"1411","54eaaaae":"1420",e19cd79a:"1429",bc31cbdb:"1437",fb880757:"1465","822ff0a2":"1611",d2b048c9:"2002",ad7b17cf:"2030",c2813336:"2456","13833ed5":"2496","2a05ee09":"2714","2bc14e22":"2839",ed06a4b6:"2991","32f1b34f":"2995","1df93b7f":"3237",f4597ecd:"3326","76dfa484":"3433","5814edec":"3561","4e92b6b6":"3586","3720c009":"3751",f76f5ab7:"3776",cdbda324:"4116","55960ee5":"4121","4edc808e":"4173","3226d26d":"4243",a94703ab:"4368",b07748b5:"4403","0e27d5d9":"5072","11a54026":"5775",f8d74a12:"5807",f43af5ae:"5909",b80d201b:"6061",db044f71:"6159","0fd3066c":"7272",b825a63d:"7435","1a4e3797":"7920","7ccab252":"8054","546b1c5f":"8263",cffacdf0:"8406","508f32b9":"8453",a7bd4aaa:"8518","8b8ccc10":"8534","11e11f3b":"8625","5834a125":"8722","9e767aa9":"8806","3945bec1":"8882",df04d3c8:"9140","8e56b1fa":"9308",ac5f2e4a:"9380","1568425c":"9458","3be0564c":"9594","5e95c892":"9661",df203c0f:"9924",f11325fe:"9961","7fbd6b3a":"9964"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,f)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)f.push(c[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var d=new Promise(((f,d)=>c=e[a]=[f,d]));f.push(c[2]=d);var b=r.p+r.u(a),t=new Error;r.l(b,(f=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var d=f&&("load"===f.type?"missing":f.type),b=f&&f.target&&f.target.src;t.message="Loading chunk "+a+" failed.\n("+d+": "+b+")",t.name="ChunkLoadError",t.type=d,t.request=b,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,f)=>{var c,d,b=f[0],t=f[1],o=f[2],n=0;if(b.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(f);n{"use strict";var e,a,f,d,c,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var f=t[e]={exports:{}};return b[e].call(f.exports,f,f.exports,r),f.exports}r.m=b,e=[],r.O=(a,f,d,c)=>{if(!f){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every((e=>r.O[e](f[o])))?f.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[f,d,c]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&d&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(c,b),c},r.d=(e,a)=>{for(var f in a)r.o(a,f)&&!r.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,f)=>(r.f[f](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",81:"8fcb4d7f",384:"1cee01a7",452:"a55c4658",505:"f1dc11e5",556:"22161331",576:"54768732",630:"f54f1246",641:"59e52bc2",979:"4e6d26eb",1233:"c84c75a7",1411:"20afe101",1420:"54eaaaae",1429:"e19cd79a",1437:"bc31cbdb",1465:"fb880757",1611:"822ff0a2",2002:"d2b048c9",2030:"ad7b17cf",2456:"c2813336",2496:"13833ed5",2714:"2a05ee09",2839:"2bc14e22",2991:"ed06a4b6",2995:"32f1b34f",3237:"1df93b7f",3326:"f4597ecd",3433:"76dfa484",3561:"5814edec",3586:"4e92b6b6",3751:"3720c009",3776:"f76f5ab7",4116:"cdbda324",4121:"55960ee5",4173:"4edc808e",4243:"3226d26d",4368:"a94703ab",4403:"b07748b5",5003:"57495183",5072:"0e27d5d9",5775:"11a54026",5807:"f8d74a12",5909:"f43af5ae",6061:"b80d201b",6159:"db044f71",7272:"0fd3066c",7435:"b825a63d",7918:"17896441",7920:"1a4e3797",8054:"7ccab252",8263:"546b1c5f",8406:"cffacdf0",8453:"508f32b9",8518:"a7bd4aaa",8534:"8b8ccc10",8625:"11e11f3b",8722:"5834a125",8806:"9e767aa9",8882:"3945bec1",9140:"df04d3c8",9308:"8e56b1fa",9380:"ac5f2e4a",9458:"1568425c",9594:"3be0564c",9661:"5e95c892",9924:"df203c0f",9961:"f11325fe",9964:"7fbd6b3a"}[e]||e)+"."+{53:"2459718c",81:"439505a5",384:"67bafbd9",452:"d2d37fb7",505:"e9c930e2",556:"bdd78c44",576:"2ebf0dd6",630:"3d0942fa",641:"58047b61",979:"3058face",1233:"bc5502d7",1411:"be6389dc",1420:"09adf8e5",1429:"cb693707",1437:"ea3bd4c2",1465:"7c9dd290",1611:"d2b9e2d9",1772:"b0ede415",2002:"7ea067b0",2030:"9952a969",2456:"514f73c4",2496:"3d37ad7a",2714:"1e59c012",2839:"4e0be83f",2991:"46e32666",2995:"be941bc6",3237:"7c544ac9",3326:"a48e25c9",3433:"abc20e14",3561:"dcf7d68b",3586:"4e5b1065",3751:"8c42b22a",3776:"8bdadfff",4116:"5473c064",4121:"4f929515",4173:"7f854e52",4243:"e340bb5c",4368:"265346fe",4403:"6c0d5c52",5003:"a3a923b6",5020:"614bd897",5072:"777a9488",5525:"36b2ab15",5775:"7e616dd9",5807:"2efd1f29",5909:"b162e030",6061:"9b7031af",6159:"bd4db484",7272:"e8dbfbc3",7435:"cf070d2a",7918:"569c1c67",7920:"b37fdfae",8054:"f82d2892",8263:"a8bfad30",8406:"7e0341de",8443:"30345cef",8453:"cc76f031",8518:"687d6c08",8534:"a9b6fe0b",8625:"bcef533c",8722:"6ad752fa",8806:"244f9a95",8882:"42f65154",9140:"1dfc1fb6",9308:"bbf9e2fc",9380:"75c0af2a",9458:"9968efa5",9594:"99fbf261",9661:"5a7f2413",9924:"56844b1b",9961:"0f31a6f3",9964:"80d8bb64"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},c="website:",r.l=(e,a,f,b)=>{if(d[e])d[e].push(a);else{var t,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach((e=>e(f))),a)return a(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/node-mysql2/",r.gca=function(e){return e={17896441:"7918",22161331:"556",54768732:"576",57495183:"5003","935f2afb":"53","8fcb4d7f":"81","1cee01a7":"384",a55c4658:"452",f1dc11e5:"505",f54f1246:"630","59e52bc2":"641","4e6d26eb":"979",c84c75a7:"1233","20afe101":"1411","54eaaaae":"1420",e19cd79a:"1429",bc31cbdb:"1437",fb880757:"1465","822ff0a2":"1611",d2b048c9:"2002",ad7b17cf:"2030",c2813336:"2456","13833ed5":"2496","2a05ee09":"2714","2bc14e22":"2839",ed06a4b6:"2991","32f1b34f":"2995","1df93b7f":"3237",f4597ecd:"3326","76dfa484":"3433","5814edec":"3561","4e92b6b6":"3586","3720c009":"3751",f76f5ab7:"3776",cdbda324:"4116","55960ee5":"4121","4edc808e":"4173","3226d26d":"4243",a94703ab:"4368",b07748b5:"4403","0e27d5d9":"5072","11a54026":"5775",f8d74a12:"5807",f43af5ae:"5909",b80d201b:"6061",db044f71:"6159","0fd3066c":"7272",b825a63d:"7435","1a4e3797":"7920","7ccab252":"8054","546b1c5f":"8263",cffacdf0:"8406","508f32b9":"8453",a7bd4aaa:"8518","8b8ccc10":"8534","11e11f3b":"8625","5834a125":"8722","9e767aa9":"8806","3945bec1":"8882",df04d3c8:"9140","8e56b1fa":"9308",ac5f2e4a:"9380","1568425c":"9458","3be0564c":"9594","5e95c892":"9661",df203c0f:"9924",f11325fe:"9961","7fbd6b3a":"9964"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,f)=>{var d=r.o(e,a)?e[a]:void 0;if(0!==d)if(d)f.push(d[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var c=new Promise(((f,c)=>d=e[a]=[f,c]));f.push(d[2]=c);var b=r.p+r.u(a),t=new Error;r.l(b,(f=>{if(r.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var c=f&&("load"===f.type?"missing":f.type),b=f&&f.target&&f.target.src;t.message="Loading chunk "+a+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,d[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,f)=>{var d,c,b=f[0],t=f[1],o=f[2],n=0;if(b.some((a=>0!==e[a]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(a&&a(f);n MySQL2 | Quickstart - + diff --git a/docs/acknowledgements.html b/docs/acknowledgements.html index 12c0e5eca8..675bc23ed6 100644 --- a/docs/acknowledgements.html +++ b/docs/acknowledgements.html @@ -4,7 +4,7 @@ Acknowledgements | Quickstart - + diff --git a/docs/api-and-configurations.html b/docs/api-and-configurations.html index af7217a9f3..435331af7e 100644 --- a/docs/api-and-configurations.html +++ b/docs/api-and-configurations.html @@ -4,7 +4,7 @@ API and Configuration | Quickstart - + diff --git a/docs/contributing.html b/docs/contributing.html index c441826694..757ee26736 100644 --- a/docs/contributing.html +++ b/docs/contributing.html @@ -4,7 +4,7 @@ Contributing - + diff --git a/docs/contributing/website.html b/docs/contributing/website.html index bc42b7a3b1..39eceab05e 100644 --- a/docs/contributing/website.html +++ b/docs/contributing/website.html @@ -4,7 +4,7 @@ Documentation Site | Quickstart - + diff --git a/docs/documentation.html b/docs/documentation.html index 77b2bff6db..dc11b314ae 100644 --- a/docs/documentation.html +++ b/docs/documentation.html @@ -4,7 +4,7 @@ Documentation - + diff --git a/docs/documentation/authentication-switch.html b/docs/documentation/authentication-switch.html index 026cdad7e7..87ea58169c 100644 --- a/docs/documentation/authentication-switch.html +++ b/docs/documentation/authentication-switch.html @@ -4,7 +4,7 @@ Authentication Switch Request | Quickstart - + diff --git a/docs/documentation/extras.html b/docs/documentation/extras.html index ac2ccbcb60..e9d76b7587 100644 --- a/docs/documentation/extras.html +++ b/docs/documentation/extras.html @@ -4,7 +4,7 @@ Extra Features | Quickstart - + diff --git a/docs/documentation/mysql-server.html b/docs/documentation/mysql-server.html index 7945a1b080..696480f9f6 100644 --- a/docs/documentation/mysql-server.html +++ b/docs/documentation/mysql-server.html @@ -4,7 +4,7 @@ MySQL Server API | Quickstart - + diff --git a/docs/documentation/prepared-statements.html b/docs/documentation/prepared-statements.html index a4570bf3b6..7d77945128 100644 --- a/docs/documentation/prepared-statements.html +++ b/docs/documentation/prepared-statements.html @@ -4,7 +4,7 @@ Prepared Statements | Quickstart - + diff --git a/docs/documentation/promise-wrapper.html b/docs/documentation/promise-wrapper.html index d48549f8b6..aeb39e0af2 100644 --- a/docs/documentation/promise-wrapper.html +++ b/docs/documentation/promise-wrapper.html @@ -4,7 +4,7 @@ Promise Wrappers | Quickstart - + diff --git a/docs/documentation/typescript-examples.html b/docs/documentation/typescript-examples.html index 733ff22eec..881f76030b 100644 --- a/docs/documentation/typescript-examples.html +++ b/docs/documentation/typescript-examples.html @@ -4,7 +4,7 @@ Using MySQL2 with TypeScript | Quickstart - + diff --git a/docs/examples.html b/docs/examples.html index dd015f0e0c..e660b27d72 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -4,7 +4,7 @@ Examples - + diff --git a/docs/examples/binlog-watcher.html b/docs/examples/binlog-watcher.html index 23339b8d15..cdda8d0891 100644 --- a/docs/examples/binlog-watcher.html +++ b/docs/examples/binlog-watcher.html @@ -4,7 +4,7 @@ Binlog Watcher | Quickstart - + diff --git a/docs/examples/connections/create-connection.html b/docs/examples/connections/create-connection.html index 98799ac6b0..9173fd9677 100644 --- a/docs/examples/connections/create-connection.html +++ b/docs/examples/connections/create-connection.html @@ -4,7 +4,7 @@ createConnection | Quickstart - + diff --git a/docs/examples/connections/create-pool.html b/docs/examples/connections/create-pool.html index ebf08abdb8..caf15ff83b 100644 --- a/docs/examples/connections/create-pool.html +++ b/docs/examples/connections/create-pool.html @@ -4,7 +4,7 @@ createPool | Quickstart - + @@ -87,10 +87,7 @@

crea

Glossary

PoolOptions

-
-

PoolOptions extends all options from ConnectionOptions:

-
ConnectionOptions Specification
-
+

PoolOptions extends all options from ConnectionOptions:

ConnectionOptions Specification
PoolOptions Specification
\ No newline at end of file diff --git a/docs/examples/connections/createPoolCluster.html b/docs/examples/connections/createPoolCluster.html index db19d71a4a..beb22fc823 100644 --- a/docs/examples/connections/createPoolCluster.html +++ b/docs/examples/connections/createPoolCluster.html @@ -4,7 +4,7 @@ createPoolCluster | Quickstart - + @@ -82,10 +82,7 @@

add(g

Glossary

PoolOptions

-
-

PoolOptions extends all options from ConnectionOptions:

-
ConnectionOptions Specification
-
+

PoolOptions extends all options from ConnectionOptions:

ConnectionOptions Specification
PoolOptions Specification
\ No newline at end of file diff --git a/docs/examples/promise-wrapper/co-await.html b/docs/examples/promise-wrapper/co-await.html index 8b33e3cedf..3dfe6c8f99 100644 --- a/docs/examples/promise-wrapper/co-await.html +++ b/docs/examples/promise-wrapper/co-await.html @@ -4,7 +4,7 @@ await — co | Quickstart - + diff --git a/docs/examples/queries/prepared-statements.html b/docs/examples/queries/prepared-statements.html index 0454c87030..2fdf948d4c 100644 --- a/docs/examples/queries/prepared-statements.html +++ b/docs/examples/queries/prepared-statements.html @@ -4,7 +4,7 @@ Prepared Statements | Quickstart - + diff --git a/docs/examples/queries/prepared-statements/delete.html b/docs/examples/queries/prepared-statements/delete.html index e1d2f9fa9d..684262d82b 100644 --- a/docs/examples/queries/prepared-statements/delete.html +++ b/docs/examples/queries/prepared-statements/delete.html @@ -4,7 +4,7 @@ DELETE | Quickstart - + diff --git a/docs/examples/queries/prepared-statements/insert.html b/docs/examples/queries/prepared-statements/insert.html index e1cd719b46..bb554f0e5d 100644 --- a/docs/examples/queries/prepared-statements/insert.html +++ b/docs/examples/queries/prepared-statements/insert.html @@ -4,7 +4,7 @@ INSERT | Quickstart - + diff --git a/docs/examples/queries/prepared-statements/select.html b/docs/examples/queries/prepared-statements/select.html index 8d4bed71d7..2461933e50 100644 --- a/docs/examples/queries/prepared-statements/select.html +++ b/docs/examples/queries/prepared-statements/select.html @@ -4,7 +4,7 @@ SELECT | Quickstart - + diff --git a/docs/examples/queries/prepared-statements/update.html b/docs/examples/queries/prepared-statements/update.html index b184cf5479..2f36b29144 100644 --- a/docs/examples/queries/prepared-statements/update.html +++ b/docs/examples/queries/prepared-statements/update.html @@ -4,7 +4,7 @@ UPDATE | Quickstart - + diff --git a/docs/examples/queries/simple-queries.html b/docs/examples/queries/simple-queries.html index b1aa69354a..883f2c8de7 100644 --- a/docs/examples/queries/simple-queries.html +++ b/docs/examples/queries/simple-queries.html @@ -4,7 +4,7 @@ Simple Queries | Quickstart - + diff --git a/docs/examples/queries/simple-queries/delete.html b/docs/examples/queries/simple-queries/delete.html index 656d10a44e..0739a97ea4 100644 --- a/docs/examples/queries/simple-queries/delete.html +++ b/docs/examples/queries/simple-queries/delete.html @@ -4,7 +4,7 @@ DELETE | Quickstart - + diff --git a/docs/examples/queries/simple-queries/insert.html b/docs/examples/queries/simple-queries/insert.html index d3b42ccb19..ccfacfee1b 100644 --- a/docs/examples/queries/simple-queries/insert.html +++ b/docs/examples/queries/simple-queries/insert.html @@ -4,7 +4,7 @@ INSERT | Quickstart - + diff --git a/docs/examples/queries/simple-queries/select.html b/docs/examples/queries/simple-queries/select.html index 45c31fb060..cf5bb49ae6 100644 --- a/docs/examples/queries/simple-queries/select.html +++ b/docs/examples/queries/simple-queries/select.html @@ -4,7 +4,7 @@ SELECT | Quickstart - + diff --git a/docs/examples/queries/simple-queries/update.html b/docs/examples/queries/simple-queries/update.html index 68a43d37cd..1c37469f95 100644 --- a/docs/examples/queries/simple-queries/update.html +++ b/docs/examples/queries/simple-queries/update.html @@ -4,7 +4,7 @@ UPDATE | Quickstart - + diff --git a/docs/examples/tests/mysql-proxy.html b/docs/examples/tests/mysql-proxy.html index 3bdfc73354..48b9eddbb2 100644 --- a/docs/examples/tests/mysql-proxy.html +++ b/docs/examples/tests/mysql-proxy.html @@ -4,7 +4,7 @@ MySQL Proxy | Quickstart - + diff --git a/docs/examples/tests/pool.html b/docs/examples/tests/pool.html index 2333cf0065..74f5035da1 100644 --- a/docs/examples/tests/pool.html +++ b/docs/examples/tests/pool.html @@ -4,7 +4,7 @@ Pool | Quickstart - + diff --git a/docs/examples/tests/server.html b/docs/examples/tests/server.html index e8565d6131..cdeec7fbdf 100644 --- a/docs/examples/tests/server.html +++ b/docs/examples/tests/server.html @@ -4,7 +4,7 @@ Server | Quickstart - + diff --git a/docs/examples/typescript/basic-custom-class.html b/docs/examples/typescript/basic-custom-class.html index c50865391d..ebed8cea35 100644 --- a/docs/examples/typescript/basic-custom-class.html +++ b/docs/examples/typescript/basic-custom-class.html @@ -4,7 +4,7 @@ Basic Custom Class | Quickstart - + diff --git a/docs/examples/typescript/procedure-call/index.html b/docs/examples/typescript/procedure-call/index.html index 5578b6cf96..1ea7593006 100644 --- a/docs/examples/typescript/procedure-call/index.html +++ b/docs/examples/typescript/procedure-call/index.html @@ -4,7 +4,7 @@ Procedure Call Packet | Quickstart - + diff --git a/docs/examples/typescript/procedure-call/row-as-array.html b/docs/examples/typescript/procedure-call/row-as-array.html index ab23e7344b..a42e187a82 100644 --- a/docs/examples/typescript/procedure-call/row-as-array.html +++ b/docs/examples/typescript/procedure-call/row-as-array.html @@ -4,7 +4,7 @@ Procedure Call Packet (Row as Array) | Quickstart - + diff --git a/docs/examples/typescript/row-data/index.html b/docs/examples/typescript/row-data/index.html index 85cee71bb3..516e00d406 100644 --- a/docs/examples/typescript/row-data/index.html +++ b/docs/examples/typescript/row-data/index.html @@ -4,7 +4,7 @@ Row Data Packet | Quickstart - + diff --git a/docs/examples/typescript/row-data/multi-statements.html b/docs/examples/typescript/row-data/multi-statements.html index 7e467f19f6..d76b7e9d9c 100644 --- a/docs/examples/typescript/row-data/multi-statements.html +++ b/docs/examples/typescript/row-data/multi-statements.html @@ -4,7 +4,7 @@ Row Data Packet (Multi Statements) | Quickstart - + diff --git a/docs/examples/typescript/row-data/row-as-array-multi-statements.html b/docs/examples/typescript/row-data/row-as-array-multi-statements.html index c345b130d4..a07e31e73b 100644 --- a/docs/examples/typescript/row-data/row-as-array-multi-statements.html +++ b/docs/examples/typescript/row-data/row-as-array-multi-statements.html @@ -4,7 +4,7 @@ Row Data Packet (Multi Statements and Row as Array) | Quickstart - + diff --git a/docs/examples/typescript/row-data/row-as-array.html b/docs/examples/typescript/row-data/row-as-array.html index b24076129c..cd68a6ce3a 100644 --- a/docs/examples/typescript/row-data/row-as-array.html +++ b/docs/examples/typescript/row-data/row-as-array.html @@ -4,7 +4,7 @@ Row Data Packet (Row as Array) | Quickstart - + diff --git a/docs/faq.html b/docs/faq.html index fdd1464d94..8a17eb7fe2 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -4,7 +4,7 @@ FAQ - + diff --git a/docs/faq/how-to-handle-errors.html b/docs/faq/how-to-handle-errors.html index 4568859004..10999e51d6 100644 --- a/docs/faq/how-to-handle-errors.html +++ b/docs/faq/how-to-handle-errors.html @@ -4,7 +4,7 @@ How to handle errors? | Quickstart - + diff --git a/docs/history-and-why-mysq2.html b/docs/history-and-why-mysq2.html index 465888f393..cbf2a98d9e 100644 --- a/docs/history-and-why-mysq2.html +++ b/docs/history-and-why-mysq2.html @@ -4,7 +4,7 @@ History and Why MySQL2 | Quickstart - + diff --git a/docs/stability-badges.html b/docs/stability-badges.html index 44de63aa52..e0ba3e1b11 100644 --- a/docs/stability-badges.html +++ b/docs/stability-badges.html @@ -4,7 +4,7 @@ Stability Badges | Quickstart - + diff --git a/docs/tags.html b/docs/tags.html index 8ebd0d7e58..e88cc5f93e 100644 --- a/docs/tags.html +++ b/docs/tags.html @@ -4,7 +4,7 @@ Tags | Quickstart - + diff --git a/docs/tags/create-connection.html b/docs/tags/create-connection.html index d925334021..5050de14ae 100644 --- a/docs/tags/create-connection.html +++ b/docs/tags/create-connection.html @@ -4,7 +4,7 @@ One doc tagged with "createConnection" | Quickstart - + diff --git a/docs/tags/create-pool-cluster.html b/docs/tags/create-pool-cluster.html index 5ef3445806..6984ea3946 100644 --- a/docs/tags/create-pool-cluster.html +++ b/docs/tags/create-pool-cluster.html @@ -4,7 +4,7 @@ One doc tagged with "createPoolCluster" | Quickstart - + diff --git a/docs/tags/create-pool.html b/docs/tags/create-pool.html index 3342ffa42b..0059bbfe93 100644 --- a/docs/tags/create-pool.html +++ b/docs/tags/create-pool.html @@ -4,7 +4,7 @@ One doc tagged with "createPool" | Quickstart - + diff --git a/docs/tags/execute.html b/docs/tags/execute.html index d289411546..c2a4f09061 100644 --- a/docs/tags/execute.html +++ b/docs/tags/execute.html @@ -4,7 +4,7 @@ 5 docs tagged with "execute" | Quickstart - + diff --git a/docs/tags/parameters.html b/docs/tags/parameters.html index e7faffc1be..5b20bb5064 100644 --- a/docs/tags/parameters.html +++ b/docs/tags/parameters.html @@ -4,7 +4,7 @@ 4 docs tagged with "Parameters" | Quickstart - + diff --git a/docs/tags/placeholders.html b/docs/tags/placeholders.html index adbaa100f1..e07f48db17 100644 --- a/docs/tags/placeholders.html +++ b/docs/tags/placeholders.html @@ -4,7 +4,7 @@ 4 docs tagged with "Placeholders" | Quickstart - + diff --git a/docs/tags/prepared-statements.html b/docs/tags/prepared-statements.html index 4b962436ff..bd38fe68bc 100644 --- a/docs/tags/prepared-statements.html +++ b/docs/tags/prepared-statements.html @@ -4,7 +4,7 @@ 5 docs tagged with "Prepared Statements" | Quickstart - + diff --git a/docs/tags/query.html b/docs/tags/query.html index 5370368a95..0eee97de37 100644 --- a/docs/tags/query.html +++ b/docs/tags/query.html @@ -4,7 +4,7 @@ 4 docs tagged with "query" | Quickstart - + diff --git a/docs/tags/rds.html b/docs/tags/rds.html index 5f39972222..ee077db606 100644 --- a/docs/tags/rds.html +++ b/docs/tags/rds.html @@ -4,7 +4,7 @@ 3 docs tagged with "RDS" | Quickstart - + diff --git a/docs/tags/sha-1.html b/docs/tags/sha-1.html index b0545bd615..00dd9b7fcd 100644 --- a/docs/tags/sha-1.html +++ b/docs/tags/sha-1.html @@ -4,7 +4,7 @@ 3 docs tagged with "SHA1" | Quickstart - + diff --git a/docs/tags/socks.html b/docs/tags/socks.html index e14837ddc8..ca95423d7b 100644 --- a/docs/tags/socks.html +++ b/docs/tags/socks.html @@ -4,7 +4,7 @@ 3 docs tagged with "Socks" | Quickstart - + diff --git a/docs/tags/ssl.html b/docs/tags/ssl.html index d0e3be0a29..96f289abf1 100644 --- a/docs/tags/ssl.html +++ b/docs/tags/ssl.html @@ -4,7 +4,7 @@ 3 docs tagged with "SSL" | Quickstart - + diff --git a/docs/tags/uri.html b/docs/tags/uri.html index 2c69d19743..6ed9aae530 100644 --- a/docs/tags/uri.html +++ b/docs/tags/uri.html @@ -4,7 +4,7 @@ 3 docs tagged with "URI" | Quickstart - + diff --git a/index.html b/index.html index d4bc3acbb4..76418e3ba3 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Quickstart - + diff --git a/pt-BR/404.html b/pt-BR/404.html index e2948c8481..307ecd978e 100644 --- a/pt-BR/404.html +++ b/pt-BR/404.html @@ -4,7 +4,7 @@ Página não encontrada | Quickstart - + diff --git a/pt-BR/assets/js/11e11f3b.42b7b568.js b/pt-BR/assets/js/11e11f3b.42b7b568.js deleted file mode 100644 index c63722b08f..0000000000 --- a/pt-BR/assets/js/11e11f3b.42b7b568.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8625],{3463:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>u,toc:()=>m});var r=s(5893),t=s(1151),o=s(4866),c=s(5162),l=s(6393),i=s(4379);const a={sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},d="createConnection",u={id:"examples/connections/create-connection",title:"createConnection",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-connection.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-connection",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-connection",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-connection.mdx",tags:[{label:"createConnection",permalink:"/node-mysql2/pt-BR/docs/tags/create-connection"},{label:"URI",permalink:"/node-mysql2/pt-BR/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/pt-BR/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/pt-BR/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/pt-BR/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/pt-BR/docs/tags/socks"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"Introduction",permalink:"/node-mysql2/pt-BR/docs/examples"},next:{title:"createPool",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-pool"}},h={},m=[{value:"createConnection(connectionUri)",id:"createconnectionconnectionuri",level:2},{value:"createConnection(config)",id:"createconnectionconfig",level:2},{value:"createConnection(config) \u2014 SHA1",id:"createconnectionconfig--sha1",level:2},{value:"createConnection(config) \u2014 SSL",id:"createconnectionconfig--ssl",level:2},{value:"createConnection(config) \u2014 RDS SSL",id:"createconnectionconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createConnection(config) \u2014 Socks",id:"createconnectionconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ConnectionOptions",id:"connectionoptions",level:3}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createconnection",children:"createConnection"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconnectionuri",children:"createConnection(connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"createConnection(connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n );\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n);\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig",children:"createConnection(config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--sha1",children:"createConnection(config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--ssl",children:"createConnection(config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsxs)(c.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--rds-ssl",children:"createConnection(config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(c.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await connection.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(c.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n connection.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--socks",children:"createConnection(config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst connection = mysql.createConnection({\n stream: socksProxy,\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsx)(c.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst connection = mysql.createConnection({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"connectionoptions",children:"ConnectionOptions"}),"\n",(0,r.jsx)(l.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>c});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var o=s(5893);function c(e){let{children:n,hidden:s,className:c}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,c),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>S});var r=s(7294),t=s(512),o=s(2466),c=s(6550),l=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const t=(0,c.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})}),[o,t])]}function g(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,o=h(e),[c,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[a,u]=p({queryString:s,groupId:t}),[g,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,o]=(0,d.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&o.set(e)}),[s,o])]}({groupId:t}),j=(()=>{const e=a??g;return m({value:e,tabValues:o})?e:null})();(0,l.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:c,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,o]),tabValues:o}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:c,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,o.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),t=l[s].value;t!==r&&(a(n),c(t))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:o}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...o,className:(0,t.Z)("tabs__item",j.tabItem,o?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:t}=e;const o=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),t=s(2263),o=s(9286),c=s(5893);const l=()=>(0,c.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,m]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!0),{siteConfig:x}=(0,t.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let o=!1,c=0,l="";for(const i of r)if(i.includes(t)&&(o=!0),o&&(i.includes("{")&&c++,l+=i+"\n",i.includes("}")&&(c--,0===c)))break;return l.trim()||e})(e,i,a):e;u(n||e),m(!1),g(!1)})).catch((()=>{g(!0),m(!1)})),()=>{e.abort()}}),[f,i,a]),(0,c.jsx)(c.Fragment,{children:h?(0,c.jsx)(l,{}):(0,c.jsx)(c.Fragment,{children:p?(0,c.jsxs)("div",{children:["Unable to access the requested link: ",(0,c.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,c.jsx)(o.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>o});var r=s(4673),t=s(5893);const o=e=>{let{children:n,open:s,title:o}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/11e11f3b.8de961eb.js b/pt-BR/assets/js/11e11f3b.8de961eb.js new file mode 100644 index 0000000000..0f6c614eef --- /dev/null +++ b/pt-BR/assets/js/11e11f3b.8de961eb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8625],{3463:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>u,toc:()=>m});var r=s(5893),t=s(1151),o=s(4866),c=s(5162),l=s(6393),i=s(4379);const a={sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},d="createConnection",u={id:"examples/connections/create-connection",title:"createConnection",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-connection.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-connection",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-connection",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-connection.mdx",tags:[{label:"createConnection",permalink:"/node-mysql2/pt-BR/docs/tags/create-connection"},{label:"URI",permalink:"/node-mysql2/pt-BR/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/pt-BR/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/pt-BR/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/pt-BR/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/pt-BR/docs/tags/socks"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"Introduction",permalink:"/node-mysql2/pt-BR/docs/examples"},next:{title:"createPool",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-pool"}},h={},m=[{value:"createConnection(connectionUri)",id:"createconnectionconnectionuri",level:2},{value:"createConnection(config)",id:"createconnectionconfig",level:2},{value:"createConnection(config) \u2014 SHA1",id:"createconnectionconfig--sha1",level:2},{value:"createConnection(config) \u2014 SSL",id:"createconnectionconfig--ssl",level:2},{value:"createConnection(config) \u2014 RDS SSL",id:"createconnectionconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createConnection(config) \u2014 Socks",id:"createconnectionconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ConnectionOptions",id:"connectionoptions",level:3}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createconnection",children:"createConnection"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconnectionuri",children:"createConnection(connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"createConnection(connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n );\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n);\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig",children:"createConnection(config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--sha1",children:"createConnection(config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--ssl",children:"createConnection(config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsxs)(c.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--rds-ssl",children:"createConnection(config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(c.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await connection.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(c.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n connection.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--socks",children:"createConnection(config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst connection = mysql.createConnection({\n stream: socksProxy,\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsx)(c.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst connection = mysql.createConnection({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"connectionoptions",children:"ConnectionOptions"}),"\n",(0,r.jsx)(l.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>c});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var o=s(5893);function c(e){let{children:n,hidden:s,className:c}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,c),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>S});var r=s(7294),t=s(512),o=s(2466),c=s(6550),l=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const t=(0,c.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})}),[o,t])]}function g(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,o=h(e),[c,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[a,u]=p({queryString:s,groupId:t}),[g,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,o]=(0,d.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&o.set(e)}),[s,o])]}({groupId:t}),j=(()=>{const e=a??g;return m({value:e,tabValues:o})?e:null})();(0,l.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:c,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,o]),tabValues:o}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:c,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,o.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),t=l[s].value;t!==r&&(a(n),c(t))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:o}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...o,className:(0,t.Z)("tabs__item",j.tabItem,o?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:t}=e;const o=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),t=s(2263),o=s(9286),c=s(5893);const l=()=>(0,c.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,m]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!0),{siteConfig:x}=(0,t.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let o=!1,c=0,l="";for(const i of r)if(i.includes(t)&&(o=!0),o&&(i.includes("{")&&c++,l+=i+"\n",i.includes("}")&&(c--,0===c)))break;return l.trim()||e})(e,i,a):e;u(n||e),m(!1),g(!1)})).catch((()=>{g(!0),m(!1)})),()=>{e.abort()}}),[f,i,a]),(0,c.jsx)(c.Fragment,{children:h?(0,c.jsx)(l,{}):(0,c.jsx)(c.Fragment,{children:p?(0,c.jsxs)("div",{children:["Unable to access the requested link: ",(0,c.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,c.jsx)(o.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>o});var r=s(4673),t=s(5893);const o=e=>{let{children:n,open:s,title:o}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/1568425c.21df2514.js b/pt-BR/assets/js/1568425c.21df2514.js deleted file mode 100644 index 24411e7a38..0000000000 --- a/pt-BR/assets/js/1568425c.21df2514.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9458],{904:(e,s,i)=>{i.r(s),i.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>n,metadata:()=>a,toc:()=>o});var t=i(5893),r=i(1151);const n={},l="Simple Queries",a={id:"examples/queries/simple-queries/index",title:"Simple Queries",description:"For Prepared Statements or Placeholders / Parameters examples, please see here.",source:"@site/docs/examples/queries/simple-queries/index.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster"},next:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert"}},c={},o=[];function d(e){const s={a:"a",admonition:"admonition",h1:"h1",hr:"hr",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"simple-queries",children:"Simple Queries"}),"\n",(0,t.jsx)(s.admonition,{type:"info",children:(0,t.jsxs)(s.p,{children:["For ",(0,t.jsx)(s.strong,{children:"Prepared Statements"})," or ",(0,t.jsx)(s.strong,{children:"Placeholders"})," / ",(0,t.jsx)(s.strong,{children:"Parameters"})," examples, please see ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements",children:"here"}),"."]})}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,t.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/insert",children:(0,t.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/select",children:(0,t.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/update",children:(0,t.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/delete",children:(0,t.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function p(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},1151:(e,s,i)=>{i.d(s,{Z:()=>a,a:()=>l});var t=i(7294);const r={},n=t.createContext(r);function l(e){const s=t.useContext(n);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),t.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/1568425c.2ed6fce8.js b/pt-BR/assets/js/1568425c.2ed6fce8.js new file mode 100644 index 0000000000..55e6a9558b --- /dev/null +++ b/pt-BR/assets/js/1568425c.2ed6fce8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9458],{904:(e,s,i)=>{i.r(s),i.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>n,metadata:()=>a,toc:()=>o});var t=i(5893),r=i(1151);const n={},l="Simple Queries",a={id:"examples/queries/simple-queries/index",title:"Simple Queries",description:"For Prepared Statements or Placeholders / Parameters examples, please see here.",source:"@site/docs/examples/queries/simple-queries/index.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster"},next:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert"}},c={},o=[];function d(e){const s={a:"a",admonition:"admonition",h1:"h1",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h1,{id:"simple-queries",children:"Simple Queries"}),"\n",(0,t.jsx)(s.admonition,{type:"info",children:(0,t.jsxs)(s.p,{children:["For ",(0,t.jsx)(s.strong,{children:"Prepared Statements"})," or ",(0,t.jsx)(s.strong,{children:"Placeholders"})," / ",(0,t.jsx)(s.strong,{children:"Parameters"})," examples, please see ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements",children:"here"}),"."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,t.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/insert",children:(0,t.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/select",children:(0,t.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/update",children:(0,t.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,t.jsxs)(s.li,{className:"task-list-item",children:[(0,t.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,t.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/delete",children:(0,t.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function p(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},1151:(e,s,i)=>{i.d(s,{Z:()=>a,a:()=>l});var t=i(7294);const r={},n=t.createContext(r);function l(e){const s=t.useContext(n);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),t.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/1df93b7f.7c544ac9.js b/pt-BR/assets/js/1df93b7f.7c544ac9.js new file mode 100644 index 0000000000..33182a81c7 --- /dev/null +++ b/pt-BR/assets/js/1df93b7f.7c544ac9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{9754:(e,s,n)=>{n.r(s),n.d(s,{default:()=>i});var t=n(6550),c=n(2263),u=n(5893);const i=function(){const{i18n:e,siteConfig:s}=(0,c.Z)(),{baseUrl:n}=s,i=e.currentLocale,o="en"===i||n.includes(i)?`${n}docs`:`${n}${i}/docs`;return(0,u.jsx)(t.l_,{to:o})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/1df93b7f.8f7e93f0.js b/pt-BR/assets/js/1df93b7f.8f7e93f0.js deleted file mode 100644 index 6dfb81a400..0000000000 --- a/pt-BR/assets/js/1df93b7f.8f7e93f0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{9754:(e,s,t)=>{t.r(s),t.d(s,{default:()=>r});var n=t(6550),c=t(2263),o=t(5893);const r=function(){const{i18n:e,siteConfig:s}=(0,c.Z)(),{baseUrl:t}=s,r=e.currentLocale,u="en"===r?`${t}docs`:`${t}${r}/docs`;return(0,o.jsx)(n.l_,{to:u})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/2bc14e22.2670f877.js b/pt-BR/assets/js/2bc14e22.2670f877.js deleted file mode 100644 index 5523273667..0000000000 --- a/pt-BR/assets/js/2bc14e22.2670f877.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 2bc14e22.2670f877.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2839],{4760:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>x,frontMatter:()=>a,metadata:()=>i,toc:()=>h});var t=s(5893),r=s(1151),l=s(8609),c=s(3901);const a={},o="Using MySQL2 with TypeScript",i={id:"documentation/typescript-examples",title:"Using MySQL2 with TypeScript",description:"Installation",source:"@site/docs/documentation/typescript-examples.mdx",sourceDirName:"documentation",slug:"/documentation/typescript-examples",permalink:"/node-mysql2/pt-BR/docs/documentation/typescript-examples",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/typescript-examples.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Promise Wrappers",permalink:"/node-mysql2/pt-BR/docs/documentation/promise-wrapper"},next:{title:"API e Configura\xe7\xe3o",permalink:"/node-mysql2/pt-BR/docs/api-and-configurations"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"Usage",id:"usage",level:2},{value:"Connection",id:"connection",level:3},{value:"Pool Connection",id:"pool-connection",level:3},{value:"Query and Execute",id:"query-and-execute",level:3},{value:"A simple query",id:"a-simple-query",level:4},{value:"Type Specification",id:"type-specification",level:2},{value:"RowDataPacket[]",id:"rowdatapacket",level:3},{value:"RowDataPacket[][]",id:"rowdatapacket-1",level:3},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"ResultSetHeader[]",id:"resultsetheader-1",level:3},{value:"ProcedureCallPacket",id:"procedurecallpacket",level:3},{value:"OkPacket",id:"okpacket",level:3},{value:"Examples",id:"examples",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"using-mysql2-with-typescript",children:"Using MySQL2 with TypeScript"}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"@types/node"})," ensure the proper interaction between ",(0,t.jsx)(n.strong,{children:"TypeScript"})," and the ",(0,t.jsx)(n.strong,{children:"Node.js"})," modules used by ",(0,t.jsx)(n.strong,{children:"MySQL2"})," (",(0,t.jsx)(n.em,{children:"net"}),", ",(0,t.jsx)(n.em,{children:"events"}),", ",(0,t.jsx)(n.em,{children:"stream"}),", ",(0,t.jsx)(n.em,{children:"tls"}),", etc.)."]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires ",(0,t.jsx)(n.strong,{children:"TypeScript"})," ",(0,t.jsx)(n.code,{children:">=4.5.2"}),"."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["You can import ",(0,t.jsx)(n.strong,{children:"MySQL2"})," in two ways:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"true"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql from 'mysql2';\nimport mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"false"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import * as mysql from 'mysql2';\nimport * as mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsx)(n.h3,{id:"connection",children:"Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ConnectionOptions } from 'mysql2';\n\nconst access: ConnectionOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createConnection(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"pool-connection",children:"Pool Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { PoolOptions } from 'mysql2';\n\nconst access: PoolOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createPool(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"query-and-execute",children:"Query and Execute"}),"\n",(0,t.jsx)(n.h4,{id:"a-simple-query",children:"A simple query"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\nconn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"rows"})," output will be these possible types:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[][]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"In this example, you need to manually check the output types"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"type-specification",children:"Type Specification"}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket",children:"RowDataPacket[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(n.p,{children:"An array with the returned rows, for example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n// SELECT\nconn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { Tables_in_test: 'test' } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"rowsAsArray"})," option as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n rowsAsArray: true,\n});\n\n// SELECT\nconn.query(\n 'SELECT 1 + 1 AS test, 2 + 2 AS test;',\n (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 2, 4 ] ]\n */\n }\n);\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 'test' ] ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket-1",children:"RowDataPacket[][]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," option as ",(0,t.jsx)(n.code,{children:"true"})," with multiple queries:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SELECT 1 + 1 AS test;\n SELECT 2 + 2 AS test;\n`;\n\nconn.query(sql, (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"changedRows"})," option is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"affectedRows"})," instead."]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc.:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\nconst sql = `\n SET @1 = 1;\n`;\n\nconn.query(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader-1",children:"ResultSetHeader[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ResultSetHeader[]"})]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For multiples ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc. when using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SET @1 = 1;\n SET @2 = 2;\n`;\n\nconn.query(sql, (_err, results) => {\n console.log(results);\n /**\n * @results: [\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 10,\n warningStatus: 0,\n changedRows: 0\n },\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"procedurecallpacket",children:"ProcedureCallPacket"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ProcedureCallPacket"})]})]}]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["By performing a ",(0,t.jsx)(n.strong,{children:"Call Procedure"})," using ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", etc., the return will be a ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})," (even if you perform multiples queries and set ",(0,t.jsx)(n.code,{children:"multipleStatements"})," to ",(0,t.jsx)(n.code,{children:"true"}),"):"]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n/** ResultSetHeader */\nconn.query('DROP PROCEDURE IF EXISTS myProcedure');\n\n/** ResultSetHeader */\nconn.query(`\n CREATE PROCEDURE myProcedure()\n BEGIN\n SET @1 = 1;\n SET @2 = 2;\n END\n `);\n\n/** ProcedureCallPacket */\nconst sql = 'CALL myProcedure()';\n\nconn.query>(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"CREATE PROCEDURE"})," and ",(0,t.jsx)(n.code,{children:"DROP PROCEDURE"}),", these returns will be the ",(0,t.jsx)(n.em,{children:"default"})," ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["By using ",(0,t.jsx)(n.code,{children:"SELECT"})," and ",(0,t.jsx)(n.code,{children:"SHOW"})," queries in a ",(0,t.jsx)(n.strong,{children:"Procedure Call"}),", it groups the results as:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"/** ProcedureCallPacket */\n[RowDataPacket[], ResultSetHeader]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"}),", please see the following examples."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"okpacket",children:"OkPacket"}),"\n",(0,t.jsx)(c.X,{level:0,message:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,t.jsxs)(n.p,{children:["You can also check some code examples using ",(0,t.jsx)(n.strong,{children:"MySQL2"})," and ",(0,t.jsx)(n.strong,{children:"TypeScript"})," to understand advanced concepts:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/index",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array-multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"}),", ",(0,t.jsx)(n.code,{children:"rowAsArray"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/index",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/row-as-array",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/basic-custom-class",children:["Creating a basic custom ",(0,t.jsx)(n.strong,{children:"MySQL2"})," ",(0,t.jsx)(n.strong,{children:"Class"})]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4673:(e,n,s)=>{s.d(n,{Z:()=>p});var t=s(7294),r=s(512),l=s(2389),c=s(6043);const a={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var o=s(5893);function i(e){return!!e&&("SUMMARY"===e.tagName||i(e.parentElement))}function d(e,n){return!!e&&(e===n||d(e.parentElement,n))}function h(e){let{summary:n,children:s,...h}=e;const u=(0,l.Z)(),x=(0,t.useRef)(null),{collapsed:p,setCollapsed:j}=(0,c.u)({initialState:!h.open}),[m,y]=(0,t.useState)(h.open),g=t.isValidElement(n)?n:(0,o.jsx)("summary",{children:n??"Details"});return(0,o.jsxs)("details",{...h,ref:x,open:m,"data-collapsed":p,className:(0,r.Z)(a.details,u&&a.isBrowser,h.className),onMouseDown:e=>{i(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;i(n)&&d(n,x.current)&&(e.preventDefault(),p?(j(!1),y(!0)):j(!0))},children:[g,(0,o.jsx)(c.z,{lazy:!1,collapsed:p,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),y(!e)},children:(0,o.jsx)("div",{className:a.collapsibleContent,children:s})})]})}const u={details:"details_b_Ee"},x="alert alert--info";function p(e){let{...n}=e;return(0,o.jsx)(h,{...n,className:(0,r.Z)(x,u.details,n.className)})}},8609:(e,n,s)=>{s.d(n,{A:()=>c});var t=s(4673);const r=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var l=s(5893);const c=e=>{let{records:n,open:s}=e;return(0,l.jsx)(t.Z,{open:s,summary:(0,l.jsxs)("summary",{children:[(0,l.jsx)(r,{})," History"]}),className:"history",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Version"}),(0,l.jsx)("th",{children:"Changes"})]})}),(0,l.jsx)("tbody",{children:n.map(((e,n)=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,l.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>u});var t=s(3692),r=s(4297);const l=(0,r.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),c=(0,r.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),a=(0,r.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),o=(0,r.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),i=(0,r.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,r.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:n,message:s}=e;const r={0:{title:"Deprecated",icon:(0,h.jsx)(l,{})},1:{title:"Experimental",icon:(0,h.jsx)(c,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(a,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(o,{})},2:{title:"Stable",icon:(0,h.jsx)(i,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:r[n].title}),r[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(7294),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:o="",children:i,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...r,width:l,height:l,stroke:s,strokeWidth:a?24*Number(c)/Number(l):c,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,o].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(i)?i:[i]]);var u}));return s.displayName=`${e}`,s}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>c});var t=s(7294);const r={},l=t.createContext(r);function c(e){const n=t.useContext(l);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(r):e.components||r:c(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/2bc14e22.9549ee75.js b/pt-BR/assets/js/2bc14e22.9549ee75.js new file mode 100644 index 0000000000..d8262d12e7 --- /dev/null +++ b/pt-BR/assets/js/2bc14e22.9549ee75.js @@ -0,0 +1,2 @@ +/*! For license information please see 2bc14e22.9549ee75.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2839],{4760:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>x,frontMatter:()=>a,metadata:()=>i,toc:()=>h});var t=s(5893),r=s(1151),l=s(8609),c=s(3901);const a={},o="Using MySQL2 with TypeScript",i={id:"documentation/typescript-examples",title:"Using MySQL2 with TypeScript",description:"Installation",source:"@site/docs/documentation/typescript-examples.mdx",sourceDirName:"documentation",slug:"/documentation/typescript-examples",permalink:"/node-mysql2/pt-BR/docs/documentation/typescript-examples",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/typescript-examples.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Promise Wrappers",permalink:"/node-mysql2/pt-BR/docs/documentation/promise-wrapper"},next:{title:"API e Configura\xe7\xe3o",permalink:"/node-mysql2/pt-BR/docs/api-and-configurations"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"Usage",id:"usage",level:2},{value:"Connection",id:"connection",level:3},{value:"Pool Connection",id:"pool-connection",level:3},{value:"Query and Execute",id:"query-and-execute",level:3},{value:"A simple query",id:"a-simple-query",level:4},{value:"Type Specification",id:"type-specification",level:2},{value:"RowDataPacket[]",id:"rowdatapacket",level:3},{value:"RowDataPacket[][]",id:"rowdatapacket-1",level:3},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"ResultSetHeader[]",id:"resultsetheader-1",level:3},{value:"ProcedureCallPacket",id:"procedurecallpacket",level:3},{value:"OkPacket",id:"okpacket",level:3},{value:"Examples",id:"examples",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"using-mysql2-with-typescript",children:"Using MySQL2 with TypeScript"}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"@types/node"})," ensure the proper interaction between ",(0,t.jsx)(n.strong,{children:"TypeScript"})," and the ",(0,t.jsx)(n.strong,{children:"Node.js"})," modules used by ",(0,t.jsx)(n.strong,{children:"MySQL2"})," (",(0,t.jsx)(n.em,{children:"net"}),", ",(0,t.jsx)(n.em,{children:"events"}),", ",(0,t.jsx)(n.em,{children:"stream"}),", ",(0,t.jsx)(n.em,{children:"tls"}),", etc.)."]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires ",(0,t.jsx)(n.strong,{children:"TypeScript"})," ",(0,t.jsx)(n.code,{children:">=4.5.2"}),"."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["You can import ",(0,t.jsx)(n.strong,{children:"MySQL2"})," in two ways:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"true"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql from 'mysql2';\nimport mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"false"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import * as mysql from 'mysql2';\nimport * as mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsx)(n.h3,{id:"connection",children:"Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ConnectionOptions } from 'mysql2';\n\nconst access: ConnectionOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createConnection(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"pool-connection",children:"Pool Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { PoolOptions } from 'mysql2';\n\nconst access: PoolOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createPool(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"query-and-execute",children:"Query and Execute"}),"\n",(0,t.jsx)(n.h4,{id:"a-simple-query",children:"A simple query"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\nconn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"rows"})," output will be these possible types:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[][]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"In this example, you need to manually check the output types"}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"type-specification",children:"Type Specification"}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket",children:"RowDataPacket[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(n.p,{children:"An array with the returned rows, for example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n// SELECT\nconn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { Tables_in_test: 'test' } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"rowsAsArray"})," option as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n rowsAsArray: true,\n});\n\n// SELECT\nconn.query(\n 'SELECT 1 + 1 AS test, 2 + 2 AS test;',\n (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 2, 4 ] ]\n */\n }\n);\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 'test' ] ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket-1",children:"RowDataPacket[][]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," option as ",(0,t.jsx)(n.code,{children:"true"})," with multiple queries:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SELECT 1 + 1 AS test;\n SELECT 2 + 2 AS test;\n`;\n\nconn.query(sql, (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"changedRows"})," option is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"affectedRows"})," instead."]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc.:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\nconst sql = `\n SET @1 = 1;\n`;\n\nconn.query(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader-1",children:"ResultSetHeader[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ResultSetHeader[]"})]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For multiples ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc. when using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SET @1 = 1;\n SET @2 = 2;\n`;\n\nconn.query(sql, (_err, results) => {\n console.log(results);\n /**\n * @results: [\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 10,\n warningStatus: 0,\n changedRows: 0\n },\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"procedurecallpacket",children:"ProcedureCallPacket"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ProcedureCallPacket"})]})]}]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["By performing a ",(0,t.jsx)(n.strong,{children:"Call Procedure"})," using ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", etc., the return will be a ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})," (even if you perform multiples queries and set ",(0,t.jsx)(n.code,{children:"multipleStatements"})," to ",(0,t.jsx)(n.code,{children:"true"}),"):"]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n/** ResultSetHeader */\nconn.query('DROP PROCEDURE IF EXISTS myProcedure');\n\n/** ResultSetHeader */\nconn.query(`\n CREATE PROCEDURE myProcedure()\n BEGIN\n SET @1 = 1;\n SET @2 = 2;\n END\n `);\n\n/** ProcedureCallPacket */\nconst sql = 'CALL myProcedure()';\n\nconn.query>(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"CREATE PROCEDURE"})," and ",(0,t.jsx)(n.code,{children:"DROP PROCEDURE"}),", these returns will be the ",(0,t.jsx)(n.em,{children:"default"})," ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["By using ",(0,t.jsx)(n.code,{children:"SELECT"})," and ",(0,t.jsx)(n.code,{children:"SHOW"})," queries in a ",(0,t.jsx)(n.strong,{children:"Procedure Call"}),", it groups the results as:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"/** ProcedureCallPacket */\n[RowDataPacket[], ResultSetHeader]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"}),", please see the following examples."]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"okpacket",children:"OkPacket"}),"\n",(0,t.jsx)(c.X,{level:0,message:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,t.jsxs)(n.p,{children:["You can also check some code examples using ",(0,t.jsx)(n.strong,{children:"MySQL2"})," and ",(0,t.jsx)(n.strong,{children:"TypeScript"})," to understand advanced concepts:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/index",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array-multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"}),", ",(0,t.jsx)(n.code,{children:"rowAsArray"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/index",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/row-as-array",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/basic-custom-class",children:["Creating a basic custom ",(0,t.jsx)(n.strong,{children:"MySQL2"})," ",(0,t.jsx)(n.strong,{children:"Class"})]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4673:(e,n,s)=>{s.d(n,{Z:()=>p});var t=s(7294),r=s(512),l=s(2389),c=s(6043);const a={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var o=s(5893);function i(e){return!!e&&("SUMMARY"===e.tagName||i(e.parentElement))}function d(e,n){return!!e&&(e===n||d(e.parentElement,n))}function h(e){let{summary:n,children:s,...h}=e;const u=(0,l.Z)(),x=(0,t.useRef)(null),{collapsed:p,setCollapsed:j}=(0,c.u)({initialState:!h.open}),[m,y]=(0,t.useState)(h.open),g=t.isValidElement(n)?n:(0,o.jsx)("summary",{children:n??"Details"});return(0,o.jsxs)("details",{...h,ref:x,open:m,"data-collapsed":p,className:(0,r.Z)(a.details,u&&a.isBrowser,h.className),onMouseDown:e=>{i(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;i(n)&&d(n,x.current)&&(e.preventDefault(),p?(j(!1),y(!0)):j(!0))},children:[g,(0,o.jsx)(c.z,{lazy:!1,collapsed:p,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),y(!e)},children:(0,o.jsx)("div",{className:a.collapsibleContent,children:s})})]})}const u={details:"details_b_Ee"},x="alert alert--info";function p(e){let{...n}=e;return(0,o.jsx)(h,{...n,className:(0,r.Z)(x,u.details,n.className)})}},8609:(e,n,s)=>{s.d(n,{A:()=>c});var t=s(4673);const r=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var l=s(5893);const c=e=>{let{records:n,open:s}=e;return(0,l.jsx)(t.Z,{open:s,summary:(0,l.jsxs)("summary",{children:[(0,l.jsx)(r,{})," History"]}),className:"history",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Version"}),(0,l.jsx)("th",{children:"Changes"})]})}),(0,l.jsx)("tbody",{children:n.map(((e,n)=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,l.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>u});var t=s(3692),r=s(4297);const l=(0,r.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),c=(0,r.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),a=(0,r.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),o=(0,r.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),i=(0,r.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,r.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:n,message:s}=e;const r={0:{title:"Deprecated",icon:(0,h.jsx)(l,{})},1:{title:"Experimental",icon:(0,h.jsx)(c,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(a,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(o,{})},2:{title:"Stable",icon:(0,h.jsx)(i,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:r[n].title}),r[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(7294),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:o="",children:i,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...r,width:l,height:l,stroke:s,strokeWidth:a?24*Number(c)/Number(l):c,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,o].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(i)?i:[i]]);var u}));return s.displayName=`${e}`,s}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>c});var t=s(7294);const r={},l=t.createContext(r);function c(e){const n=t.useContext(l);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(r):e.components||r:c(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/2bc14e22.2670f877.js.LICENSE.txt b/pt-BR/assets/js/2bc14e22.9549ee75.js.LICENSE.txt similarity index 100% rename from pt-BR/assets/js/2bc14e22.2670f877.js.LICENSE.txt rename to pt-BR/assets/js/2bc14e22.9549ee75.js.LICENSE.txt diff --git a/pt-BR/assets/js/54768732.6f6e93f3.js b/pt-BR/assets/js/54768732.6f6e93f3.js deleted file mode 100644 index bc38f66f43..0000000000 --- a/pt-BR/assets/js/54768732.6f6e93f3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[576],{3990:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>u,metadata:()=>d,toc:()=>p});var t=n(5893),s=n(1151),l=n(4866),a=n(5162),o=n(6393),i=n(4379);const u={sidebar_position:2,tags:["query"]},c="UPDATE",d={id:"examples/queries/simple-queries/update",title:"UPDATE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/update.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/update",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/update.mdx",tags:[{label:"query",permalink:"/node-mysql2/pt-BR/docs/tags/query"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["query"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select"},next:{title:"DELETE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const r={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.h1,{id:"update",children:"UPDATE"}),"\n",(0,t.jsxs)(r.p,{children:["The examples below also work for the ",(0,t.jsx)(r.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,t.jsx)(r.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(r.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsxs)(r.strong,{children:["query(options: ",(0,t.jsx)(r.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(r.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(r.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,r,n)=>{n.d(r,{Z:()=>a});n(7294);var t=n(512);const s={tabItem:"tabItem_Ymn6"};var l=n(5893);function a(e){let{children:r,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:n,children:r})}},4866:(e,r,n)=>{n.d(r,{Z:()=>v});var t=n(7294),s=n(512),l=n(2466),a=n(6550),o=n(469),i=n(1980),u=n(7392),c=n(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:n}=e;return(0,t.useMemo)((()=>{const e=r??function(e){return d(e).map((e=>{let{props:{value:r,label:n,attributes:t,default:s}}=e;return{value:r,label:n,attributes:t,default:s}}))}(n);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,n])}function p(e){let{value:r,tabValues:n}=e;return n.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:n}=e;const s=(0,a.k6)(),l=function(e){let{queryString:r=!1,groupId:n}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:r,groupId:n});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const r=new URLSearchParams(s.location.search);r.set(l,e),s.replace({...s.location,search:r.toString()})}),[l,s])]}function x(e){const{defaultValue:r,queryString:n=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:r,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:r,tabValues:l}))),[u,d]=m({queryString:n,groupId:s}),[x,f]=function(e){let{groupId:r}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,l]=(0,c.Nk)(n);return[s,(0,t.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:s}),b=(()=>{const e=u??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(5893);function j(e){let{className:r,block:n,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.o5)(),c=e=>{const r=e.currentTarget,n=i.indexOf(r),s=o[n].value;s!==t&&(u(r),a(s))},d=e=>{let r=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;r=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;r=i[n]??i[i.length-1];break}}r?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},r),children:o.map((e=>{let{value:r,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===r?0:-1,"aria-selected":t===r,ref:e=>i.push(e),onKeyDown:d,onClick:c,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===r}),children:n??r},r)}))})}function q(e){let{lazy:r,children:n,selectedValue:s}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(r){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,r)=>(0,t.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function y(e){const r=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...r}),(0,g.jsx)(q,{...e,...r})]})}function v(e){const r=(0,f.Z)();return(0,g.jsx)(y,{...e,children:d(e.children)},String(r))}},4379:(e,r,n)=>{n.d(r,{I:()=>i});var t=n(7294),s=n(2263),l=n(9286),a=n(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:r,language:n,extractMethod:i,methodType:u}=e;const[c,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(r)?`${b}${r}`:r;return(0,t.useEffect)((()=>{const e=new AbortController,r=e.signal;return fetch(g,{signal:r}).then((e=>e.text())).then((e=>{const r=i&&u?((e,r,n)=>{const t=e.split("\n"),s=`${n} ${r}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,u):e;d(r||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,u]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${n}`,children:c})})})}},6393:(e,r,n)=>{n.d(r,{Z:()=>l});var t=n(4673),s=n(5893);const l=e=>{let{children:r,open:n,title:l}=e;return(0,s.jsx)(t.Z,{open:n,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:r})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/54768732.f1b51fce.js b/pt-BR/assets/js/54768732.f1b51fce.js new file mode 100644 index 0000000000..79a94459f5 --- /dev/null +++ b/pt-BR/assets/js/54768732.f1b51fce.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[576],{3990:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>u,metadata:()=>d,toc:()=>p});var t=r(5893),s=r(1151),l=r(4866),a=r(5162),o=r(6393),i=r(4379);const u={sidebar_position:2,tags:["query"]},c="UPDATE",d={id:"examples/queries/simple-queries/update",title:"UPDATE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/update.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/update",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/update.mdx",tags:[{label:"query",permalink:"/node-mysql2/pt-BR/docs/tags/query"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["query"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select"},next:{title:"DELETE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,t.jsxs)(n.p,{children:["The examples below also work for the ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,t.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["query(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>a});r(7294);var t=r(512);const s={tabItem:"tabItem_Ymn6"};var l=r(5893);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var t=r(7294),s=r(512),l=r(2466),a=r(6550),o=r(469),i=r(1980),u=r(7392),c=r(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,u.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[u,d]=m({queryString:r,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,c.Nk)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),b=(()=>{const e=u??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=r(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=r(5893);function j(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.o5)(),c=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(u(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:c,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function q(e){let{lazy:n,children:r,selectedValue:s}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...n}),(0,g.jsx)(q,{...e,...n})]})}function v(e){const n=(0,f.Z)();return(0,g.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var t=r(7294),s=r(2263),l=r(9286),a=r(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:u}=e;const[c,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(n)?`${b}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(g,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&u?((e,n,r)=>{const t=e.split("\n"),s=`${r} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,u):e;d(n||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,u]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${r}`,children:c})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var t=r(4673),s=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,s.jsx)(t.Z,{open:r,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/54eaaaae.54e2107b.js b/pt-BR/assets/js/54eaaaae.54e2107b.js deleted file mode 100644 index 9c3917f9d0..0000000000 --- a/pt-BR/assets/js/54eaaaae.54e2107b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1420],{1:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>h,toc:()=>p});var s=o(5893),r=o(1151),t=o(4866),l=o(5162),c=o(6393),i=o(4379);const a={sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},d="createPool",h={id:"examples/connections/create-pool",title:"createPool",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-pool.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-pool",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-pool",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-pool.mdx",tags:[{label:"createPool",permalink:"/node-mysql2/pt-BR/docs/tags/create-pool"},{label:"URI",permalink:"/node-mysql2/pt-BR/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/pt-BR/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/pt-BR/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/pt-BR/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/pt-BR/docs/tags/socks"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createConnection",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-connection"},next:{title:"createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster"}},u={},p=[{value:"createPool(connectionUri)",id:"createpoolconnectionuri",level:2},{value:"createPool(config)",id:"createpoolconfig",level:2},{value:"createPool(config) \u2014 SHA1",id:"createpoolconfig--sha1",level:2},{value:"createPool(config) \u2014 SSL",id:"createpoolconfig--ssl",level:2},{value:"createPool(config) \u2014 RDS SSL",id:"createpoolconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createPool(config) \u2014 Socks",id:"createpoolconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"createpool",children:"createPool"}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["For queries please see the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,s.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,s.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconnectionuri",children:"createPool(connectionUri)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"createPool(connectionUri: string)"})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig",children:"createPool(config)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--sha1",children:"createPool(config) \u2014 SHA1"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--ssl",children:"createPool(config) \u2014 SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,s.jsxs)(l.Z,{value:"certs/ca-cert.pem",children:[(0,s.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["See ",(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--rds-ssl",children:"createPool(config) \u2014 RDS SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can use ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,s.jsxs)(n.p,{children:["In that case ",(0,s.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsxs)(l.Z,{value:"promise.js",default:!0,children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await pool.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,s.jsxs)(l.Z,{value:"callback.js",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n pool.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Issues"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--socks",children:"createPool(config) \u2014 Socks"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"A.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst pool = mysql.createPool({\n stream: socksProxy,\n});\n// highlight-end\n"})})}),(0,s.jsx)(l.Z,{value:"B.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst pool = mysql.createPool({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,s.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),"\n",(0,s.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})}),"\n"]}),"\n",(0,s.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},5162:(e,n,o)=>{o.d(n,{Z:()=>l});o(7294);var s=o(512);const r={tabItem:"tabItem_Ymn6"};var t=o(5893);function l(e){let{children:n,hidden:o,className:l}=e;return(0,t.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,l),hidden:o,children:n})}},4866:(e,n,o)=>{o.d(n,{Z:()=>S});var s=o(7294),r=o(512),t=o(2466),l=o(6550),c=o(469),i=o(1980),a=o(7392),d=o(12);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:o,attributes:s,default:r}}=e;return{value:n,label:o,attributes:s,default:r}}))}(o);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function p(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:o}=e;const r=(0,l.k6)(),t=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,i._X)(t),(0,s.useCallback)((e=>{if(!t)return;const n=new URLSearchParams(r.location.search);n.set(t,e),r.replace({...r.location,search:n.toString()})}),[t,r])]}function g(e){const{defaultValue:n,queryString:o=!1,groupId:r}=e,t=u(e),[l,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=o.find((e=>e.default))??o[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:t}))),[a,h]=m({queryString:o,groupId:r}),[g,x]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,t]=(0,d.Nk)(o);return[r,(0,s.useCallback)((e=>{o&&t.set(e)}),[o,t])]}({groupId:r}),j=(()=>{const e=a??g;return p({value:e,tabValues:t})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:l,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:t}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)}),[h,x,t]),tabValues:t}}var x=o(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=o(5893);function y(e){let{className:n,block:o,selectedValue:s,selectValue:l,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,t.o5)(),d=e=>{const n=e.currentTarget,o=i.indexOf(n),r=c[o].value;r!==s&&(a(n),l(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":o},n),children:c.map((e=>{let{value:n,label:o,attributes:t}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:h,onClick:d,...t,className:(0,r.Z)("tabs__item",j.tabItem,t?.className,{"tabs__item--active":s===n}),children:o??n},n)}))})}function b(e){let{lazy:n,children:o,selectedValue:r}=e;const t=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=t.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:t.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:h(e.children)},String(n))}},4379:(e,n,o)=>{o.d(n,{I:()=>i});var s=o(7294),r=o(2263),t=o(9286),l=o(5893);const c=()=>(0,l.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:o,extractMethod:i,methodType:a}=e;const[d,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(!0),[m,g]=(0,s.useState)(!0),{siteConfig:x}=(0,r.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,o)=>{const s=e.split("\n"),r=`${o} ${n}`;let t=!1,l=0,c="";for(const i of s)if(i.includes(r)&&(t=!0),t&&(i.includes("{")&&l++,c+=i+"\n",i.includes("}")&&(l--,0===l)))break;return c.trim()||e})(e,i,a):e;h(n||e),p(!1),g(!1)})).catch((()=>{g(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,l.jsx)(l.Fragment,{children:u?(0,l.jsx)(c,{}):(0,l.jsx)(l.Fragment,{children:m?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,l.jsx)(t.Z,{className:`language-${o}`,children:d})})})}},6393:(e,n,o)=>{o.d(n,{Z:()=>t});var s=o(4673),r=o(5893);const t=e=>{let{children:n,open:o,title:t}=e;return(0,r.jsx)(s.Z,{open:o,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:t})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/54eaaaae.9f01ee33.js b/pt-BR/assets/js/54eaaaae.9f01ee33.js new file mode 100644 index 0000000000..0ee2f157d5 --- /dev/null +++ b/pt-BR/assets/js/54eaaaae.9f01ee33.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1420],{1:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>h,toc:()=>p});var s=o(5893),r=o(1151),t=o(4866),l=o(5162),c=o(6393),i=o(4379);const a={sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},d="createPool",h={id:"examples/connections/create-pool",title:"createPool",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-pool.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-pool",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-pool",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-pool.mdx",tags:[{label:"createPool",permalink:"/node-mysql2/pt-BR/docs/tags/create-pool"},{label:"URI",permalink:"/node-mysql2/pt-BR/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/pt-BR/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/pt-BR/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/pt-BR/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/pt-BR/docs/tags/socks"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createConnection",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-connection"},next:{title:"createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster"}},u={},p=[{value:"createPool(connectionUri)",id:"createpoolconnectionuri",level:2},{value:"createPool(config)",id:"createpoolconfig",level:2},{value:"createPool(config) \u2014 SHA1",id:"createpoolconfig--sha1",level:2},{value:"createPool(config) \u2014 SSL",id:"createpoolconfig--ssl",level:2},{value:"createPool(config) \u2014 RDS SSL",id:"createpoolconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createPool(config) \u2014 Socks",id:"createpoolconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"createpool",children:"createPool"}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["For queries please see the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,s.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,s.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconnectionuri",children:"createPool(connectionUri)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"createPool(connectionUri: string)"})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig",children:"createPool(config)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--sha1",children:"createPool(config) \u2014 SHA1"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--ssl",children:"createPool(config) \u2014 SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(l.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,s.jsxs)(l.Z,{value:"certs/ca-cert.pem",children:[(0,s.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["See ",(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--rds-ssl",children:"createPool(config) \u2014 RDS SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can use ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,s.jsxs)(n.p,{children:["In that case ",(0,s.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsxs)(l.Z,{value:"promise.js",default:!0,children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await pool.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,s.jsxs)(l.Z,{value:"callback.js",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n pool.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Issues"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--socks",children:"createPool(config) \u2014 Socks"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(t.Z,{children:[(0,s.jsx)(l.Z,{value:"A.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst pool = mysql.createPool({\n stream: socksProxy,\n});\n// highlight-end\n"})})}),(0,s.jsx)(l.Z,{value:"B.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst pool = mysql.createPool({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,s.jsxs)("blockquote",{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,s.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),(0,s.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]}),"\n",(0,s.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},5162:(e,n,o)=>{o.d(n,{Z:()=>l});o(7294);var s=o(512);const r={tabItem:"tabItem_Ymn6"};var t=o(5893);function l(e){let{children:n,hidden:o,className:l}=e;return(0,t.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,l),hidden:o,children:n})}},4866:(e,n,o)=>{o.d(n,{Z:()=>S});var s=o(7294),r=o(512),t=o(2466),l=o(6550),c=o(469),i=o(1980),a=o(7392),d=o(12);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:o,attributes:s,default:r}}=e;return{value:n,label:o,attributes:s,default:r}}))}(o);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function p(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:o}=e;const r=(0,l.k6)(),t=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,i._X)(t),(0,s.useCallback)((e=>{if(!t)return;const n=new URLSearchParams(r.location.search);n.set(t,e),r.replace({...r.location,search:n.toString()})}),[t,r])]}function g(e){const{defaultValue:n,queryString:o=!1,groupId:r}=e,t=u(e),[l,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=o.find((e=>e.default))??o[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:t}))),[a,h]=m({queryString:o,groupId:r}),[g,x]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,t]=(0,d.Nk)(o);return[r,(0,s.useCallback)((e=>{o&&t.set(e)}),[o,t])]}({groupId:r}),j=(()=>{const e=a??g;return p({value:e,tabValues:t})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:l,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:t}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)}),[h,x,t]),tabValues:t}}var x=o(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=o(5893);function y(e){let{className:n,block:o,selectedValue:s,selectValue:l,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,t.o5)(),d=e=>{const n=e.currentTarget,o=i.indexOf(n),r=c[o].value;r!==s&&(a(n),l(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":o},n),children:c.map((e=>{let{value:n,label:o,attributes:t}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:h,onClick:d,...t,className:(0,r.Z)("tabs__item",j.tabItem,t?.className,{"tabs__item--active":s===n}),children:o??n},n)}))})}function b(e){let{lazy:n,children:o,selectedValue:r}=e;const t=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=t.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:t.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:h(e.children)},String(n))}},4379:(e,n,o)=>{o.d(n,{I:()=>i});var s=o(7294),r=o(2263),t=o(9286),l=o(5893);const c=()=>(0,l.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:o,extractMethod:i,methodType:a}=e;const[d,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(!0),[m,g]=(0,s.useState)(!0),{siteConfig:x}=(0,r.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,o)=>{const s=e.split("\n"),r=`${o} ${n}`;let t=!1,l=0,c="";for(const i of s)if(i.includes(r)&&(t=!0),t&&(i.includes("{")&&l++,c+=i+"\n",i.includes("}")&&(l--,0===l)))break;return c.trim()||e})(e,i,a):e;h(n||e),p(!1),g(!1)})).catch((()=>{g(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,l.jsx)(l.Fragment,{children:u?(0,l.jsx)(c,{}):(0,l.jsx)(l.Fragment,{children:m?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,l.jsx)(t.Z,{className:`language-${o}`,children:d})})})}},6393:(e,n,o)=>{o.d(n,{Z:()=>t});var s=o(4673),r=o(5893);const t=e=>{let{children:n,open:o,title:t}=e;return(0,r.jsx)(s.Z,{open:o,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:t})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/57495183.2395c860.js b/pt-BR/assets/js/57495183.2395c860.js new file mode 100644 index 0000000000..8e4442e30f --- /dev/null +++ b/pt-BR/assets/js/57495183.2395c860.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5003],{4304:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>t,metadata:()=>c,toc:()=>o});var r=s(5893),i=s(1151);const t={},l="MySQL Server API",c={id:"documentation/mysql-server",title:"MySQL Server API",description:"Server",source:"@site/docs/documentation/mysql-server.mdx",sourceDirName:"documentation",slug:"/documentation/mysql-server",permalink:"/node-mysql2/pt-BR/docs/documentation/mysql-server",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/mysql-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Extra Features",permalink:"/node-mysql2/pt-BR/docs/documentation/extras"},next:{title:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/documentation/prepared-statements"}},d={},o=[{value:"Server",id:"server",level:2},{value:"Events",id:"events",level:3},{value:"Connection",id:"connection",level:2},{value:"Events",id:"events-1",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"mysql-server-api",children:"MySQL Server API"}),"\n",(0,r.jsx)(n.h2,{id:"server",children:"Server"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"createServer()"})," - creates server instance"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Server.listen"})," - listen port / unix socket (same arguments as ",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback",children:"net.Server.listen"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events",children:"Events"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"connect"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"new incoming connection."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"connection",children:"Connection"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send server handshake initialisation packet, wait handshake response and start listening for commands"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeOk({ affectedRows: num, insertId: num })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["send ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/overview.html#packet-OK_Packet",children:"OK packet"})," to client"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeEof(warnings, statusFlags)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send EOF packet"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextResult(rows, fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["write query result to client. Rows and fields are in the same format as in ",(0,r.jsx)(n.code,{children:"connection.query"})," callback."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeColumns(fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write fields + EOF packets."}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextRow(row)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write array (not hash!) of values as result row"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"TODO:"})," binary protocol"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events-1",children:"Events"}),"\n",(0,r.jsxs)(n.p,{children:["Every command packet received by the server will be emitted as a ",(0,r.jsx)(n.strong,{children:"packet"})," event with the parameters:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"packet:"})," Packet","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The packet itself"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"knownCommand:"})," boolean","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"is this command known to the server"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"*commandCode:"})," number","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"the parsed command code (first byte)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["In addition special events are emitted for ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/text-protocol.html",children:"commands"})," received from the client. If no listener is present a fallback behavior will be invoked."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"quit()"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: close the connection"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"init_db(schemaName: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return OK"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"query(sql: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"field_list(table: string, fields: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return ER_WARN_DEPRECATED_SYNTAX"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"ping()"})," - Default: return OK"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>l});var r=s(7294);const i={},t=r.createContext(i);function l(e){const n=r.useContext(t);return r.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(i):e.components||i:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/57495183.fdaa1077.js b/pt-BR/assets/js/57495183.fdaa1077.js deleted file mode 100644 index dfe8d65c64..0000000000 --- a/pt-BR/assets/js/57495183.fdaa1077.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5003],{4304:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>t,metadata:()=>c,toc:()=>o});var r=s(5893),i=s(1151);const t={},l="MySQL Server API",c={id:"documentation/mysql-server",title:"MySQL Server API",description:"Server",source:"@site/docs/documentation/mysql-server.mdx",sourceDirName:"documentation",slug:"/documentation/mysql-server",permalink:"/node-mysql2/pt-BR/docs/documentation/mysql-server",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/mysql-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Extra Features",permalink:"/node-mysql2/pt-BR/docs/documentation/extras"},next:{title:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/documentation/prepared-statements"}},d={},o=[{value:"Server",id:"server",level:2},{value:"Events",id:"events",level:3},{value:"Connection",id:"connection",level:2},{value:"Events",id:"events-1",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"mysql-server-api",children:"MySQL Server API"}),"\n",(0,r.jsx)(n.h2,{id:"server",children:"Server"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"createServer()"})," - creates server instance"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Server.listen"})," - listen port / unix socket (same arguments as ",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback",children:"net.Server.listen"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events",children:"Events"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"connect"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"new incoming connection."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"connection",children:"Connection"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send server handshake initialisation packet, wait handshake response and start listening for commands"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeOk({ affectedRows: num, insertId: num })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["send ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/overview.html#packet-OK_Packet",children:"OK packet"})," to client"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeEof(warnings, statusFlags)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send EOF packet"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextResult(rows, fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["write query result to client. Rows and fields are in the same format as in ",(0,r.jsx)(n.code,{children:"connection.query"})," callback."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeColumns(fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write fields + EOF packets."}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextRow(row)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write array (not hash!) of values as result row"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"TODO:"})," binary protocol"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events-1",children:"Events"}),"\n",(0,r.jsxs)(n.p,{children:["Every command packet received by the server will be emitted as a ",(0,r.jsx)(n.strong,{children:"packet"})," event with the parameters:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"packet:"})," Packet","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The packet itself"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"knownCommand:"})," boolean","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"is this command known to the server"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"*commandCode:"})," number","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"the parsed command code (first byte)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["In addition special events are emitted for ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/text-protocol.html",children:"commands"})," received from the client. If no listener is present a fallback behavior will be invoked."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"quit()"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: close the connection"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"init_db(schemaName: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return OK"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"query(sql: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"field_list(table: string, fields: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return ER_WARN_DEPRECATED_SYNTAX"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"ping()"})," - Default: return OK"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>l});var r=s(7294);const i={},t=r.createContext(i);function l(e){const n=r.useContext(t);return r.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(i):e.components||i:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/59e52bc2.9882cb29.js b/pt-BR/assets/js/59e52bc2.9882cb29.js deleted file mode 100644 index 55bdba8d0e..0000000000 --- a/pt-BR/assets/js/59e52bc2.9882cb29.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[641],{8602:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>h,contentTitle:()=>u,default:()=>x,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var n=t(5893),s=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:3,tags:["query"]},u="DELETE",d={id:"examples/queries/simple-queries/delete",title:"DELETE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/delete.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/delete",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/delete.mdx",tags:[{label:"query",permalink:"/node-mysql2/pt-BR/docs/tags/query"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["query"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update"},next:{title:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const r={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h1,{id:"delete",children:"DELETE"}),"\n",(0,n.jsxs)(r.p,{children:["The examples below also work for the ",(0,n.jsx)(r.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,n.jsx)(r.code,{children:"execute"})})," method."]}),"\n",(0,n.jsx)(r.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,n.jsxs)(r.blockquote,{children:["\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,n.jsxs)(l.Z,{children:[(0,n.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,n.jsx)(a.Z,{value:"callback.js",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.strong,{children:"result"}),": contains a ",(0,n.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,n.jsx)(r.admonition,{type:"info",children:(0,n.jsxs)(r.p,{children:["The connection used for the query (",(0,n.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,n.jsx)(r.code,{children:"createConnection"}),", ",(0,n.jsx)(r.code,{children:"createPool"})," or ",(0,n.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,n.jsxs)(r.blockquote,{children:["\n",(0,n.jsx)(r.p,{children:(0,n.jsxs)(r.strong,{children:["query(options: ",(0,n.jsx)(r.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,n.jsxs)(l.Z,{children:[(0,n.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,n.jsx)(a.Z,{value:"callback.js",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.strong,{children:"result"}),": contains a ",(0,n.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,n.jsx)(r.admonition,{type:"info",children:(0,n.jsxs)(r.p,{children:["The connection used for the query (",(0,n.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,n.jsx)(r.code,{children:"createConnection"}),", ",(0,n.jsx)(r.code,{children:"createPool"})," or ",(0,n.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h2,{id:"glossary",children:"Glossary"}),"\n",(0,n.jsx)(r.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,n.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,n.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,n.jsx)(r.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,n.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,n.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}},5162:(e,r,t)=>{t.d(r,{Z:()=>a});t(7294);var n=t(512);const s={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:r,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,n.Z)(s.tabItem,a),hidden:t,children:r})}},4866:(e,r,t)=>{t.d(r,{Z:()=>v});var n=t(7294),s=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:t}=e;return(0,n.useMemo)((()=>{const e=r??function(e){return d(e).map((e=>{let{props:{value:r,label:t,attributes:n,default:s}}=e;return{value:r,label:t,attributes:n,default:s}}))}(t);return function(e){const r=(0,c.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,t])}function p(e){let{value:r,tabValues:t}=e;return t.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:t}=e;const s=(0,a.k6)(),l=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,i._X)(l),(0,n.useCallback)((e=>{if(!l)return;const r=new URLSearchParams(s.location.search);r.set(l,e),s.replace({...s.location,search:r.toString()})}),[l,s])]}function x(e){const{defaultValue:r,queryString:t=!1,groupId:s}=e,l=h(e),[a,i]=(0,n.useState)((()=>function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:r,tabValues:l}))),[c,d]=m({queryString:t,groupId:s}),[x,f]=function(e){let{groupId:r}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,l]=(0,u.Nk)(t);return[s,(0,n.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:s}),b=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,n.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=t(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=t(5893);function j(e){let{className:r,block:t,selectedValue:n,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const r=e.currentTarget,t=i.indexOf(r),s=o[t].value;s!==n&&(c(r),a(s))},d=e=>{let r=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;r=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;r=i[t]??i[i.length-1];break}}r?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":t},r),children:o.map((e=>{let{value:r,label:t,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:n===r?0:-1,"aria-selected":n===r,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":n===r}),children:t??r},r)}))})}function y(e){let{lazy:r,children:t,selectedValue:s}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){const e=l.find((e=>e.props.value===s));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,r)=>(0,n.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function q(e){const r=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...r}),(0,g.jsx)(y,{...e,...r})]})}function v(e){const r=(0,f.Z)();return(0,g.jsx)(q,{...e,children:d(e.children)},String(r))}},4379:(e,r,t)=>{t.d(r,{I:()=>i});var n=t(7294),s=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:r,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,n.useState)(""),[h,p]=(0,n.useState)(!0),[m,x]=(0,n.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(r)?`${b}${r}`:r;return(0,n.useEffect)((()=>{const e=new AbortController,r=e.signal;return fetch(g,{signal:r}).then((e=>e.text())).then((e=>{const r=i&&c?((e,r,t)=>{const n=e.split("\n"),s=`${t} ${r}`;let l=!1,a=0,o="";for(const i of n)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(r||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,r,t)=>{t.d(r,{Z:()=>l});var n=t(4673),s=t(5893);const l=e=>{let{children:r,open:t,title:l}=e;return(0,s.jsx)(n.Z,{open:t,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:r})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/59e52bc2.ab184645.js b/pt-BR/assets/js/59e52bc2.ab184645.js new file mode 100644 index 0000000000..8497ade106 --- /dev/null +++ b/pt-BR/assets/js/59e52bc2.ab184645.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[641],{8602:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>u,default:()=>x,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var r=n(5893),s=n(1151),l=n(4866),a=n(5162),o=n(6393),i=n(4379);const c={sidebar_position:3,tags:["query"]},u="DELETE",d={id:"examples/queries/simple-queries/delete",title:"DELETE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/delete.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/delete",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/delete.mdx",tags:[{label:"query",permalink:"/node-mysql2/pt-BR/docs/tags/query"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["query"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update"},next:{title:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const t={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"delete",children:"DELETE"}),"\n",(0,r.jsxs)(t.p,{children:["The examples below also work for the ",(0,r.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,r.jsx)(t.code,{children:"execute"})})," method."]}),"\n",(0,r.jsx)(t.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,r.jsxs)(t.blockquote,{children:["\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"result"}),": contains a ",(0,r.jsx)(t.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{type:"info",children:(0,r.jsxs)(t.p,{children:["The connection used for the query (",(0,r.jsx)(t.code,{children:".query()"}),") can be obtained through the ",(0,r.jsx)(t.code,{children:"createConnection"}),", ",(0,r.jsx)(t.code,{children:"createPool"})," or ",(0,r.jsx)(t.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(t.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,r.jsxs)(t.blockquote,{children:["\n",(0,r.jsx)(t.p,{children:(0,r.jsxs)(t.strong,{children:["query(options: ",(0,r.jsx)(t.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"result"}),": contains a ",(0,r.jsx)(t.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{type:"info",children:(0,r.jsxs)(t.p,{children:["The connection used for the query (",(0,r.jsx)(t.code,{children:".query()"}),") can be obtained through the ",(0,r.jsx)(t.code,{children:"createConnection"}),", ",(0,r.jsx)(t.code,{children:"createPool"})," or ",(0,r.jsx)(t.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(t.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(t.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,r.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,r.jsx)(t.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,r.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},5162:(e,t,n)=>{n.d(t,{Z:()=>a});n(7294);var r=n(512);const s={tabItem:"tabItem_Ymn6"};var l=n(5893);function a(e){let{children:t,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(s.tabItem,a),hidden:n,children:t})}},4866:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(7294),s=n(512),l=n(2466),a=n(6550),o=n(469),i=n(1980),c=n(7392),u=n(12);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:s}}=e;return{value:t,label:n,attributes:r,default:s}}))}(n);return function(e){const t=(0,c.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const s=(0,a.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(s.location.search);t.set(l,e),s.replace({...s.location,search:t.toString()})}),[l,s])]}function x(e){const{defaultValue:t,queryString:n=!1,groupId:s}=e,l=h(e),[a,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[c,d]=m({queryString:n,groupId:s}),[x,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[s,l]=(0,u.Nk)(n);return[s,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:s}),b=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(5893);function j(e){let{className:t,block:n,selectedValue:r,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const t=e.currentTarget,n=i.indexOf(t),s=o[n].value;s!==r&&(c(t),a(s))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:s}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===s));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==s})))})}function q(e){const t=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...t}),(0,g.jsx)(y,{...e,...t})]})}function v(e){const t=(0,f.Z)();return(0,g.jsx)(q,{...e,children:d(e.children)},String(t))}},4379:(e,t,n)=>{n.d(t,{I:()=>i});var r=n(7294),s=n(2263),l=n(9286),a=n(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:t,language:n,extractMethod:i,methodType:c}=e;const[u,d]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[m,x]=(0,r.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(t)?`${b}${t}`:t;return(0,r.useEffect)((()=>{const e=new AbortController,t=e.signal;return fetch(g,{signal:t}).then((e=>e.text())).then((e=>{const t=i&&c?((e,t,n)=>{const r=e.split("\n"),s=`${n} ${t}`;let l=!1,a=0,o="";for(const i of r)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(t||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${n}`,children:u})})})}},6393:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4673),s=n(5893);const l=e=>{let{children:t,open:n,title:l}=e;return(0,s.jsx)(r.Z,{open:n,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:t})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/7ccab252.3b4472b4.js b/pt-BR/assets/js/7ccab252.3b4472b4.js deleted file mode 100644 index b5a992f28a..0000000000 --- a/pt-BR/assets/js/7ccab252.3b4472b4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8054],{3467:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>a,metadata:()=>d,toc:()=>p});var n=s(5893),r=s(1151);const a={},i="Prepared Statements",d={id:"examples/queries/prepared-statements/index",title:"Prepared Statements",description:"MySQL2 provides execute helper which will prepare and query the statement.",source:"@site/docs/examples/queries/prepared-statements/index.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"DELETE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete"},next:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert"}},c={},p=[];function l(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",hr:"hr",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"prepared-statements",children:"Prepared Statements"}),"\n",(0,n.jsxs)(t.p,{children:["MySQL2 provides ",(0,n.jsx)(t.code,{children:"execute"})," helper which will prepare and query the statement.\nYou can also manually prepare / unprepare statement with ",(0,n.jsx)(t.code,{children:"prepare"})," / ",(0,n.jsx)(t.code,{children:"unprepare"})," methods."]}),"\n",(0,n.jsxs)(t.p,{children:["See detailed documentaion in ",(0,n.jsx)(t.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"}),"."]}),"\n",(0,n.jsx)(t.admonition,{type:"tip",children:(0,n.jsxs)(t.p,{children:["If you execute same statement again, it will be picked form a ",(0,n.jsx)(t.strong,{children:"LRU cache"})," which will save query preparation time and give better performance."]})}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.p,{children:"Usage examples:"}),"\n",(0,n.jsxs)(t.ul,{className:"contains-task-list",children:["\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/insert",children:(0,n.jsx)(t.strong,{children:"INSERT"})})]}),"\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,n.jsx)(t.strong,{children:"SELECT"})})]}),"\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,n.jsx)(t.strong,{children:"UPDATE"})})]}),"\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,n.jsx)(t.strong,{children:"DELETE"})})]}),"\n"]})]})}function o(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>d,a:()=>i});var n=s(7294);const r={},a=n.createContext(r);function i(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/7ccab252.51cf493e.js b/pt-BR/assets/js/7ccab252.51cf493e.js new file mode 100644 index 0000000000..635d943624 --- /dev/null +++ b/pt-BR/assets/js/7ccab252.51cf493e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8054],{3467:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>a,metadata:()=>d,toc:()=>p});var n=s(5893),r=s(1151);const a={},i="Prepared Statements",d={id:"examples/queries/prepared-statements/index",title:"Prepared Statements",description:"MySQL2 provides execute helper which will prepare and query the statement.",source:"@site/docs/examples/queries/prepared-statements/index.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"DELETE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete"},next:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert"}},c={},p=[];function l(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"prepared-statements",children:"Prepared Statements"}),"\n",(0,n.jsxs)(t.p,{children:["MySQL2 provides ",(0,n.jsx)(t.code,{children:"execute"})," helper which will prepare and query the statement.\nYou can also manually prepare / unprepare statement with ",(0,n.jsx)(t.code,{children:"prepare"})," / ",(0,n.jsx)(t.code,{children:"unprepare"})," methods."]}),"\n",(0,n.jsxs)(t.p,{children:["See detailed documentaion in ",(0,n.jsx)(t.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"}),"."]}),"\n",(0,n.jsx)(t.admonition,{type:"tip",children:(0,n.jsxs)(t.p,{children:["If you execute same statement again, it will be picked form a ",(0,n.jsx)(t.strong,{children:"LRU cache"})," which will save query preparation time and give better performance."]})}),"\n",(0,n.jsx)("hr",{}),"\n",(0,n.jsx)(t.p,{children:"Usage examples:"}),"\n",(0,n.jsxs)(t.ul,{className:"contains-task-list",children:["\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/insert",children:(0,n.jsx)(t.strong,{children:"INSERT"})})]}),"\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,n.jsx)(t.strong,{children:"SELECT"})})]}),"\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,n.jsx)(t.strong,{children:"UPDATE"})})]}),"\n",(0,n.jsxs)(t.li,{className:"task-list-item",children:[(0,n.jsx)(t.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(t.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,n.jsx)(t.strong,{children:"DELETE"})})]}),"\n"]})]})}function o(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>d,a:()=>i});var n=s(7294);const r={},a=n.createContext(r);function i(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/7fbd6b3a.a3ec85f9.js b/pt-BR/assets/js/7fbd6b3a.a3ec85f9.js new file mode 100644 index 0000000000..f2cee34c1d --- /dev/null +++ b/pt-BR/assets/js/7fbd6b3a.a3ec85f9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9964],{8937:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>i,metadata:()=>d,toc:()=>p});var t=s(5893),r=s(1151),l=s(4866),a=s(5162),o=s(6393),c=s(4379);const i={sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="SELECT",d={id:"examples/queries/prepared-statements/select",title:"SELECT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/select.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/select",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/select.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,t.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-next-line\n const [rows, fields] = await connection.execute(sql, values);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(sql, values, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(c.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const r={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),r=s(512),l=s(2466),a=s(6550),o=s(469),c=s(1980),i=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}))}(s);return function(e){const n=(0,i.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:r}=e,l=h(e),[a,c]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[i,d]=x({queryString:s,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(s);return[r,(0,t.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:r}),j=(()=>{const e=i??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&c(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),r=o[s].value;r!==t&&(i(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>c.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:r}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),r=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:i}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[x,m]=(0,t.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&i?((e,n,s)=>{const t=e.split("\n"),r=`${s} ${n}`;let l=!1,a=0,o="";for(const c of t)if(c.includes(r)&&(l=!0),l&&(c.includes("{")&&a++,o+=c+"\n",c.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,c,i):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,c,i]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(4673),r=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,r.jsx)(t.Z,{open:s,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/7fbd6b3a.d6db5b07.js b/pt-BR/assets/js/7fbd6b3a.d6db5b07.js deleted file mode 100644 index 8cfde4dc78..0000000000 --- a/pt-BR/assets/js/7fbd6b3a.d6db5b07.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9964],{8937:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>i,metadata:()=>d,toc:()=>p});var t=s(5893),r=s(1151),l=s(4866),a=s(5162),o=s(6393),c=s(4379);const i={sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="SELECT",d={id:"examples/queries/prepared-statements/select",title:"SELECT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/select.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/select",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/select.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,t.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-next-line\n const [rows, fields] = await connection.execute(sql, values);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(sql, values, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(c.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const r={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),r=s(512),l=s(2466),a=s(6550),o=s(469),c=s(1980),i=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}))}(s);return function(e){const n=(0,i.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:r}=e,l=h(e),[a,c]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[i,d]=x({queryString:s,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(s);return[r,(0,t.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:r}),j=(()=>{const e=i??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&c(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),r=o[s].value;r!==t&&(i(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>c.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:r}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),r=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:i}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[x,m]=(0,t.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&i?((e,n,s)=>{const t=e.split("\n"),r=`${s} ${n}`;let l=!1,a=0,o="";for(const c of t)if(c.includes(r)&&(l=!0),l&&(c.includes("{")&&a++,o+=c+"\n",c.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,c,i):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,c,i]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(4673),r=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,r.jsx)(t.Z,{open:s,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/8b8ccc10.d4efc98d.js b/pt-BR/assets/js/8b8ccc10.d4efc98d.js new file mode 100644 index 0000000000..91ae215c4f --- /dev/null +++ b/pt-BR/assets/js/8b8ccc10.d4efc98d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8534],{3961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="DELETE",d={id:"examples/queries/prepared-statements/delete",title:"DELETE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/delete.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/delete",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/delete.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update"},next:{title:"Binlog Watcher",permalink:"/node-mysql2/pt-BR/docs/examples/binlog-watcher"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/8b8ccc10.ee5a2e4c.js b/pt-BR/assets/js/8b8ccc10.ee5a2e4c.js deleted file mode 100644 index 5fb2fc1e46..0000000000 --- a/pt-BR/assets/js/8b8ccc10.ee5a2e4c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8534],{3961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="DELETE",d={id:"examples/queries/prepared-statements/delete",title:"DELETE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/delete.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/delete",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/delete.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update"},next:{title:"Binlog Watcher",permalink:"/node-mysql2/pt-BR/docs/examples/binlog-watcher"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/8fcb4d7f.3e7d3dde.js b/pt-BR/assets/js/8fcb4d7f.3e7d3dde.js new file mode 100644 index 0000000000..dd89986173 --- /dev/null +++ b/pt-BR/assets/js/8fcb4d7f.3e7d3dde.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[81],{3050:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=r(5893),t=r(1151),l=r(4866),o=r(5162),a=r(6393),i=r(4379);const c={sidebar_position:1,tags:["query"]},u="SELECT",d={id:"examples/queries/simple-queries/select",title:"SELECT",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/select.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/select",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/select.mdx",tags:[{label:"query",permalink:"/node-mysql2/pt-BR/docs/tags/query"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["query"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"query(options) \u2014 Row as Array",id:"queryoptions--row-as-array",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions-1",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,s.jsxs)(n.p,{children:["The examples below also work for the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,s.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,s.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-next-line\n const [rows, fields] = await connection.query(sql);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(sql, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions--row-as-array",children:"query(options) \u2014 Row as Array"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n rowsAsArray: true,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n rowsAsArray: true,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server as array"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,s.jsx)(a.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>o});r(7294);var s=r(512);const t={tabItem:"tabItem_Ymn6"};var l=r(5893);function o(e){let{children:n,hidden:r,className:o}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(t.tabItem,o),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var s=r(7294),t=r(512),l=r(2466),o=r(6550),a=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:s,default:t}}=e;return{value:n,label:r,attributes:s,default:t}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:r}=e;const t=(0,o.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:r=!1,groupId:t}=e,l=h(e),[o,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=r.find((e=>e.default))??r[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:r,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(r);return[t,(0,s.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:t}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,a.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:o,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=r(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=r(5893);function b(e){let{className:n,block:r,selectedValue:s,selectValue:o,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),t=a[r].value;t!==s&&(c(n),o(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":r},n),children:a.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:t}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(y,{...e,...n})]})}function v(e){const n=(0,g.Z)();return(0,f.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var s=r(7294),t=r(2263),l=r(9286),o=r(5893);const a=()=>(0,o.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const s=e.split("\n"),t=`${r} ${n}`;let l=!1,o=0,a="";for(const i of s)if(i.includes(t)&&(l=!0),l&&(i.includes("{")&&o++,a+=i+"\n",i.includes("}")&&(o--,0===o)))break;return a.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,o.jsx)(o.Fragment,{children:h?(0,o.jsx)(a,{}):(0,o.jsx)(o.Fragment,{children:x?(0,o.jsxs)("div",{children:["Unable to access the requested link: ",(0,o.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,o.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var s=r(4673),t=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/8fcb4d7f.dee6a17c.js b/pt-BR/assets/js/8fcb4d7f.dee6a17c.js deleted file mode 100644 index 1cc4fc17d0..0000000000 --- a/pt-BR/assets/js/8fcb4d7f.dee6a17c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[81],{3050:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=r(5893),t=r(1151),l=r(4866),o=r(5162),a=r(6393),i=r(4379);const c={sidebar_position:1,tags:["query"]},u="SELECT",d={id:"examples/queries/simple-queries/select",title:"SELECT",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/select.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/select",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/select.mdx",tags:[{label:"query",permalink:"/node-mysql2/pt-BR/docs/tags/query"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["query"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"query(options) \u2014 Row as Array",id:"queryoptions--row-as-array",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions-1",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,s.jsxs)(n.p,{children:["The examples below also work for the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,s.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,s.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-next-line\n const [rows, fields] = await connection.query(sql);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(sql, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions--row-as-array",children:"query(options) \u2014 Row as Array"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n rowsAsArray: true,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n rowsAsArray: true,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server as array"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,s.jsx)(a.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>o});r(7294);var s=r(512);const t={tabItem:"tabItem_Ymn6"};var l=r(5893);function o(e){let{children:n,hidden:r,className:o}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(t.tabItem,o),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var s=r(7294),t=r(512),l=r(2466),o=r(6550),a=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:s,default:t}}=e;return{value:n,label:r,attributes:s,default:t}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:r}=e;const t=(0,o.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:r=!1,groupId:t}=e,l=h(e),[o,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=r.find((e=>e.default))??r[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:r,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(r);return[t,(0,s.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:t}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,a.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:o,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=r(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=r(5893);function b(e){let{className:n,block:r,selectedValue:s,selectValue:o,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),t=a[r].value;t!==s&&(c(n),o(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":r},n),children:a.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:t}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(y,{...e,...n})]})}function v(e){const n=(0,g.Z)();return(0,f.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var s=r(7294),t=r(2263),l=r(9286),o=r(5893);const a=()=>(0,o.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const s=e.split("\n"),t=`${r} ${n}`;let l=!1,o=0,a="";for(const i of s)if(i.includes(t)&&(l=!0),l&&(i.includes("{")&&o++,a+=i+"\n",i.includes("}")&&(o--,0===o)))break;return a.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,o.jsx)(o.Fragment,{children:h?(0,o.jsx)(a,{}):(0,o.jsx)(o.Fragment,{children:x?(0,o.jsxs)("div",{children:["Unable to access the requested link: ",(0,o.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,o.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var s=r(4673),t=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/9318259a.52119974.js b/pt-BR/assets/js/9318259a.52119974.js deleted file mode 100644 index 8d2f1f103e..0000000000 --- a/pt-BR/assets/js/9318259a.52119974.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4503],{7122:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>m});var o=s(5893),a=s(1151),r=s(4866),t=s(5162),l=s(4442);const i={slug:"/",position:1,title:"Guia R\xe1pido",description:"Cliente MySQL para Node.js com foco em performance"},c="MySQL2",d={id:"index",title:"Guia R\xe1pido",description:"Cliente MySQL para Node.js com foco em performance",source:"@site/i18n/pt-BR/docusaurus-plugin-content-docs/current/index.mdx",sourceDirName:".",slug:"/",permalink:"/node-mysql2/pt-BR/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/index.mdx",tags:[],version:"current",frontMatter:{slug:"/",position:1,title:"Guia R\xe1pido",description:"Cliente MySQL para Node.js com foco em performance"},sidebar:"docs",next:{title:"Hist\xf3ria e Porque o MySQL2",permalink:"/node-mysql2/pt-BR/docs/history-and-why-mysq2"}},u={},m=[{value:"Instala\xe7\xe3o",id:"instala\xe7\xe3o",level:2},{value:"Primeira Consulta (Query)",id:"primeira-consulta-query",level:3},{value:"Usando Instru\xe7\xf5es Preparadas (Prepared Statements)",id:"usando-instru\xe7\xf5es-preparadas-prepared-statements",level:3},{value:"Usando Conjunto de Conex\xf5es (pools)",id:"using-connection-pools",level:3},{value:"Usando o Promise Wrapper",id:"usando-o-promise-wrapper",level:3},{value:"Resultados em Array",id:"resultados-em-array",level:3},{value:"Connection Level",id:"connection-level",level:4},{value:"Query Level",id:"query-level",level:4}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.V,{title:"MySQL2 | Guia R\xe1pido"}),"\n",(0,o.jsx)(n.h1,{id:"mysql2",children:"MySQL2"}),"\n","\n",(0,o.jsxs)(n.p,{children:["Cliente MySQL para Node.js com foco em performance. Suporta instru\xe7\xf5es preparadas (",(0,o.jsx)(n.em,{children:"prepared statements"}),"), Codifica\xe7\xf5es ",(0,o.jsx)(n.em,{children:"non-utf8"}),", protocolo de log bin\xe1rio (",(0,o.jsx)(n.em,{children:"binary log protocol"}),"), compress\xe3o, SSL e muito mais."]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/npm/v/mysql2.svg",alt:"NPM Version"})}),"\n",(0,o.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/npm/dm/mysql2.svg",alt:"NPM Downloads"})}),"\n",(0,o.jsx)(n.a,{href:"https://nodejs.org/download/",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/node/v/mysql2.svg",alt:"Node.js Version"})}),"\n",(0,o.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/blob/master/License",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000",alt:"License"})})]}),"\n",(0,o.jsx)(n.h2,{id:"instala\xe7\xe3o",children:"Instala\xe7\xe3o"}),"\n",(0,o.jsx)(n.p,{children:"O MySQL2 n\xe3o tem restri\xe7\xf5es nativas e pode ser instalado no Linux, Mac OS ou Windows sem qualquer problema."}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"JavaScript",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\n"})})}),(0,o.jsxs)(t.Z,{value:"TypeScript",children:[(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),(0,o.jsxs)(n.p,{children:["Para documenta\xe7\xe3o e exemplos usando TypeScript, veja ",(0,o.jsx)(n.a,{href:"/docs/documentation/typescript-examples",children:"aqui"}),"."]})]})]}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.h3,{id:"primeira-consulta-query",children:["Primeira Consulta (",(0,o.jsx)(n.em,{children:"Query"}),")"]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Para explorar mais exemplos de consulta (queries), visite a se\xe7\xe3o de exemplos ",(0,o.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,o.jsx)(n.strong,{children:"Consultas Simples"})})," e ",(0,o.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,o.jsxs)(n.strong,{children:["Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),")"]})}),"."]}),"\n"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Obt\xe9m o cliente\nimport mysql from 'mysql2/promise';\n\n// Cria a conex\xe3o com o Banco de Dados\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// Consulta simples\ntry {\n const [results, fields] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45'\n );\n\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n} catch (err) {\n console.log(err);\n}\n\n// Utilizando espa\xe7os reservados (placeholders)\ntry {\n const [results] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45]\n );\n\n console.log(results);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Obt\xe9m o cliente\nconst mysql = require('mysql2');\n\n// Cria a conex\xe3o com o Banco de Dados\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// Consulta simples\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45',\n function (err, results, fields) {\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n }\n);\n\n// Utilizando espa\xe7os reservados (placeholders)\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45],\n function (err, results) {\n console.log(results);\n }\n);\n"})})})]}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.h3,{id:"usando-instru\xe7\xf5es-preparadas-prepared-statements",children:["Usando Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),")"]}),"\n",(0,o.jsx)(n.p,{children:"Com o MySQL2 voc\xea tamb\xe9m pode obter Instru\xe7\xf5es Preparadas (Prepared Statements). Dessa forma o MySQL n\xe3o precisa preparar um plano para a mesma consulta todas as vezes, resultando em um melhor desempenho. Se voc\xea n\xe3o sabe por que isso \xe9 importante, veja essa discuss\xe3o:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsxs)(n.a,{href:"https://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks",children:["Como as instru\xe7\xf5es preparadas (",(0,o.jsx)(n.em,{children:"prepared statements"}),") podem proteger contra ataques de inje\xe7\xe3o SQL"]})}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 fornece o m\xe9todo auxiliar ",(0,o.jsx)(n.code,{children:"execute"})," que ir\xe1 preparar e consultar as declara\xe7\xf5es (",(0,o.jsx)(n.em,{children:"statements"}),") SQL. Al\xe9m disso, voc\xea tamb\xe9m pode usar os m\xe9todos ",(0,o.jsx)(n.code,{children:"prepare"})," e ",(0,o.jsx)(n.code,{children:"unprepare"})," para preparar ou desfazer a prepara\xe7\xe3o de declara\xe7\xf5es (",(0,o.jsx)(n.em,{children:"statements"}),") manualmente, se necess\xe1rio."]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Para explorar mais exemplos de Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),"), visite a se\xe7\xe3o de exemplos ",(0,o.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,o.jsxs)(n.strong,{children:["Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),")"]})}),"."]}),"\n"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // Cria a conex\xe3o com o Banco de Dados\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // \"execute\" ir\xe1 chamar internamente a prepara\xe7\xe3o e a consulta (query)\n const [results, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53]\n );\n\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// Cria a conex\xe3o com o Banco de Dados\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// \"execute\" ir\xe1 chamar internamente a prepara\xe7\xe3o e a consulta (query)\nconnection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53],\n function (err, results, fields) {\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n }\n);\n"})})})]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsx)(n.p,{children:"Se voc\xea executar a mesma declara\xe7\xe3o novamente, ela ser\xe1 selecionada a partir do LRU Cache, o que economizar\xe1 tempo de prepara\xe7\xe3o da consulta e proporcionar\xe1 melhor desempenho."})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.h3,{id:"using-connection-pools",children:["Usando Conjunto de Conex\xf5es (",(0,o.jsx)(n.em,{children:"pools"}),")"]}),"\n",(0,o.jsxs)(n.p,{children:["O conjunto de conex\xf5es (",(0,o.jsx)(n.em,{children:"pools"}),") ajuda a reduzir o tempo gasto na conex\xe3o com o servidor MySQL, reutilizando uma conex\xe3o anterior e deixando-as abertas ao inv\xe9s de fech\xe1-las quando voc\xea termina de us\xe1-las."]}),"\n",(0,o.jsxs)(n.p,{children:["Isto melhora a lat\xeancia das consultas (",(0,o.jsx)(n.em,{children:"queries"}),"), pois evita toda a sobrecarga associada \xe0 cria\xe7\xe3o de uma nova conex\xe3o."]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Para explorar mais exemplos de Conjunto de Conex\xf5es (",(0,o.jsx)(n.em,{children:"pools"}),"), visite a se\xe7\xe3o de exemplos ",(0,o.jsx)(n.a,{href:"/docs/examples/connections/create-pool",children:(0,o.jsx)(n.strong,{children:"createPool"})}),"."]}),"\n"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\n// Cria a conex\xe3o (pool). As defini\xe7\xf5es espec\xedficadas do \"createPool\" s\xe3o as predefini\xe7\xf5es padr\xf5es\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // M\xe1ximo de conex\xf5es inativas; o valor padr\xe3o \xe9 o mesmo que \"connectionLimit\"\n idleTimeout: 60000, // Tempo limite das conex\xf5es inativas em milissegundos; o valor padr\xe3o \xe9 \"60000\"\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// Cria a conex\xe3o (pool). As defini\xe7\xf5es espec\xedficadas do \"createPool\" s\xe3o as predefini\xe7\xf5es padr\xf5es\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // M\xe1ximo de conex\xf5es inativas; o valor padr\xe3o \xe9 o mesmo que \"connectionLimit\"\n idleTimeout: 60000, // Tempo limite das conex\xf5es inativas em milissegundos; o valor padr\xe3o \xe9 \"60000\"\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})})]}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsxs)(n.p,{children:["O ",(0,o.jsx)(n.em,{children:"pool"})," n\xe3o estabelece todas as conex\xf5es previamente, mas as cria sob demanda at\xe9 que o limite de conex\xf5es seja atingido."]})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.p,{children:["Voc\xea pode usar o ",(0,o.jsx)(n.em,{children:"pool"})," da mesma maneira como em uma conex\xe3o (usando ",(0,o.jsx)(n.code,{children:"pool.query()"})," e ",(0,o.jsx)(n.code,{children:"pool.execute()"}),"):"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"try {\n // Para a inicializa\xe7\xe3o do \"pool\", veja acima\n const [rows, fields] = await pool.query('SELECT `field` FROM `table`');\n // A conex\xe3o \xe9 automaticamente liberada quando a consulta (query) \xe9 resolvida\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Para a inicializa\xe7\xe3o do \"pool\", veja acima\npool.query('SELECT `field` FROM `table`', function (err, rows, fields) {\n // A conex\xe3o \xe9 automaticamente liberada quando a consulta (query) \xe9 resolvida\n});\n"})})})]}),"\n",(0,o.jsx)(n.p,{children:"Alternativamente, tamb\xe9m existe a possibilidade de adquirir manualmente uma conex\xe3o do pool e liber\xe1-la posteriormente:"}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'// Para a inicializa\xe7\xe3o do "pool", veja acima\nconst conn = await pool.getConnection();\n\n// Fazer algo com a conex\xe3o\nawait conn.query(/* ... */);\n\n// N\xe3o se esque\xe7a de liberar a conex\xe3o quando terminar!\npool.releaseConnection(conn);\n'})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'// Para a inicializa\xe7\xe3o do "pool", veja acima\npool.getConnection(function (err, conn) {\n // Fazer algo com a conex\xe3o\n conn.query(/* ... */);\n\n // N\xe3o se esque\xe7a de liberar a conex\xe3o quando terminar!\n pool.releaseConnection(conn);\n});\n'})})})]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Adicionalmente, voc\xea pode liberar a conex\xe3o usando o objeto ",(0,o.jsx)(n.code,{children:"connection"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"conn.release();\n"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.h3,{id:"usando-o-promise-wrapper",children:["Usando o ",(0,o.jsx)(n.em,{children:"Promise Wrapper"})]}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 tamb\xe9m suporta ",(0,o.jsx)(n.em,{children:"Promise"})," API. O que funciona muito bem com o ES7 ",(0,o.jsx)(n.em,{children:"async await"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nasync function main() {\n // Cria a conex\xe3o com o Banco de Dados\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // Consulta no Banco de Dados\n const [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n );\n}\n"})}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 usa o objeto ",(0,o.jsx)(n.em,{children:(0,o.jsx)(n.code,{children:"Promise"})})," padr\xe3o dispon\xedvel no escopo. Mas voc\xea pode escolher qual implementa\xe7\xe3o de ",(0,o.jsx)(n.em,{children:(0,o.jsx)(n.code,{children:"Promise"})})," deseja usar."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Obt\xe9m o cliente\nimport mysql from 'mysql2/promise';\n\n// Obt\xe9m a implementa\xe7\xe3o de \"Promise\" (n\xf3s usaremos o \"bluebird\")\nimport bluebird from 'bluebird';\n\n// Cria a conex\xe3o, especificando o \"bluebird\" como \"Promise\"\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n Promise: bluebird,\n});\n\n// Consulta no Banco de Dados\nconst [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n);\n"})}),"\n",(0,o.jsxs)(n.p,{children:["MySQL2 also exposes a ",(0,o.jsx)(n.code,{children:".promise()"})," function on Pools, so you can create a promise/non-promise connections from the same pool."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2';\n\nasync function main() {\n // create the pool\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // now get a Promise wrapped instance of that pool\n const promisePool = pool.promise();\n\n // query database using promises\n const [rows, fields] = await promisePool.query('SELECT 1');\n}\n"})}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 tamb\xe9m exp\xf5e o m\xe9todo .promise() em ",(0,o.jsx)(n.em,{children:"Pools"}),', ent\xe3o voc\xea pode criar conex\xf5es "',(0,o.jsx)(n.em,{children:"promise/non-promise"}),'" para o mesmo ',(0,o.jsx)(n.em,{children:"pool"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const mysql = require('mysql2');\n\n// Cria a conex\xe3o\nconst conn = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\nconn\n .promise()\n .query('SELECT 1')\n .then(([rows, fields]) => {\n console.log(rows);\n })\n .catch(console.log)\n .then(() => conn.end());\n"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsxs)(n.h3,{id:"resultados-em-array",children:["Resultados em ",(0,o.jsx)(n.em,{children:"Array"})]}),"\n",(0,o.jsxs)(n.p,{children:["Se voc\xea tiver duas colunas com o mesmo nome, pode preferir receber os resultados como um ",(0,o.jsx)(n.em,{children:"array"}),", em vez de um objeto, para evitar conflitos. Isso \xe9 uma diverg\xeancia da biblioteca ",(0,o.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Por exemplo: ",(0,o.jsx)(n.code,{children:"SELECT 1 AS `foo`, 2 AS `foo`"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Voc\xea pode habilitar essa configura\xe7\xe3o tanto no n\xedvel de conex\xe3o (aplica-se a todas as consultas), quanto no n\xedvel de consulta (aplica-se apenas a essa consulta espec\xedfica)."}),"\n",(0,o.jsx)(n.h4,{id:"connection-level",children:"Connection Level"}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = await mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})})]}),"\n",(0,o.jsx)(n.h4,{id:"query-level",children:"Query Level"}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{4}",children:'try {\n const [results, fields] = await conn.query({\n sql: \'SELECT 1 AS `foo`, 2 AS `foo`\',\n rowsAsArray: true,\n });\n\n console.log(results); // nessa consulta, "results" cont\xeam um array de arrays ao inv\xe9s de um array de objetos\n console.log(fields); // "fields" mant\xeam-se inalterados\n} catch (err) {\n console.log(err);\n}\n'})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{4}",children:'conn.query(\n {\n sql: \'SELECT 1 AS `foo`, 2 AS `foo`\',\n rowsAsArray: true,\n },\n function (err, results, fields) {\n console.log(results); // nessa consulta, "results" cont\xeam um array de arrays ao inv\xe9s de um array de objetos\n console.log(fields); // "fields" mant\xeam-se inalterados\n }\n);\n'})})})]}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.admonition,{title:"Obtendo Ajuda",type:"tip",children:(0,o.jsxs)(n.p,{children:["Precisa de ajuda? Fa\xe7a sua pergunta no ",(0,o.jsx)(n.a,{href:"https://stackoverflow.com/questions/tagged/mysql2",children:"Stack Overflow"})," ou ",(0,o.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions",children:"GitHub"}),".\nSe voc\xea encontrou um erro, ",(0,o.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues",children:"registre-o no GitHub"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var o=s(512);const a={tabItem:"tabItem_Ymn6"};var r=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.Z)(a.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var o=s(7294),a=s(512),r=s(2466),t=s(6550),l=s(469),i=s(1980),c=s(7392),d=s(12);function u(e){return o.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:n,children:s}=e;return(0,o.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:o,default:a}}=e;return{value:n,label:s,attributes:o,default:a}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function h(e){let{queryString:n=!1,groupId:s}=e;const a=(0,t.k6)(),r=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(r),(0,o.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(a.location.search);n.set(r,e),a.replace({...a.location,search:n.toString()})}),[r,a])]}function x(e){const{defaultValue:n,queryString:s=!1,groupId:a}=e,r=m(e),[t,i]=(0,o.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const o=s.find((e=>e.default))??s[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:n,tabValues:r}))),[c,u]=h({queryString:s,groupId:a}),[x,j]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[a,r]=(0,d.Nk)(s);return[a,(0,o.useCallback)((e=>{s&&r.set(e)}),[s,r])]}({groupId:a}),f=(()=>{const e=c??x;return p({value:e,tabValues:r})?e:null})();(0,l.Z)((()=>{f&&i(f)}),[f]);return{selectedValue:t,selectValue:(0,o.useCallback)((e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),j(e)}),[u,j,r]),tabValues:r}}var j=s(2389);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=s(5893);function b(e){let{className:n,block:s,selectedValue:o,selectValue:t,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),a=l[s].value;a!==o&&(c(n),t(a))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:o===n?0:-1,"aria-selected":o===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...r,className:(0,a.Z)("tabs__item",f.tabItem,r?.className,{"tabs__item--active":o===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:a}=e;const r=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===a));return e?(0,o.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==a})))})}function y(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,a.Z)("tabs-container",f.tabList),children:[(0,g.jsx)(b,{...e,...n}),(0,g.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,g.jsx)(y,{...e,children:u(e.children)},String(n))}},4442:(e,n,s)=>{s.d(n,{V:()=>r});var o=s(5742),a=s(5893);const r=e=>{let{title:n}=e;return(0,a.jsx)(o.Z,{children:(0,a.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>t});var o=s(7294);const a={},r=o.createContext(a);function t(e){const n=o.useContext(r);return o.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(a):e.components||a:t(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/9318259a.ffa4c25b.js b/pt-BR/assets/js/9318259a.ffa4c25b.js new file mode 100644 index 0000000000..757febf23c --- /dev/null +++ b/pt-BR/assets/js/9318259a.ffa4c25b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4503],{7122:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>m});var o=s(5893),a=s(1151),r=s(4866),t=s(5162),l=s(4442);const i={slug:"/",position:1,title:"Guia R\xe1pido",description:"Cliente MySQL para Node.js com foco em performance"},c="MySQL2",d={id:"index",title:"Guia R\xe1pido",description:"Cliente MySQL para Node.js com foco em performance",source:"@site/i18n/pt-BR/docusaurus-plugin-content-docs/current/index.mdx",sourceDirName:".",slug:"/",permalink:"/node-mysql2/pt-BR/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/index.mdx",tags:[],version:"current",frontMatter:{slug:"/",position:1,title:"Guia R\xe1pido",description:"Cliente MySQL para Node.js com foco em performance"},sidebar:"docs",next:{title:"Hist\xf3ria e Porque o MySQL2",permalink:"/node-mysql2/pt-BR/docs/history-and-why-mysq2"}},u={},m=[{value:"Instala\xe7\xe3o",id:"instala\xe7\xe3o",level:2},{value:"Primeira Consulta (Query)",id:"primeira-consulta-query",level:3},{value:"Usando Instru\xe7\xf5es Preparadas (Prepared Statements)",id:"usando-instru\xe7\xf5es-preparadas-prepared-statements",level:3},{value:"Usando Conjunto de Conex\xf5es (pools)",id:"using-connection-pools",level:3},{value:"Usando o Promise Wrapper",id:"usando-o-promise-wrapper",level:3},{value:"Resultados em Array",id:"resultados-em-array",level:3},{value:"Connection Level",id:"connection-level",level:4},{value:"Query Level",id:"query-level",level:4}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.V,{title:"MySQL2 | Guia R\xe1pido"}),"\n",(0,o.jsx)(n.h1,{id:"mysql2",children:"MySQL2"}),"\n","\n",(0,o.jsxs)(n.p,{children:["Cliente MySQL para Node.js com foco em performance. Suporta instru\xe7\xf5es preparadas (",(0,o.jsx)(n.em,{children:"prepared statements"}),"), Codifica\xe7\xf5es ",(0,o.jsx)(n.em,{children:"non-utf8"}),", protocolo de log bin\xe1rio (",(0,o.jsx)(n.em,{children:"binary log protocol"}),"), compress\xe3o, SSL e muito mais."]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/npm/v/mysql2.svg",alt:"NPM Version"})}),"\n",(0,o.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/npm/dm/mysql2.svg",alt:"NPM Downloads"})}),"\n",(0,o.jsx)(n.a,{href:"https://nodejs.org/download/",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/node/v/mysql2.svg",alt:"Node.js Version"})}),"\n",(0,o.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/blob/master/License",children:(0,o.jsx)(n.img,{src:"https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000",alt:"License"})})]}),"\n",(0,o.jsx)(n.h2,{id:"instala\xe7\xe3o",children:"Instala\xe7\xe3o"}),"\n",(0,o.jsx)(n.p,{children:"O MySQL2 n\xe3o tem restri\xe7\xf5es nativas e pode ser instalado no Linux, Mac OS ou Windows sem qualquer problema."}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"JavaScript",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\n"})})}),(0,o.jsxs)(t.Z,{value:"TypeScript",children:[(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),(0,o.jsxs)(n.p,{children:["Para documenta\xe7\xe3o e exemplos usando TypeScript, veja ",(0,o.jsx)(n.a,{href:"/docs/documentation/typescript-examples",children:"aqui"}),"."]})]})]}),"\n",(0,o.jsx)("hr",{}),"\n",(0,o.jsxs)(n.h3,{id:"primeira-consulta-query",children:["Primeira Consulta (",(0,o.jsx)(n.em,{children:"Query"}),")"]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Para explorar mais exemplos de consulta (queries), visite a se\xe7\xe3o de exemplos ",(0,o.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,o.jsx)(n.strong,{children:"Consultas Simples"})})," e ",(0,o.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,o.jsxs)(n.strong,{children:["Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),")"]})}),"."]}),"\n"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Obt\xe9m o cliente\nimport mysql from 'mysql2/promise';\n\n// Cria a conex\xe3o com o Banco de Dados\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// Consulta simples\ntry {\n const [results, fields] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45'\n );\n\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n} catch (err) {\n console.log(err);\n}\n\n// Utilizando espa\xe7os reservados (placeholders)\ntry {\n const [results] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45]\n );\n\n console.log(results);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Obt\xe9m o cliente\nconst mysql = require('mysql2');\n\n// Cria a conex\xe3o com o Banco de Dados\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// Consulta simples\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45',\n function (err, results, fields) {\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n }\n);\n\n// Utilizando espa\xe7os reservados (placeholders)\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45],\n function (err, results) {\n console.log(results);\n }\n);\n"})})})]}),"\n",(0,o.jsx)("hr",{}),"\n",(0,o.jsxs)(n.h3,{id:"usando-instru\xe7\xf5es-preparadas-prepared-statements",children:["Usando Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),")"]}),"\n",(0,o.jsx)(n.p,{children:"Com o MySQL2 voc\xea tamb\xe9m pode obter Instru\xe7\xf5es Preparadas (Prepared Statements). Dessa forma o MySQL n\xe3o precisa preparar um plano para a mesma consulta todas as vezes, resultando em um melhor desempenho. Se voc\xea n\xe3o sabe por que isso \xe9 importante, veja essa discuss\xe3o:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsxs)(n.a,{href:"https://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks",children:["Como as instru\xe7\xf5es preparadas (",(0,o.jsx)(n.em,{children:"prepared statements"}),") podem proteger contra ataques de inje\xe7\xe3o SQL"]})}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 fornece o m\xe9todo auxiliar ",(0,o.jsx)(n.code,{children:"execute"})," que ir\xe1 preparar e consultar as declara\xe7\xf5es (",(0,o.jsx)(n.em,{children:"statements"}),") SQL. Al\xe9m disso, voc\xea tamb\xe9m pode usar os m\xe9todos ",(0,o.jsx)(n.code,{children:"prepare"})," e ",(0,o.jsx)(n.code,{children:"unprepare"})," para preparar ou desfazer a prepara\xe7\xe3o de declara\xe7\xf5es (",(0,o.jsx)(n.em,{children:"statements"}),") manualmente, se necess\xe1rio."]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Para explorar mais exemplos de Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),"), visite a se\xe7\xe3o de exemplos ",(0,o.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,o.jsxs)(n.strong,{children:["Instru\xe7\xf5es Preparadas (",(0,o.jsx)(n.em,{children:"Prepared Statements"}),")"]})}),"."]}),"\n"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // Cria a conex\xe3o com o Banco de Dados\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // \"execute\" ir\xe1 chamar internamente a prepara\xe7\xe3o e a consulta (query)\n const [results, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53]\n );\n\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// Cria a conex\xe3o com o Banco de Dados\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// \"execute\" ir\xe1 chamar internamente a prepara\xe7\xe3o e a consulta (query)\nconnection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53],\n function (err, results, fields) {\n console.log(results); // \"results\" cont\xeam as linhas retornadas pelo servidor\n console.log(fields); // \"fields\" cont\xeam metadados adicionais sobre os resultados, quando dispon\xedveis\n }\n);\n"})})})]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsx)(n.p,{children:"Se voc\xea executar a mesma declara\xe7\xe3o novamente, ela ser\xe1 selecionada a partir do LRU Cache, o que economizar\xe1 tempo de prepara\xe7\xe3o da consulta e proporcionar\xe1 melhor desempenho."})}),"\n",(0,o.jsx)("hr",{}),"\n",(0,o.jsxs)(n.h3,{id:"using-connection-pools",children:["Usando Conjunto de Conex\xf5es (",(0,o.jsx)(n.em,{children:"pools"}),")"]}),"\n",(0,o.jsxs)(n.p,{children:["O conjunto de conex\xf5es (",(0,o.jsx)(n.em,{children:"pools"}),") ajuda a reduzir o tempo gasto na conex\xe3o com o servidor MySQL, reutilizando uma conex\xe3o anterior e deixando-as abertas ao inv\xe9s de fech\xe1-las quando voc\xea termina de us\xe1-las."]}),"\n",(0,o.jsxs)(n.p,{children:["Isto melhora a lat\xeancia das consultas (",(0,o.jsx)(n.em,{children:"queries"}),"), pois evita toda a sobrecarga associada \xe0 cria\xe7\xe3o de uma nova conex\xe3o."]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Para explorar mais exemplos de Conjunto de Conex\xf5es (",(0,o.jsx)(n.em,{children:"pools"}),"), visite a se\xe7\xe3o de exemplos ",(0,o.jsx)(n.a,{href:"/docs/examples/connections/create-pool",children:(0,o.jsx)(n.strong,{children:"createPool"})}),"."]}),"\n"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\n// Cria a conex\xe3o (pool). As defini\xe7\xf5es espec\xedficadas do \"createPool\" s\xe3o as predefini\xe7\xf5es padr\xf5es\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // M\xe1ximo de conex\xf5es inativas; o valor padr\xe3o \xe9 o mesmo que \"connectionLimit\"\n idleTimeout: 60000, // Tempo limite das conex\xf5es inativas em milissegundos; o valor padr\xe3o \xe9 \"60000\"\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// Cria a conex\xe3o (pool). As defini\xe7\xf5es espec\xedficadas do \"createPool\" s\xe3o as predefini\xe7\xf5es padr\xf5es\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // M\xe1ximo de conex\xf5es inativas; o valor padr\xe3o \xe9 o mesmo que \"connectionLimit\"\n idleTimeout: 60000, // Tempo limite das conex\xf5es inativas em milissegundos; o valor padr\xe3o \xe9 \"60000\"\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})})]}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsxs)(n.p,{children:["O ",(0,o.jsx)(n.em,{children:"pool"})," n\xe3o estabelece todas as conex\xf5es previamente, mas as cria sob demanda at\xe9 que o limite de conex\xf5es seja atingido."]})}),"\n",(0,o.jsx)("hr",{}),"\n",(0,o.jsxs)(n.p,{children:["Voc\xea pode usar o ",(0,o.jsx)(n.em,{children:"pool"})," da mesma maneira como em uma conex\xe3o (usando ",(0,o.jsx)(n.code,{children:"pool.query()"})," e ",(0,o.jsx)(n.code,{children:"pool.execute()"}),"):"]}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"try {\n // Para a inicializa\xe7\xe3o do \"pool\", veja acima\n const [rows, fields] = await pool.query('SELECT `field` FROM `table`');\n // A conex\xe3o \xe9 automaticamente liberada quando a consulta (query) \xe9 resolvida\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Para a inicializa\xe7\xe3o do \"pool\", veja acima\npool.query('SELECT `field` FROM `table`', function (err, rows, fields) {\n // A conex\xe3o \xe9 automaticamente liberada quando a consulta (query) \xe9 resolvida\n});\n"})})})]}),"\n",(0,o.jsx)(n.p,{children:"Alternativamente, tamb\xe9m existe a possibilidade de adquirir manualmente uma conex\xe3o do pool e liber\xe1-la posteriormente:"}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'// Para a inicializa\xe7\xe3o do "pool", veja acima\nconst conn = await pool.getConnection();\n\n// Fazer algo com a conex\xe3o\nawait conn.query(/* ... */);\n\n// N\xe3o se esque\xe7a de liberar a conex\xe3o quando terminar!\npool.releaseConnection(conn);\n'})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'// Para a inicializa\xe7\xe3o do "pool", veja acima\npool.getConnection(function (err, conn) {\n // Fazer algo com a conex\xe3o\n conn.query(/* ... */);\n\n // N\xe3o se esque\xe7a de liberar a conex\xe3o quando terminar!\n pool.releaseConnection(conn);\n});\n'})})})]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Adicionalmente, voc\xea pode liberar a conex\xe3o usando o objeto ",(0,o.jsx)(n.code,{children:"connection"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"conn.release();\n"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)("hr",{}),"\n",(0,o.jsxs)(n.h3,{id:"usando-o-promise-wrapper",children:["Usando o ",(0,o.jsx)(n.em,{children:"Promise Wrapper"})]}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 tamb\xe9m suporta ",(0,o.jsx)(n.em,{children:"Promise"})," API. O que funciona muito bem com o ES7 ",(0,o.jsx)(n.em,{children:"async await"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nasync function main() {\n // Cria a conex\xe3o com o Banco de Dados\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // Consulta no Banco de Dados\n const [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n );\n}\n"})}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 usa o objeto ",(0,o.jsx)(n.em,{children:(0,o.jsx)(n.code,{children:"Promise"})})," padr\xe3o dispon\xedvel no escopo. Mas voc\xea pode escolher qual implementa\xe7\xe3o de ",(0,o.jsx)(n.em,{children:(0,o.jsx)(n.code,{children:"Promise"})})," deseja usar."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"// Obt\xe9m o cliente\nimport mysql from 'mysql2/promise';\n\n// Obt\xe9m a implementa\xe7\xe3o de \"Promise\" (n\xf3s usaremos o \"bluebird\")\nimport bluebird from 'bluebird';\n\n// Cria a conex\xe3o, especificando o \"bluebird\" como \"Promise\"\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n Promise: bluebird,\n});\n\n// Consulta no Banco de Dados\nconst [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n);\n"})}),"\n",(0,o.jsxs)(n.p,{children:["MySQL2 also exposes a ",(0,o.jsx)(n.code,{children:".promise()"})," function on Pools, so you can create a promise/non-promise connections from the same pool."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2';\n\nasync function main() {\n // create the pool\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // now get a Promise wrapped instance of that pool\n const promisePool = pool.promise();\n\n // query database using promises\n const [rows, fields] = await promisePool.query('SELECT 1');\n}\n"})}),"\n",(0,o.jsxs)(n.p,{children:["O MySQL2 tamb\xe9m exp\xf5e o m\xe9todo .promise() em ",(0,o.jsx)(n.em,{children:"Pools"}),', ent\xe3o voc\xea pode criar conex\xf5es "',(0,o.jsx)(n.em,{children:"promise/non-promise"}),'" para o mesmo ',(0,o.jsx)(n.em,{children:"pool"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const mysql = require('mysql2');\n\n// Cria a conex\xe3o\nconst conn = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\nconn\n .promise()\n .query('SELECT 1')\n .then(([rows, fields]) => {\n console.log(rows);\n })\n .catch(console.log)\n .then(() => conn.end());\n"})}),"\n",(0,o.jsx)("hr",{}),"\n",(0,o.jsxs)(n.h3,{id:"resultados-em-array",children:["Resultados em ",(0,o.jsx)(n.em,{children:"Array"})]}),"\n",(0,o.jsxs)(n.p,{children:["Se voc\xea tiver duas colunas com o mesmo nome, pode preferir receber os resultados como um ",(0,o.jsx)(n.em,{children:"array"}),", em vez de um objeto, para evitar conflitos. Isso \xe9 uma diverg\xeancia da biblioteca ",(0,o.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Por exemplo: ",(0,o.jsx)(n.code,{children:"SELECT 1 AS `foo`, 2 AS `foo`"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Voc\xea pode habilitar essa configura\xe7\xe3o tanto no n\xedvel de conex\xe3o (aplica-se a todas as consultas), quanto no n\xedvel de consulta (aplica-se apenas a essa consulta espec\xedfica)."}),"\n",(0,o.jsx)(n.h4,{id:"connection-level",children:"Connection Level"}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = await mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})})]}),"\n",(0,o.jsx)(n.h4,{id:"query-level",children:"Query Level"}),"\n",(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(t.Z,{value:"Promise",default:!0,children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{4}",children:'try {\n const [results, fields] = await conn.query({\n sql: \'SELECT 1 AS `foo`, 2 AS `foo`\',\n rowsAsArray: true,\n });\n\n console.log(results); // nessa consulta, "results" cont\xeam um array de arrays ao inv\xe9s de um array de objetos\n console.log(fields); // "fields" mant\xeam-se inalterados\n} catch (err) {\n console.log(err);\n}\n'})})}),(0,o.jsx)(t.Z,{value:"Callback",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:"{4}",children:'conn.query(\n {\n sql: \'SELECT 1 AS `foo`, 2 AS `foo`\',\n rowsAsArray: true,\n },\n function (err, results, fields) {\n console.log(results); // nessa consulta, "results" cont\xeam um array de arrays ao inv\xe9s de um array de objetos\n console.log(fields); // "fields" mant\xeam-se inalterados\n }\n);\n'})})})]}),"\n",(0,o.jsx)("hr",{}),"\n",(0,o.jsx)(n.admonition,{title:"Obtendo Ajuda",type:"tip",children:(0,o.jsxs)(n.p,{children:["Precisa de ajuda? Fa\xe7a sua pergunta no ",(0,o.jsx)(n.a,{href:"https://stackoverflow.com/questions/tagged/mysql2",children:"Stack Overflow"})," ou ",(0,o.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions",children:"GitHub"}),".\nSe voc\xea encontrou um erro, ",(0,o.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues",children:"registre-o no GitHub"}),"."]})})]})}function h(e={}){const{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var o=s(512);const a={tabItem:"tabItem_Ymn6"};var r=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.Z)(a.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var o=s(7294),a=s(512),r=s(2466),t=s(6550),l=s(469),i=s(1980),c=s(7392),d=s(12);function u(e){return o.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:n,children:s}=e;return(0,o.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:o,default:a}}=e;return{value:n,label:s,attributes:o,default:a}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function h(e){let{queryString:n=!1,groupId:s}=e;const a=(0,t.k6)(),r=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(r),(0,o.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(a.location.search);n.set(r,e),a.replace({...a.location,search:n.toString()})}),[r,a])]}function x(e){const{defaultValue:n,queryString:s=!1,groupId:a}=e,r=m(e),[t,i]=(0,o.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const o=s.find((e=>e.default))??s[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:n,tabValues:r}))),[c,u]=h({queryString:s,groupId:a}),[x,j]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[a,r]=(0,d.Nk)(s);return[a,(0,o.useCallback)((e=>{s&&r.set(e)}),[s,r])]}({groupId:a}),f=(()=>{const e=c??x;return p({value:e,tabValues:r})?e:null})();(0,l.Z)((()=>{f&&i(f)}),[f]);return{selectedValue:t,selectValue:(0,o.useCallback)((e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),j(e)}),[u,j,r]),tabValues:r}}var j=s(2389);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=s(5893);function b(e){let{className:n,block:s,selectedValue:o,selectValue:t,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),a=l[s].value;a!==o&&(c(n),t(a))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:o===n?0:-1,"aria-selected":o===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...r,className:(0,a.Z)("tabs__item",f.tabItem,r?.className,{"tabs__item--active":o===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:a}=e;const r=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===a));return e?(0,o.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==a})))})}function y(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,a.Z)("tabs-container",f.tabList),children:[(0,g.jsx)(b,{...e,...n}),(0,g.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,g.jsx)(y,{...e,children:u(e.children)},String(n))}},4442:(e,n,s)=>{s.d(n,{V:()=>r});var o=s(5742),a=s(5893);const r=e=>{let{title:n}=e;return(0,a.jsx)(o.Z,{children:(0,a.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>t});var o=s(7294);const a={},r=o.createContext(a);function t(e){const n=o.useContext(r);return o.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(a):e.components||a:t(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/9e767aa9.4b4974e0.js b/pt-BR/assets/js/9e767aa9.4b4974e0.js new file mode 100644 index 0000000000..8738b4d948 --- /dev/null +++ b/pt-BR/assets/js/9e767aa9.4b4974e0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8806],{7372:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>a});var i=s(5893),t=s(1151),o=s(4442);const r={slug:"/documentation",title:"Introduction"},l="Documentation",c={id:"documentation/index",title:"Introduction",description:"[node-mysql]//github.com/mysqljs/mysql",source:"@site/docs/documentation/00-index.mdx",sourceDirName:"documentation",slug:"/documentation",permalink:"/node-mysql2/pt-BR/docs/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/00-index.mdx",tags:[],version:"current",sidebarPosition:0,frontMatter:{slug:"/documentation",title:"Introduction"},sidebar:"docs",previous:{title:"Stability Badges",permalink:"/node-mysql2/pt-BR/docs/stability-badges"},next:{title:"Authentication Switch Request",permalink:"/node-mysql2/pt-BR/docs/documentation/authentication-switch"}},d={},a=[{value:"Examples",id:"examples",level:2},{value:"Known incompatibilities with Node MySQL",id:"known-incompatibilities-with-node-mysql",level:2},{value:"Other Resources",id:"other-resources",level:2},{value:"Benchmarks",id:"benchmarks",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.V,{title:"Documentation"}),"\n",(0,i.jsx)(n.h1,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n.p,{children:["MySQL2 aims to be a drop in replacement for ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["If you see any API incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", please report via github issue."]})})}),"\n",(0,i.jsxs)(n.p,{children:["Not only ",(0,i.jsx)(n.strong,{children:"MySQL2"})," offers better performance over ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", we also support these additional features:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/promise-wrapper",children:"Promise Wrapper"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/authentication-switch",children:"Authentication Switch"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/extras",children:"More Features"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/mysql-server",children:"MySQL Server"})}),"\n",(0,i.jsx)(n.li,{children:"Pooling"}),"\n",(0,i.jsx)(n.li,{children:"SSL"}),"\n",(0,i.jsx)(n.li,{children:"MySQL Compression"}),"\n",(0,i.jsx)(n.li,{children:"Binary Log Protocol Client"}),"\n"]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,i.jsxs)(n.p,{children:["Please check these ",(0,i.jsx)(n.a,{href:"/docs/examples",children:"examples"})," for ",(0,i.jsx)(n.strong,{children:"MySQL2"}),"."]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsxs)(n.h2,{id:"known-incompatibilities-with-node-mysql",children:["Known incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"zeroFill"})," flag is ignored in type conversion.\nYou need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"DECIMAL"})," and ",(0,i.jsx)(n.code,{children:"NEWDECIMAL"})," types always returned as ",(0,i.jsx)(n.code,{children:"string"})," unless you pass this config option:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"{\n decimalNumbers: true,\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"This option could lose precision on the number as Javascript Number is a Float!"})}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"other-resources",children:"Other Resources"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/client-server-protocol.html",children:"Wire protocol documentation"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," - Most popular node.js mysql client library"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mariasql/",children:"node-mariasql"})," - Bindings to libmariasql. One of the fastest clients"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/Sannis/node-mysql-libmysqlclient",children:"node-libmysqlclient"})," - Bindings to libmysqlclient"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/siddontang/go-mysql",children:"go-mysql"})," - MySQL Go client (prepared statements, binlog protocol, server)"]}),"\n"]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"benchmarks",children:"Benchmarks"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b",children:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"npm run benchmarks"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mysql-benchmarks",children:"node-mysql-benchmarks"})}),"\n",(0,i.jsxs)(n.li,{children:["try to run example ",(0,i.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/benchmarks",children:"benchmarks"})," on your system"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},4442:(e,n,s)=>{s.d(n,{V:()=>o});var i=s(5742),t=s(5893);const o=e=>{let{title:n}=e;return(0,t.jsx)(i.Z,{children:(0,t.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>r});var i=s(7294);const t={},o=i.createContext(t);function r(e){const n=i.useContext(o);return i.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(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/9e767aa9.9d5004a2.js b/pt-BR/assets/js/9e767aa9.9d5004a2.js deleted file mode 100644 index b92b70fe41..0000000000 --- a/pt-BR/assets/js/9e767aa9.9d5004a2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8806],{7372:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>h});var i=s(5893),t=s(1151),o=s(4442);const r={slug:"/documentation",title:"Introduction"},l="Documentation",c={id:"documentation/index",title:"Introduction",description:"[node-mysql]//github.com/mysqljs/mysql",source:"@site/docs/documentation/00-index.mdx",sourceDirName:"documentation",slug:"/documentation",permalink:"/node-mysql2/pt-BR/docs/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/00-index.mdx",tags:[],version:"current",sidebarPosition:0,frontMatter:{slug:"/documentation",title:"Introduction"},sidebar:"docs",previous:{title:"Stability Badges",permalink:"/node-mysql2/pt-BR/docs/stability-badges"},next:{title:"Authentication Switch Request",permalink:"/node-mysql2/pt-BR/docs/documentation/authentication-switch"}},d={},h=[{value:"Examples",id:"examples",level:2},{value:"Known incompatibilities with Node MySQL",id:"known-incompatibilities-with-node-mysql",level:2},{value:"Other Resources",id:"other-resources",level:2},{value:"Benchmarks",id:"benchmarks",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.V,{title:"Documentation"}),"\n",(0,i.jsx)(n.h1,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n.p,{children:["MySQL2 aims to be a drop in replacement for ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["If you see any API incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", please report via github issue."]})})}),"\n",(0,i.jsxs)(n.p,{children:["Not only ",(0,i.jsx)(n.strong,{children:"MySQL2"})," offers better performance over ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", we also support these additional features:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/promise-wrapper",children:"Promise Wrapper"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/authentication-switch",children:"Authentication Switch"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/extras",children:"More Features"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/mysql-server",children:"MySQL Server"})}),"\n",(0,i.jsx)(n.li,{children:"Pooling"}),"\n",(0,i.jsx)(n.li,{children:"SSL"}),"\n",(0,i.jsx)(n.li,{children:"MySQL Compression"}),"\n",(0,i.jsx)(n.li,{children:"Binary Log Protocol Client"}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,i.jsxs)(n.p,{children:["Please check these ",(0,i.jsx)(n.a,{href:"/docs/examples",children:"examples"})," for ",(0,i.jsx)(n.strong,{children:"MySQL2"}),"."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"known-incompatibilities-with-node-mysql",children:["Known incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"zeroFill"})," flag is ignored in type conversion.\nYou need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"DECIMAL"})," and ",(0,i.jsx)(n.code,{children:"NEWDECIMAL"})," types always returned as ",(0,i.jsx)(n.code,{children:"string"})," unless you pass this config option:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"{\n decimalNumbers: true,\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"This option could lose precision on the number as Javascript Number is a Float!"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"other-resources",children:"Other Resources"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/client-server-protocol.html",children:"Wire protocol documentation"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," - Most popular node.js mysql client library"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mariasql/",children:"node-mariasql"})," - Bindings to libmariasql. One of the fastest clients"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/Sannis/node-mysql-libmysqlclient",children:"node-libmysqlclient"})," - Bindings to libmysqlclient"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/siddontang/go-mysql",children:"go-mysql"})," - MySQL Go client (prepared statements, binlog protocol, server)"]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"benchmarks",children:"Benchmarks"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b",children:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"npm run benchmarks"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mysql-benchmarks",children:"node-mysql-benchmarks"})}),"\n",(0,i.jsxs)(n.li,{children:["try to run example ",(0,i.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/benchmarks",children:"benchmarks"})," on your system"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},4442:(e,n,s)=>{s.d(n,{V:()=>o});var i=s(5742),t=s(5893);const o=e=>{let{title:n}=e;return(0,t.jsx)(i.Z,{children:(0,t.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>r});var i=s(7294);const t={},o=i.createContext(t);function r(e){const n=i.useContext(o);return i.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(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/b07748b5.60633ba4.js b/pt-BR/assets/js/b07748b5.60633ba4.js deleted file mode 100644 index dedcc5558c..0000000000 --- a/pt-BR/assets/js/b07748b5.60633ba4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4403],{214:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>u,toc:()=>p});var r=s(5893),o=s(1151),l=s(4866),t=s(5162),c=s(6393),i=s(4379);const a={sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},d="createPoolCluster",u={id:"examples/connections/createPoolCluster",title:"createPoolCluster",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/createPoolCluster.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/createPoolCluster.mdx",tags:[{label:"createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/tags/create-pool-cluster"},{label:"URI",permalink:"/node-mysql2/pt-BR/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/pt-BR/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/pt-BR/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/pt-BR/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/pt-BR/docs/tags/socks"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createPool",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-pool"},next:{title:"Simple Queries",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/"}},h={},p=[{value:"add(group, connectionUri)",id:"addgroup-connectionuri",level:2},{value:"add(group, config)",id:"addgroup-config",level:2},{value:"add(group, config) \u2014 SHA1",id:"addgroup-config--sha1",level:2},{value:"add(group, config) \u2014 SSL",id:"addgroup-config--ssl",level:2},{value:"add(group, config) \u2014 RDS SSL",id:"addgroup-config--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"add(group, config) \u2014 Socks",id:"addgroup-config--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function g(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createpoolcluster",children:"createPoolCluster"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-connectionuri",children:"add(group, connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"add(group: string, connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config",children:"add(group, config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--sha1",children:"add(group, config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--ssl",children:"add(group, config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,r.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--rds-ssl",children:"add(group, config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await poolCluster.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(t.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n poolCluster.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--socks",children:"add(group, config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n stream: socksProxy,\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})}),(0,r.jsx)(t.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,r.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),"\n",(0,r.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})}),"\n"]}),"\n",(0,r.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var r=s(512);const o={tabItem:"tabItem_Ymn6"};var l=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>C});var r=s(7294),o=s(512),l=s(2466),t=s(6550),c=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:o}}=e;return{value:n,label:s,attributes:r,default:o}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:s}=e;const o=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(o.location.search);n.set(l,e),o.replace({...o.location,search:n.toString()})}),[l,o])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,l=h(e),[t,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[a,u]=g({queryString:s,groupId:o}),[m,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,l]=(0,d.Nk)(s);return[o,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:o}),j=(()=>{const e=a??m;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,l]),tabValues:l}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=c[s].value;o!==r&&(a(n),t(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:c.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...l,className:(0,o.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function C(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),o=s(2263),l=s(9286),t=s(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[g,m]=(0,r.useState)(!0),{siteConfig:x}=(0,o.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),o=`${s} ${n}`;let l=!1,t=0,c="";for(const i of r)if(i.includes(o)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;u(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:h?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:g?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),o=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,o.jsx)(r.Z,{open:s,className:"faq",summary:(0,o.jsx)("summary",{children:(0,o.jsx)("strong",{children:l})}),children:(0,o.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/b07748b5.ceab5c6c.js b/pt-BR/assets/js/b07748b5.ceab5c6c.js new file mode 100644 index 0000000000..44464d0dfc --- /dev/null +++ b/pt-BR/assets/js/b07748b5.ceab5c6c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4403],{214:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>u,toc:()=>p});var r=s(5893),o=s(1151),l=s(4866),t=s(5162),c=s(6393),i=s(4379);const a={sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},d="createPoolCluster",u={id:"examples/connections/createPoolCluster",title:"createPoolCluster",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/createPoolCluster.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/createPoolCluster.mdx",tags:[{label:"createPoolCluster",permalink:"/node-mysql2/pt-BR/docs/tags/create-pool-cluster"},{label:"URI",permalink:"/node-mysql2/pt-BR/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/pt-BR/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/pt-BR/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/pt-BR/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/pt-BR/docs/tags/socks"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createPool",permalink:"/node-mysql2/pt-BR/docs/examples/connections/create-pool"},next:{title:"Simple Queries",permalink:"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/"}},h={},p=[{value:"add(group, connectionUri)",id:"addgroup-connectionuri",level:2},{value:"add(group, config)",id:"addgroup-config",level:2},{value:"add(group, config) \u2014 SHA1",id:"addgroup-config--sha1",level:2},{value:"add(group, config) \u2014 SSL",id:"addgroup-config--ssl",level:2},{value:"add(group, config) \u2014 RDS SSL",id:"addgroup-config--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"add(group, config) \u2014 Socks",id:"addgroup-config--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function g(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createpoolcluster",children:"createPoolCluster"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-connectionuri",children:"add(group, connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"add(group: string, connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config",children:"add(group, config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--sha1",children:"add(group, config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--ssl",children:"add(group, config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,r.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--rds-ssl",children:"add(group, config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await poolCluster.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(t.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n poolCluster.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--socks",children:"add(group, config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n stream: socksProxy,\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})}),(0,r.jsx)(t.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,r.jsxs)("blockquote",{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,r.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),(0,r.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]}),"\n",(0,r.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var r=s(512);const o={tabItem:"tabItem_Ymn6"};var l=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>C});var r=s(7294),o=s(512),l=s(2466),t=s(6550),c=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:o}}=e;return{value:n,label:s,attributes:r,default:o}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:s}=e;const o=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(o.location.search);n.set(l,e),o.replace({...o.location,search:n.toString()})}),[l,o])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,l=h(e),[t,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[a,u]=g({queryString:s,groupId:o}),[m,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,l]=(0,d.Nk)(s);return[o,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:o}),j=(()=>{const e=a??m;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,l]),tabValues:l}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=c[s].value;o!==r&&(a(n),t(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:c.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...l,className:(0,o.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function C(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),o=s(2263),l=s(9286),t=s(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[g,m]=(0,r.useState)(!0),{siteConfig:x}=(0,o.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),o=`${s} ${n}`;let l=!1,t=0,c="";for(const i of r)if(i.includes(o)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;u(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:h?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:g?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),o=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,o.jsx)(r.Z,{open:s,className:"faq",summary:(0,o.jsx)("summary",{children:(0,o.jsx)("strong",{children:l})}),children:(0,o.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/b80d201b.d80a38d2.js b/pt-BR/assets/js/b80d201b.d80a38d2.js deleted file mode 100644 index 524150d1f7..0000000000 --- a/pt-BR/assets/js/b80d201b.d80a38d2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6061],{1384:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="UPDATE",d={id:"examples/queries/prepared-statements/update",title:"UPDATE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/update.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/update",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/update.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select"},next:{title:"DELETE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),g=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),j(e)}),[d,j,l]),tabValues:l}}var j=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:j}=(0,r.Z)(),g=j.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${g}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/b80d201b.d9733481.js b/pt-BR/assets/js/b80d201b.d9733481.js new file mode 100644 index 0000000000..ba917b0c56 --- /dev/null +++ b/pt-BR/assets/js/b80d201b.d9733481.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6061],{1384:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="UPDATE",d={id:"examples/queries/prepared-statements/update",title:"UPDATE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/update.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/update",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/update.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select"},next:{title:"DELETE",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),g=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),j(e)}),[d,j,l]),tabValues:l}}var j=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:j}=(0,r.Z)(),g=j.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${g}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/cdbda324.81a5c23b.js b/pt-BR/assets/js/cdbda324.81a5c23b.js deleted file mode 100644 index 4597ddcb8a..0000000000 --- a/pt-BR/assets/js/cdbda324.81a5c23b.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see cdbda324.81a5c23b.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4116],{1851:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>i,default:()=>g,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var s=r(5893),t=r(1151),o=r(6393),l=r(3901);const c={},i="How to handle errors?",a={id:"faq/how-to-handle-errors",title:"How to handle errors?",description:"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.",source:"@site/docs/faq/how-to-handle-errors.mdx",sourceDirName:"faq",slug:"/faq/how-to-handle-errors",permalink:"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/faq/how-to-handle-errors.mdx",tags:[],version:"current",frontMatter:{},sidebar:"faq",previous:{title:"Introduction",permalink:"/node-mysql2/pt-BR/docs/faq"}},h={},d=[{value:"Using callbacks",id:"using-callbacks",level:2},{value:"Using promises",id:"using-promises",level:2},{value:"Related Links",id:"related-links",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"how-to-handle-errors",children:"How to handle errors?"}),"\n",(0,s.jsxs)(n.p,{children:["This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"}),", ",(0,s.jsx)(n.code,{children:"createPoolCluster"}),", ",(0,s.jsx)(n.code,{children:"execute"})," and ",(0,s.jsx)(n.code,{children:"query"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"using-callbacks",children:"Using callbacks"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsx)(n.p,{children:"Handling connection errors by adding an error event listener:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconnection = mysql.createConnection({\n host: '',\n user: '',\n database: '',\n});\n\n// highlight-start\nconnection.addListener('error', (err) => {\n if (err instanceof Error) {\n console.log(`createConnection error:`, err);\n }\n});\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\npool.getConnection((err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('pool.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\npoolCluster.getConnection('NodeI', (err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('poolCluster.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.execute('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('execute error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.query('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('query error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.h2,{id:"using-promises",children:"Using promises"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n const connection = await mysql.createConnection({\n host: '',\n user: '',\n database: '',\n });\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n const connection = await pool.getConnection();\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n await poolCluster.getConnection('NodeI');\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('createConnection error:', err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.execute('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('execute error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.query('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('query error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Discussions","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/1998",children:"#1998"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/2282",children:"#2282"})}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},4673:(e,n,r)=>{r.d(n,{Z:()=>x});var s=r(7294),t=r(512),o=r(2389),l=r(6043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var i=r(5893);function a(e){return!!e&&("SUMMARY"===e.tagName||a(e.parentElement))}function h(e,n){return!!e&&(e===n||h(e.parentElement,n))}function d(e){let{summary:n,children:r,...d}=e;const u=(0,o.Z)(),g=(0,s.useRef)(null),{collapsed:x,setCollapsed:j}=(0,l.u)({initialState:!d.open}),[p,m]=(0,s.useState)(d.open),y=s.isValidElement(n)?n:(0,i.jsx)("summary",{children:n??"Details"});return(0,i.jsxs)("details",{...d,ref:g,open:p,"data-collapsed":x,className:(0,t.Z)(c.details,u&&c.isBrowser,d.className),onMouseDown:e=>{a(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;a(n)&&h(n,g.current)&&(e.preventDefault(),x?(j(!1),m(!0)):j(!0))},children:[y,(0,i.jsx)(l.z,{lazy:!1,collapsed:x,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),m(!e)},children:(0,i.jsx)("div",{className:c.collapsibleContent,children:r})})]})}const u={details:"details_b_Ee"},g="alert alert--info";function x(e){let{...n}=e;return(0,i.jsx)(d,{...n,className:(0,t.Z)(g,u.details,n.className)})}},6393:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(4673),t=r(5893);const o=e=>{let{children:n,open:r,title:o}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}},3901:(e,n,r)=>{r.d(n,{X:()=>u});var s=r(3692),t=r(4297);const o=(0,t.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,t.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),c=(0,t.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),i=(0,t.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,t.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),h=(0,t.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var d=r(5893);const u=e=>{let{level:n,message:r}=e;const t={0:{title:"Deprecated",icon:(0,d.jsx)(o,{})},1:{title:"Experimental",icon:(0,d.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,d.jsx)(c,{})},1.2:{title:"Release Candidate",icon:(0,d.jsx)(i,{})},2:{title:"Stable",icon:(0,d.jsx)(a,{})},3:{title:"Legacy",icon:(0,d.jsx)(h,{})}};return(0,d.jsxs)("section",{className:"stability","data-level":n,children:[(0,d.jsx)(s.Z,{to:"/docs/stability-badges",children:(0,d.jsxs)("header",{children:[(0,d.jsx)("strong",{children:n}),(0,d.jsx)("span",{children:t[n].title}),t[n].icon]})}),r?(0,d.jsx)("p",{children:r}):null]})}},4297:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(7294),t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const o=(e,n)=>{const r=(0,s.forwardRef)((({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:i="",children:a,...h},d)=>{return(0,s.createElement)("svg",{ref:d,...t,width:o,height:o,stroke:r,strokeWidth:c?24*Number(l)/Number(o):l,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...h},[...n.map((([e,n])=>(0,s.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var u}));return r.displayName=`${e}`,r}},1151:(e,n,r)=>{r.d(n,{Z:()=>c,a:()=>l});var s=r(7294);const t={},o=s.createContext(t);function l(e){const n=s.useContext(o);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:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/cdbda324.ee8a7042.js b/pt-BR/assets/js/cdbda324.ee8a7042.js new file mode 100644 index 0000000000..487816ce68 --- /dev/null +++ b/pt-BR/assets/js/cdbda324.ee8a7042.js @@ -0,0 +1,2 @@ +/*! For license information please see cdbda324.ee8a7042.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4116],{1851:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>i,default:()=>g,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var s=r(5893),t=r(1151),o=r(6393),l=r(3901);const c={},i="How to handle errors?",a={id:"faq/how-to-handle-errors",title:"How to handle errors?",description:"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.",source:"@site/docs/faq/how-to-handle-errors.mdx",sourceDirName:"faq",slug:"/faq/how-to-handle-errors",permalink:"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/faq/how-to-handle-errors.mdx",tags:[],version:"current",frontMatter:{},sidebar:"faq",previous:{title:"Introduction",permalink:"/node-mysql2/pt-BR/docs/faq"}},h={},d=[{value:"Using callbacks",id:"using-callbacks",level:2},{value:"Using promises",id:"using-promises",level:2},{value:"Related Links",id:"related-links",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"how-to-handle-errors",children:"How to handle errors?"}),"\n",(0,s.jsxs)(n.p,{children:["This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"}),", ",(0,s.jsx)(n.code,{children:"createPoolCluster"}),", ",(0,s.jsx)(n.code,{children:"execute"})," and ",(0,s.jsx)(n.code,{children:"query"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"using-callbacks",children:"Using callbacks"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsx)(n.p,{children:"Handling connection errors by adding an error event listener:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconnection = mysql.createConnection({\n host: '',\n user: '',\n database: '',\n});\n\n// highlight-start\nconnection.addListener('error', (err) => {\n if (err instanceof Error) {\n console.log(`createConnection error:`, err);\n }\n});\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\npool.getConnection((err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('pool.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\npoolCluster.getConnection('NodeI', (err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('poolCluster.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.execute('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('execute error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.query('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('query error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.h2,{id:"using-promises",children:"Using promises"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n const connection = await mysql.createConnection({\n host: '',\n user: '',\n database: '',\n });\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n const connection = await pool.getConnection();\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n await poolCluster.getConnection('NodeI');\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('createConnection error:', err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.execute('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('execute error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.query('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('query error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Discussions","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/1998",children:"#1998"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/2282",children:"#2282"})}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},4673:(e,n,r)=>{r.d(n,{Z:()=>x});var s=r(7294),t=r(512),o=r(2389),l=r(6043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var i=r(5893);function a(e){return!!e&&("SUMMARY"===e.tagName||a(e.parentElement))}function h(e,n){return!!e&&(e===n||h(e.parentElement,n))}function d(e){let{summary:n,children:r,...d}=e;const u=(0,o.Z)(),g=(0,s.useRef)(null),{collapsed:x,setCollapsed:j}=(0,l.u)({initialState:!d.open}),[p,m]=(0,s.useState)(d.open),y=s.isValidElement(n)?n:(0,i.jsx)("summary",{children:n??"Details"});return(0,i.jsxs)("details",{...d,ref:g,open:p,"data-collapsed":x,className:(0,t.Z)(c.details,u&&c.isBrowser,d.className),onMouseDown:e=>{a(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;a(n)&&h(n,g.current)&&(e.preventDefault(),x?(j(!1),m(!0)):j(!0))},children:[y,(0,i.jsx)(l.z,{lazy:!1,collapsed:x,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),m(!e)},children:(0,i.jsx)("div",{className:c.collapsibleContent,children:r})})]})}const u={details:"details_b_Ee"},g="alert alert--info";function x(e){let{...n}=e;return(0,i.jsx)(d,{...n,className:(0,t.Z)(g,u.details,n.className)})}},6393:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(4673),t=r(5893);const o=e=>{let{children:n,open:r,title:o}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}},3901:(e,n,r)=>{r.d(n,{X:()=>u});var s=r(3692),t=r(4297);const o=(0,t.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,t.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),c=(0,t.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),i=(0,t.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,t.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),h=(0,t.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var d=r(5893);const u=e=>{let{level:n,message:r}=e;const t={0:{title:"Deprecated",icon:(0,d.jsx)(o,{})},1:{title:"Experimental",icon:(0,d.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,d.jsx)(c,{})},1.2:{title:"Release Candidate",icon:(0,d.jsx)(i,{})},2:{title:"Stable",icon:(0,d.jsx)(a,{})},3:{title:"Legacy",icon:(0,d.jsx)(h,{})}};return(0,d.jsxs)("section",{className:"stability","data-level":n,children:[(0,d.jsx)(s.Z,{to:"/docs/stability-badges",children:(0,d.jsxs)("header",{children:[(0,d.jsx)("strong",{children:n}),(0,d.jsx)("span",{children:t[n].title}),t[n].icon]})}),r?(0,d.jsx)("p",{children:r}):null]})}},4297:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(7294),t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const o=(e,n)=>{const r=(0,s.forwardRef)((({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:i="",children:a,...h},d)=>{return(0,s.createElement)("svg",{ref:d,...t,width:o,height:o,stroke:r,strokeWidth:c?24*Number(l)/Number(o):l,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...h},[...n.map((([e,n])=>(0,s.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var u}));return r.displayName=`${e}`,r}},1151:(e,n,r)=>{r.d(n,{Z:()=>c,a:()=>l});var s=r(7294);const t={},o=s.createContext(t);function l(e){const n=s.useContext(o);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:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/cdbda324.81a5c23b.js.LICENSE.txt b/pt-BR/assets/js/cdbda324.ee8a7042.js.LICENSE.txt similarity index 100% rename from pt-BR/assets/js/cdbda324.81a5c23b.js.LICENSE.txt rename to pt-BR/assets/js/cdbda324.ee8a7042.js.LICENSE.txt diff --git a/pt-BR/assets/js/db044f71.55ce7385.js b/pt-BR/assets/js/db044f71.55ce7385.js new file mode 100644 index 0000000000..753c933e23 --- /dev/null +++ b/pt-BR/assets/js/db044f71.55ce7385.js @@ -0,0 +1,2 @@ +/*! For license information please see db044f71.55ce7385.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6159],{8009:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>r,metadata:()=>l,toc:()=>d});var a=s(5893),i=s(1151),n=s(3901);const r={},o="Stability Badges",l={id:"stability-badges",title:"Stability Badges",description:"The Stability Badges are indications of a section's stability.",source:"@site/docs/stability-badges.mdx",sourceDirName:".",slug:"/stability-badges",permalink:"/node-mysql2/pt-BR/docs/stability-badges",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/stability-badges.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Hist\xf3ria e Porque o MySQL2",permalink:"/node-mysql2/pt-BR/docs/history-and-why-mysq2"},next:{title:"Introduction",permalink:"/node-mysql2/pt-BR/docs/documentation"}},c={},d=[];function h(e){const t={blockquote:"blockquote",h1:"h1",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"stability-badges",children:"Stability Badges"}),"\n",(0,a.jsxs)(t.p,{children:["The ",(0,a.jsx)(t.strong,{children:"Stability Badges"})," are indications of a section's stability."]}),"\n",(0,a.jsx)(t.p,{children:"The stability indices are as follows:"}),"\n",(0,a.jsx)(n.X,{level:0,message:"The feature might generate warnings and does not assure backward compatibility."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.strong,{children:"Experimental"}),": These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged."]}),"\n",(0,a.jsxs)(t.blockquote,{children:["\n",(0,a.jsx)(t.p,{children:"Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features."}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"Experimental features are classified into stages:"}),"\n",(0,a.jsx)(n.X,{level:1,message:"Experimental features at this stage are currently in development and prone to considerable changes."}),"\n",(0,a.jsx)(n.X,{level:1.1,message:"Experimental features at this stage are approaching minimum viability."}),"\n",(0,a.jsx)(n.X,{level:1.2,message:"Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsx)(n.X,{level:2,message:"Compatibility with the MySQL ecosystem is a high priority."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsx)(n.X,{level:3,message:"This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available."}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed."}),"\n"]})]})}function p(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},3901:(e,t,s)=>{s.d(t,{X:()=>p});var a=s(3692),i=s(4297);const n=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),r=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),l=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),c=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const p=e=>{let{level:t,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(n,{})},1:{title:"Experimental",icon:(0,h.jsx)(r,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(l,{})},2:{title:"Stable",icon:(0,h.jsx)(c,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":t,children:[(0,h.jsx)(a.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:t}),(0,h.jsx)("span",{children:i[t].title}),i[t].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const n=(e,t)=>{const s=(0,a.forwardRef)((({color:s="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>{return(0,a.createElement)("svg",{ref:h,...i,width:n,height:n,stroke:s,strokeWidth:o?24*Number(r)/Number(n):r,className:["lucide",`lucide-${p=e,p.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,l].join(" "),...d},[...t.map((([e,t])=>(0,a.createElement)(e,t))),...Array.isArray(c)?c:[c]]);var p}));return s.displayName=`${e}`,s}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>r});var a=s(7294);const i={},n=a.createContext(i);function r(e){const t=a.useContext(n);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/db044f71.8b33f69d.js.LICENSE.txt b/pt-BR/assets/js/db044f71.55ce7385.js.LICENSE.txt similarity index 100% rename from pt-BR/assets/js/db044f71.8b33f69d.js.LICENSE.txt rename to pt-BR/assets/js/db044f71.55ce7385.js.LICENSE.txt diff --git a/pt-BR/assets/js/db044f71.8b33f69d.js b/pt-BR/assets/js/db044f71.8b33f69d.js deleted file mode 100644 index b92c34bf83..0000000000 --- a/pt-BR/assets/js/db044f71.8b33f69d.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see db044f71.8b33f69d.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6159],{8009:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>r,metadata:()=>l,toc:()=>d});var a=s(5893),i=s(1151),n=s(3901);const r={},o="Stability Badges",l={id:"stability-badges",title:"Stability Badges",description:"The Stability Badges are indications of a section's stability.",source:"@site/docs/stability-badges.mdx",sourceDirName:".",slug:"/stability-badges",permalink:"/node-mysql2/pt-BR/docs/stability-badges",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/stability-badges.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Hist\xf3ria e Porque o MySQL2",permalink:"/node-mysql2/pt-BR/docs/history-and-why-mysq2"},next:{title:"Introduction",permalink:"/node-mysql2/pt-BR/docs/documentation"}},c={},d=[];function h(e){const t={blockquote:"blockquote",h1:"h1",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"stability-badges",children:"Stability Badges"}),"\n",(0,a.jsxs)(t.p,{children:["The ",(0,a.jsx)(t.strong,{children:"Stability Badges"})," are indications of a section's stability."]}),"\n",(0,a.jsx)(t.p,{children:"The stability indices are as follows:"}),"\n",(0,a.jsx)(n.X,{level:0,message:"The feature might generate warnings and does not assure backward compatibility."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.strong,{children:"Experimental"}),": These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged."]}),"\n",(0,a.jsxs)(t.blockquote,{children:["\n",(0,a.jsx)(t.p,{children:"Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features."}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"Experimental features are classified into stages:"}),"\n",(0,a.jsx)(n.X,{level:1,message:"Experimental features at this stage are currently in development and prone to considerable changes."}),"\n",(0,a.jsx)(n.X,{level:1.1,message:"Experimental features at this stage are approaching minimum viability."}),"\n",(0,a.jsx)(n.X,{level:1.2,message:"Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsx)(n.X,{level:2,message:"Compatibility with the MySQL ecosystem is a high priority."}),"\n",(0,a.jsx)(t.hr,{}),"\n",(0,a.jsx)(n.X,{level:3,message:"This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available."}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed."}),"\n"]})]})}function p(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},3901:(e,t,s)=>{s.d(t,{X:()=>p});var a=s(3692),i=s(4297);const n=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),r=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),l=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),c=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const p=e=>{let{level:t,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(n,{})},1:{title:"Experimental",icon:(0,h.jsx)(r,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(l,{})},2:{title:"Stable",icon:(0,h.jsx)(c,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":t,children:[(0,h.jsx)(a.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:t}),(0,h.jsx)("span",{children:i[t].title}),i[t].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const n=(e,t)=>{const s=(0,a.forwardRef)((({color:s="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>{return(0,a.createElement)("svg",{ref:h,...i,width:n,height:n,stroke:s,strokeWidth:o?24*Number(r)/Number(n):r,className:["lucide",`lucide-${p=e,p.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,l].join(" "),...d},[...t.map((([e,t])=>(0,a.createElement)(e,t))),...Array.isArray(c)?c:[c]]);var p}));return s.displayName=`${e}`,s}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>r});var a=s(7294);const i={},n=a.createContext(i);function r(e){const t=a.useContext(n);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/e19cd79a.094a2d6c.js b/pt-BR/assets/js/e19cd79a.094a2d6c.js deleted file mode 100644 index 3751f313fe..0000000000 --- a/pt-BR/assets/js/e19cd79a.094a2d6c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1429],{2998:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="INSERT",d={id:"examples/queries/prepared-statements/insert",title:"INSERT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/insert.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/insert",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/insert.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:0,frontMatter:{sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/"},next:{title:"SELECT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"insert",children:"INSERT"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/e19cd79a.2afeaaa9.js b/pt-BR/assets/js/e19cd79a.2afeaaa9.js new file mode 100644 index 0000000000..0ad0203fdf --- /dev/null +++ b/pt-BR/assets/js/e19cd79a.2afeaaa9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1429],{2998:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="INSERT",d={id:"examples/queries/prepared-statements/insert",title:"INSERT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/insert.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/insert",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/insert.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/pt-BR/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/pt-BR/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/pt-BR/docs/tags/execute"}],version:"current",sidebarPosition:0,frontMatter:{sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"Prepared Statements",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/"},next:{title:"SELECT",permalink:"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"insert",children:"INSERT"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/f8d74a12.08a82446.js b/pt-BR/assets/js/f8d74a12.08a82446.js new file mode 100644 index 0000000000..1cc8590a51 --- /dev/null +++ b/pt-BR/assets/js/f8d74a12.08a82446.js @@ -0,0 +1,2 @@ +/*! For license information please see f8d74a12.08a82446.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5807],{7330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>x,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>h,toc:()=>m});var t=s(5893),i=s(1151),r=s(6393),l=s(8609),o=s(3901),c=s(4379);const a={title:"Documentation Site"},d="Website Contributing Guidelines",h={id:"contributing/website",title:"Documentation Site",description:"This website is built using Docusaurus 3, a modern static website generator.",source:"@site/docs/contributing/website.mdx",sourceDirName:"contributing",slug:"/contributing/website",permalink:"/node-mysql2/pt-BR/docs/contributing/website",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/contributing/website.mdx",tags:[],version:"current",frontMatter:{title:"Documentation Site"},sidebar:"docs",previous:{title:"MySQL2",permalink:"/node-mysql2/pt-BR/docs/contributing"}},x={},m=[{value:"Environment",id:"environment",level:2},{value:"Development",id:"development",level:2},{value:"Extras Components",id:"extras-components",level:2},{value:"History",id:"history",level:3},{value:"Stability",id:"stability",level:3},{value:"FAQ",id:"faq",level:3},{value:"ExternalCodeEmbed",id:"externalcodeembed",level:3},{value:"Running Tests",id:"running-tests",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"website-contributing-guidelines",children:"Website Contributing Guidelines"}),"\n",(0,t.jsxs)(n.p,{children:["This website is built using ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/",children:"Docusaurus 3"}),", a modern static website generator."]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"environment",children:"Environment"}),"\n",(0,t.jsx)(n.p,{children:"You will need these tools installed on your system:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://nodejs.org/",children:"Node.js (18.x or higher)"})}),"\n"]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"development",children:"Development"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Fork the ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2",children:"MySQL2"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Download your forked repository locally. The website's workspace is the \"",(0,t.jsx)(n.em,{children:"website"}),'" directory in ',(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new branch from ",(0,t.jsx)(n.code,{children:"master"})," (optional)."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"cd website"})," to enter the website workspace."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm ci"})," to install the dependecies from ",(0,t.jsx)(n.em,{children:"package-lock.json"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm start"})," to starting the local development."]}),"\n"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server."}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.strong,{children:"Docusaurus"})," complete documentation, please ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs",children:"see here"}),"."]}),"\n",(0,t.jsx)(r.Z,{title:"CLI example",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/sidorares/node-mysql2.git\ngit checkout -b website # optional\ncd /path-to/node-mysql2/website\nnpm ci\nnpm start\n"})})}),"\n",(0,t.jsxs)(n.p,{children:["Documentation is auto-generated from ",(0,t.jsx)(n.strong,{children:"MDX"})," files placed in these directories:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/documentation"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/examples"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/faq"})}),"\n"]}),"\n",(0,t.jsxs)(n.admonition,{title:"Caution",type:"danger",children:[(0,t.jsxs)(n.p,{children:["Note that the website has its own ",(0,t.jsx)(n.em,{children:"package.json"}),"."]}),(0,t.jsxs)(n.p,{children:["Please, do not install dependencies for the website in ",(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"extras-components",children:"Extras Components"}),"\n",(0,t.jsx)(n.p,{children:"Every extra component is thoroughly documented with complete typings descriptions."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs/markdown-features",children:(0,t.jsx)(n.strong,{children:"Docusaurus Markdown Features:"})})," The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"history",children:"History"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"History"})," component displays version changes in a table format, listing version numbers alongside their changes."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { History } from '@site/src/components/History';\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"changes"})," option."]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(l.A,{records:[{version:"1.0.0",changes:["Some change message."]}]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"stability",children:"Stability"}),"\n",(0,t.jsxs)(n.p,{children:["See the ",(0,t.jsx)(n.a,{href:"/docs/stability-badges",children:"Stability Badges"})," for more detais."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { Stability } from '@site/src/components/Stability';\n\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"message"})," option."]})}),"\n",(0,t.jsxs)(n.p,{children:["Available levels: ",(0,t.jsx)(n.code,{children:"0"}),", ",(0,t.jsx)(n.code,{children:"1"}),", ",(0,t.jsx)(n.code,{children:"1.1"}),", ",(0,t.jsx)(n.code,{children:"1.2"}),", ",(0,t.jsx)(n.code,{children:"2"})," and ",(0,t.jsx)(n.code,{children:"3"}),"."]}),"\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(o.X,{level:2}),(0,t.jsx)(o.X,{level:2,message:"Some message."})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"faq",children:"FAQ"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { FAQ } from '@site/src/components/FAQ';\n\n\n\n > Some markdown (**MDX**) content.\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.strong,{children:"FAQ"})," component can be utilized in any section or page."]}),"\n",(0,t.jsxs)(n.li,{children:["Code blocks are compatible and can be used within the ",(0,t.jsx)(n.strong,{children:"FAQ"})," component."]}),"\n"]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(r.Z,{title:"Title",children:(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["Some markdown (",(0,t.jsx)(n.strong,{children:"MDX"}),") content."]}),"\n"]})})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"externalcodeembed",children:"ExternalCodeEmbed"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed';\n\n\n\n\n"})}),"\n","\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/.prettierrc",language:"json"}),(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/tools/parse-row.js",language:"js",extractMethod:"parseC",methodType:"function"})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"running-tests",children:"Running Tests"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run test\n"})}),"\n",(0,t.jsxs)(r.Z,{title:"Check Prettier and ESLint rules for compliance",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lintcheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Check for typings errors",children:[(0,t.jsx)(o.X,{level:1,message:(0,t.jsxs)(t.Fragment,{children:["Checks for ",(0,t.jsx)(n.strong,{children:"MDX"})," components are missing."]})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run typecheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Clear and build the website",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run clear\nnpm run build\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Fix issues from Prettier and ESLint rules",open:!0,children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lint\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"To prevent lint issues, it is recommended to execute this command before creating your commit."}),"\n",(0,t.jsxs)(n.li,{children:["Not included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),i=s(2263),r=s(9286),l=s(5893);const o=()=>(0,l.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:a}=e;const[d,h]=(0,t.useState)(""),[x,m]=(0,t.useState)(!0),[u,p]=(0,t.useState)(!0),{siteConfig:j}=(0,i.Z)(),g=j.baseUrl.replace(/\/$/,""),b=/^\//.test(n)?`${g}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(b,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&a?((e,n,s)=>{const t=e.split("\n"),i=`${s} ${n}`;let r=!1,l=0,o="";for(const c of t)if(c.includes(i)&&(r=!0),r&&(c.includes("{")&&l++,o+=c+"\n",c.includes("}")&&(l--,0===l)))break;return o.trim()||e})(e,c,a):e;h(n||e),m(!1),p(!1)})).catch((()=>{p(!0),m(!1)})),()=>{e.abort()}}),[b,c,a]),(0,l.jsx)(l.Fragment,{children:x?(0,l.jsx)(o,{}):(0,l.jsx)(l.Fragment,{children:u?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:b}),". Please verify the link or try again later."]}):(0,l.jsx)(r.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(4673),i=s(5893);const r=e=>{let{children:n,open:s,title:r}=e;return(0,i.jsx)(t.Z,{open:s,className:"faq",summary:(0,i.jsx)("summary",{children:(0,i.jsx)("strong",{children:r})}),children:(0,i.jsx)("section",{children:n})})}},8609:(e,n,s)=>{s.d(n,{A:()=>l});var t=s(4673);const i=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var r=s(5893);const l=e=>{let{records:n,open:s}=e;return(0,r.jsx)(t.Z,{open:s,summary:(0,r.jsxs)("summary",{children:[(0,r.jsx)(i,{})," History"]}),className:"history",children:(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Version"}),(0,r.jsx)("th",{children:"Changes"})]})}),(0,r.jsx)("tbody",{children:n.map(((e,n)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,r.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>x});var t=s(3692),i=s(4297);const r=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),c=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const x=e=>{let{level:n,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(r,{})},1:{title:"Experimental",icon:(0,h.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(c,{})},2:{title:"Stable",icon:(0,h.jsx)(a,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:i[n].title}),i[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:a,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...i,width:r,height:r,stroke:s,strokeWidth:o?24*Number(l)/Number(r):l,className:["lucide",`lucide-${x=e,x.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,c].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var x}));return s.displayName=`${e}`,s}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/f8d74a12.a66d492d.js.LICENSE.txt b/pt-BR/assets/js/f8d74a12.08a82446.js.LICENSE.txt similarity index 100% rename from pt-BR/assets/js/f8d74a12.a66d492d.js.LICENSE.txt rename to pt-BR/assets/js/f8d74a12.08a82446.js.LICENSE.txt diff --git a/pt-BR/assets/js/f8d74a12.a66d492d.js b/pt-BR/assets/js/f8d74a12.a66d492d.js deleted file mode 100644 index 84ce9d58a5..0000000000 --- a/pt-BR/assets/js/f8d74a12.a66d492d.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see f8d74a12.a66d492d.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5807],{7330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>x,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>h,toc:()=>m});var t=s(5893),i=s(1151),r=s(6393),l=s(8609),o=s(3901),c=s(4379);const a={title:"Documentation Site"},d="Website Contributing Guidelines",h={id:"contributing/website",title:"Documentation Site",description:"This website is built using Docusaurus 3, a modern static website generator.",source:"@site/docs/contributing/website.mdx",sourceDirName:"contributing",slug:"/contributing/website",permalink:"/node-mysql2/pt-BR/docs/contributing/website",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/contributing/website.mdx",tags:[],version:"current",frontMatter:{title:"Documentation Site"},sidebar:"docs",previous:{title:"MySQL2",permalink:"/node-mysql2/pt-BR/docs/contributing"}},x={},m=[{value:"Environment",id:"environment",level:2},{value:"Development",id:"development",level:2},{value:"Extras Components",id:"extras-components",level:2},{value:"History",id:"history",level:3},{value:"Stability",id:"stability",level:3},{value:"FAQ",id:"faq",level:3},{value:"ExternalCodeEmbed",id:"externalcodeembed",level:3},{value:"Running Tests",id:"running-tests",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"website-contributing-guidelines",children:"Website Contributing Guidelines"}),"\n",(0,t.jsxs)(n.p,{children:["This website is built using ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/",children:"Docusaurus 3"}),", a modern static website generator."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"environment",children:"Environment"}),"\n",(0,t.jsx)(n.p,{children:"You will need these tools installed on your system:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://nodejs.org/",children:"Node.js (18.x or higher)"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"development",children:"Development"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Fork the ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2",children:"MySQL2"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Download your forked repository locally. The website's workspace is the \"",(0,t.jsx)(n.em,{children:"website"}),'" directory in ',(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new branch from ",(0,t.jsx)(n.code,{children:"master"})," (optional)."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"cd website"})," to enter the website workspace."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm ci"})," to install the dependecies from ",(0,t.jsx)(n.em,{children:"package-lock.json"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm start"})," to starting the local development."]}),"\n"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server."}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.strong,{children:"Docusaurus"})," complete documentation, please ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs",children:"see here"}),"."]}),"\n",(0,t.jsx)(r.Z,{title:"CLI example",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/sidorares/node-mysql2.git\ngit checkout -b website # optional\ncd /path-to/node-mysql2/website\nnpm ci\nnpm start\n"})})}),"\n",(0,t.jsxs)(n.p,{children:["Documentation is auto-generated from ",(0,t.jsx)(n.strong,{children:"MDX"})," files placed in these directories:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/documentation"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/examples"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/faq"})}),"\n"]}),"\n",(0,t.jsxs)(n.admonition,{title:"Caution",type:"danger",children:[(0,t.jsxs)(n.p,{children:["Note that the website has its own ",(0,t.jsx)(n.em,{children:"package.json"}),"."]}),(0,t.jsxs)(n.p,{children:["Please, do not install dependencies for the website in ",(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"extras-components",children:"Extras Components"}),"\n",(0,t.jsx)(n.p,{children:"Every extra component is thoroughly documented with complete typings descriptions."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs/markdown-features",children:(0,t.jsx)(n.strong,{children:"Docusaurus Markdown Features:"})})," The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"history",children:"History"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"History"})," component displays version changes in a table format, listing version numbers alongside their changes."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { History } from '@site/src/components/History';\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"changes"})," option."]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(l.A,{records:[{version:"1.0.0",changes:["Some change message."]}]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"stability",children:"Stability"}),"\n",(0,t.jsxs)(n.p,{children:["See the ",(0,t.jsx)(n.a,{href:"/docs/stability-badges",children:"Stability Badges"})," for more detais."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { Stability } from '@site/src/components/Stability';\n\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"message"})," option."]})}),"\n",(0,t.jsxs)(n.p,{children:["Available levels: ",(0,t.jsx)(n.code,{children:"0"}),", ",(0,t.jsx)(n.code,{children:"1"}),", ",(0,t.jsx)(n.code,{children:"1.1"}),", ",(0,t.jsx)(n.code,{children:"1.2"}),", ",(0,t.jsx)(n.code,{children:"2"})," and ",(0,t.jsx)(n.code,{children:"3"}),"."]}),"\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(o.X,{level:2}),(0,t.jsx)(o.X,{level:2,message:"Some message."})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"faq",children:"FAQ"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { FAQ } from '@site/src/components/FAQ';\n\n\n\n > Some markdown (**MDX**) content.\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.strong,{children:"FAQ"})," component can be utilized in any section or page."]}),"\n",(0,t.jsxs)(n.li,{children:["Code blocks are compatible and can be used within the ",(0,t.jsx)(n.strong,{children:"FAQ"})," component."]}),"\n"]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(r.Z,{title:"Title",children:(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["Some markdown (",(0,t.jsx)(n.strong,{children:"MDX"}),") content."]}),"\n"]})})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"externalcodeembed",children:"ExternalCodeEmbed"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed';\n\n\n\n\n"})}),"\n","\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/.prettierrc",language:"json"}),(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/tools/parse-row.js",language:"js",extractMethod:"parseC",methodType:"function"})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"running-tests",children:"Running Tests"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run test\n"})}),"\n",(0,t.jsxs)(r.Z,{title:"Check Prettier and ESLint rules for compliance",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lintcheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Check for typings errors",children:[(0,t.jsx)(o.X,{level:1,message:(0,t.jsxs)(t.Fragment,{children:["Checks for ",(0,t.jsx)(n.strong,{children:"MDX"})," components are missing."]})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run typecheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Clear and build the website",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run clear\nnpm run build\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Fix issues from Prettier and ESLint rules",open:!0,children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lint\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"To prevent lint issues, it is recommended to execute this command before creating your commit."}),"\n",(0,t.jsxs)(n.li,{children:["Not included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),i=s(2263),r=s(9286),l=s(5893);const o=()=>(0,l.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:a}=e;const[d,h]=(0,t.useState)(""),[x,m]=(0,t.useState)(!0),[u,p]=(0,t.useState)(!0),{siteConfig:j}=(0,i.Z)(),g=j.baseUrl.replace(/\/$/,""),b=/^\//.test(n)?`${g}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(b,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&a?((e,n,s)=>{const t=e.split("\n"),i=`${s} ${n}`;let r=!1,l=0,o="";for(const c of t)if(c.includes(i)&&(r=!0),r&&(c.includes("{")&&l++,o+=c+"\n",c.includes("}")&&(l--,0===l)))break;return o.trim()||e})(e,c,a):e;h(n||e),m(!1),p(!1)})).catch((()=>{p(!0),m(!1)})),()=>{e.abort()}}),[b,c,a]),(0,l.jsx)(l.Fragment,{children:x?(0,l.jsx)(o,{}):(0,l.jsx)(l.Fragment,{children:u?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:b}),". Please verify the link or try again later."]}):(0,l.jsx)(r.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(4673),i=s(5893);const r=e=>{let{children:n,open:s,title:r}=e;return(0,i.jsx)(t.Z,{open:s,className:"faq",summary:(0,i.jsx)("summary",{children:(0,i.jsx)("strong",{children:r})}),children:(0,i.jsx)("section",{children:n})})}},8609:(e,n,s)=>{s.d(n,{A:()=>l});var t=s(4673);const i=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var r=s(5893);const l=e=>{let{records:n,open:s}=e;return(0,r.jsx)(t.Z,{open:s,summary:(0,r.jsxs)("summary",{children:[(0,r.jsx)(i,{})," History"]}),className:"history",children:(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Version"}),(0,r.jsx)("th",{children:"Changes"})]})}),(0,r.jsx)("tbody",{children:n.map(((e,n)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,r.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>x});var t=s(3692),i=s(4297);const r=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),c=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const x=e=>{let{level:n,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(r,{})},1:{title:"Experimental",icon:(0,h.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(c,{})},2:{title:"Stable",icon:(0,h.jsx)(a,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:i[n].title}),i[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:a,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...i,width:r,height:r,stroke:s,strokeWidth:o?24*Number(l)/Number(r):l,className:["lucide",`lucide-${x=e,x.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,c].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var x}));return s.displayName=`${e}`,s}}}]); \ No newline at end of file diff --git a/pt-BR/assets/js/runtime~main.6adf88a8.js b/pt-BR/assets/js/runtime~main.2ad1f21b.js similarity index 85% rename from pt-BR/assets/js/runtime~main.6adf88a8.js rename to pt-BR/assets/js/runtime~main.2ad1f21b.js index f457c39806..c704c6a84b 100644 --- a/pt-BR/assets/js/runtime~main.6adf88a8.js +++ b/pt-BR/assets/js/runtime~main.2ad1f21b.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,f,b,t={},d={};function r(e){var a=d[e];if(void 0!==a)return a.exports;var c=d[e]={exports:{}};return t[e].call(c.exports,c,c.exports,r),c.exports}r.m=t,e=[],r.O=(a,c,f,b)=>{if(!c){var t=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(d=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,f,b]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var t={};a=a||[null,c({}),c([]),c(c)];for(var d=2&f&&e;"object"==typeof d&&!~a.indexOf(d);d=c(d))Object.getOwnPropertyNames(d).forEach((a=>t[a]=()=>e[a]));return t.default=()=>e,r.d(b,t),b},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",81:"8fcb4d7f",384:"1cee01a7",452:"a55c4658",556:"22161331",576:"54768732",630:"f54f1246",641:"59e52bc2",881:"b814814f",1233:"c84c75a7",1420:"54eaaaae",1429:"e19cd79a",1437:"bc31cbdb",1465:"fb880757",1649:"464e933c",1990:"b5d213ed",2030:"ad7b17cf",2155:"940eccaa",2242:"ac9dff0b",2496:"13833ed5",2839:"2bc14e22",2991:"ed06a4b6",3213:"e951ea44",3237:"1df93b7f",3433:"76dfa484",3561:"5814edec",3586:"4e92b6b6",3699:"d04b867d",3751:"3720c009",3776:"f76f5ab7",4116:"cdbda324",4121:"55960ee5",4368:"a94703ab",4403:"b07748b5",4503:"9318259a",4819:"f08329ad",5003:"57495183",5072:"0e27d5d9",5575:"7c434f9a",5807:"f8d74a12",5909:"f43af5ae",6061:"b80d201b",6159:"db044f71",6879:"406c6f1b",7182:"4098ceee",7341:"40c51f74",7342:"68f13ba5",7918:"17896441",7920:"1a4e3797",8054:"7ccab252",8055:"f10670c6",8263:"546b1c5f",8406:"cffacdf0",8518:"a7bd4aaa",8534:"8b8ccc10",8625:"11e11f3b",8806:"9e767aa9",8882:"3945bec1",9085:"a74a0c51",9140:"df04d3c8",9380:"ac5f2e4a",9458:"1568425c",9469:"45b16189",9534:"024f605e",9594:"3be0564c",9661:"5e95c892",9924:"df203c0f",9964:"7fbd6b3a"}[e]||e)+"."+{53:"bd1d6d5a",81:"dee6a17c",384:"21a70fca",452:"e08657d5",556:"0db19980",576:"6f6e93f3",630:"fd168542",641:"9882cb29",881:"c23e4fb0",1233:"bc5502d7",1420:"54e2107b",1429:"094a2d6c",1437:"4185e6db",1465:"7c9dd290",1649:"aa7e1dfd",1772:"b0ede415",1990:"8c98da4e",2030:"85432187",2155:"832154fd",2242:"2f6ac220",2496:"fb385c68",2839:"2670f877",2991:"8935b1ed",3213:"bd25b291",3237:"8f7e93f0",3433:"23d18ade",3561:"0c288116",3586:"3e5fc9fc",3699:"6b2db20e",3751:"8c42b22a",3776:"ab07c468",4116:"81a5c23b",4121:"038c4e5f",4368:"265346fe",4403:"60633ba4",4503:"52119974",4819:"057c8a34",5003:"fdaa1077",5020:"614bd897",5072:"208f4727",5525:"36b2ab15",5575:"5312e04b",5807:"a66d492d",5909:"a254a8a9",6061:"d80a38d2",6159:"8b33f69d",6879:"b91bc01f",7182:"fb3d5e14",7341:"f52d5f10",7342:"e98ebdb3",7918:"569c1c67",7920:"b37fdfae",8054:"3b4472b4",8055:"f002896e",8263:"78cfd167",8406:"ee115849",8443:"30345cef",8518:"687d6c08",8534:"ee5a2e4c",8625:"42b7b568",8806:"9d5004a2",8882:"693ca362",9085:"07cdad9e",9140:"e0eb28cb",9380:"75c0af2a",9458:"21df2514",9469:"5240074e",9534:"086729fb",9594:"87587873",9661:"5a7f2413",9924:"56844b1b",9964:"d6db5b07"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},b="website:",r.l=(e,a,c,t)=>{if(f[e])f[e].push(a);else{var d,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{d.onerror=d.onload=null,clearTimeout(s);var b=f[e];if(delete f[e],d.parentNode&&d.parentNode.removeChild(d),b&&b.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),o&&document.head.appendChild(d)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/node-mysql2/pt-BR/",r.gca=function(e){return e={17896441:"7918",22161331:"556",54768732:"576",57495183:"5003","935f2afb":"53","8fcb4d7f":"81","1cee01a7":"384",a55c4658:"452",f54f1246:"630","59e52bc2":"641",b814814f:"881",c84c75a7:"1233","54eaaaae":"1420",e19cd79a:"1429",bc31cbdb:"1437",fb880757:"1465","464e933c":"1649",b5d213ed:"1990",ad7b17cf:"2030","940eccaa":"2155",ac9dff0b:"2242","13833ed5":"2496","2bc14e22":"2839",ed06a4b6:"2991",e951ea44:"3213","1df93b7f":"3237","76dfa484":"3433","5814edec":"3561","4e92b6b6":"3586",d04b867d:"3699","3720c009":"3751",f76f5ab7:"3776",cdbda324:"4116","55960ee5":"4121",a94703ab:"4368",b07748b5:"4403","9318259a":"4503",f08329ad:"4819","0e27d5d9":"5072","7c434f9a":"5575",f8d74a12:"5807",f43af5ae:"5909",b80d201b:"6061",db044f71:"6159","406c6f1b":"6879","4098ceee":"7182","40c51f74":"7341","68f13ba5":"7342","1a4e3797":"7920","7ccab252":"8054",f10670c6:"8055","546b1c5f":"8263",cffacdf0:"8406",a7bd4aaa:"8518","8b8ccc10":"8534","11e11f3b":"8625","9e767aa9":"8806","3945bec1":"8882",a74a0c51:"9085",df04d3c8:"9140",ac5f2e4a:"9380","1568425c":"9458","45b16189":"9469","024f605e":"9534","3be0564c":"9594","5e95c892":"9661",df203c0f:"9924","7fbd6b3a":"9964"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var f=r.o(e,a)?e[a]:void 0;if(0!==f)if(f)c.push(f[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var b=new Promise(((c,b)=>f=e[a]=[c,b]));c.push(f[2]=b);var t=r.p+r.u(a),d=new Error;r.l(t,(c=>{if(r.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var b=c&&("load"===c.type?"missing":c.type),t=c&&c.target&&c.target.src;d.message="Loading chunk "+a+" failed.\n("+b+": "+t+")",d.name="ChunkLoadError",d.type=b,d.request=t,f[1](d)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var f,b,t=c[0],d=c[1],o=c[2],n=0;if(t.some((a=>0!==e[a]))){for(f in d)r.o(d,f)&&(r.m[f]=d[f]);if(o)var i=o(r)}for(a&&a(c);n{"use strict";var e,a,c,f,b,t={},d={};function r(e){var a=d[e];if(void 0!==a)return a.exports;var c=d[e]={exports:{}};return t[e].call(c.exports,c,c.exports,r),c.exports}r.m=t,e=[],r.O=(a,c,f,b)=>{if(!c){var t=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(d=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,f,b]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var t={};a=a||[null,c({}),c([]),c(c)];for(var d=2&f&&e;"object"==typeof d&&!~a.indexOf(d);d=c(d))Object.getOwnPropertyNames(d).forEach((a=>t[a]=()=>e[a]));return t.default=()=>e,r.d(b,t),b},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",81:"8fcb4d7f",384:"1cee01a7",452:"a55c4658",556:"22161331",576:"54768732",630:"f54f1246",641:"59e52bc2",881:"b814814f",1233:"c84c75a7",1420:"54eaaaae",1429:"e19cd79a",1437:"bc31cbdb",1465:"fb880757",1649:"464e933c",1990:"b5d213ed",2030:"ad7b17cf",2155:"940eccaa",2242:"ac9dff0b",2496:"13833ed5",2839:"2bc14e22",2991:"ed06a4b6",3213:"e951ea44",3237:"1df93b7f",3433:"76dfa484",3561:"5814edec",3586:"4e92b6b6",3699:"d04b867d",3751:"3720c009",3776:"f76f5ab7",4116:"cdbda324",4121:"55960ee5",4368:"a94703ab",4403:"b07748b5",4503:"9318259a",4819:"f08329ad",5003:"57495183",5072:"0e27d5d9",5575:"7c434f9a",5807:"f8d74a12",5909:"f43af5ae",6061:"b80d201b",6159:"db044f71",6879:"406c6f1b",7182:"4098ceee",7341:"40c51f74",7342:"68f13ba5",7918:"17896441",7920:"1a4e3797",8054:"7ccab252",8055:"f10670c6",8263:"546b1c5f",8406:"cffacdf0",8518:"a7bd4aaa",8534:"8b8ccc10",8625:"11e11f3b",8806:"9e767aa9",8882:"3945bec1",9085:"a74a0c51",9140:"df04d3c8",9380:"ac5f2e4a",9458:"1568425c",9469:"45b16189",9534:"024f605e",9594:"3be0564c",9661:"5e95c892",9924:"df203c0f",9964:"7fbd6b3a"}[e]||e)+"."+{53:"bd1d6d5a",81:"3e7d3dde",384:"21a70fca",452:"e08657d5",556:"0db19980",576:"f1b51fce",630:"fd168542",641:"ab184645",881:"c23e4fb0",1233:"bc5502d7",1420:"9f01ee33",1429:"2afeaaa9",1437:"4185e6db",1465:"7c9dd290",1649:"aa7e1dfd",1772:"b0ede415",1990:"8c98da4e",2030:"85432187",2155:"832154fd",2242:"2f6ac220",2496:"fb385c68",2839:"9549ee75",2991:"8935b1ed",3213:"bd25b291",3237:"7c544ac9",3433:"23d18ade",3561:"0c288116",3586:"3e5fc9fc",3699:"6b2db20e",3751:"8c42b22a",3776:"ab07c468",4116:"ee8a7042",4121:"038c4e5f",4368:"265346fe",4403:"ceab5c6c",4503:"ffa4c25b",4819:"057c8a34",5003:"2395c860",5020:"614bd897",5072:"208f4727",5525:"36b2ab15",5575:"5312e04b",5807:"08a82446",5909:"a254a8a9",6061:"d9733481",6159:"55ce7385",6879:"b91bc01f",7182:"fb3d5e14",7341:"f52d5f10",7342:"e98ebdb3",7918:"569c1c67",7920:"b37fdfae",8054:"51cf493e",8055:"f002896e",8263:"78cfd167",8406:"ee115849",8443:"30345cef",8518:"687d6c08",8534:"d4efc98d",8625:"8de961eb",8806:"4b4974e0",8882:"693ca362",9085:"07cdad9e",9140:"e0eb28cb",9380:"75c0af2a",9458:"2ed6fce8",9469:"5240074e",9534:"086729fb",9594:"87587873",9661:"5a7f2413",9924:"56844b1b",9964:"a3ec85f9"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},b="website:",r.l=(e,a,c,t)=>{if(f[e])f[e].push(a);else{var d,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{d.onerror=d.onload=null,clearTimeout(s);var b=f[e];if(delete f[e],d.parentNode&&d.parentNode.removeChild(d),b&&b.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),o&&document.head.appendChild(d)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/node-mysql2/pt-BR/",r.gca=function(e){return e={17896441:"7918",22161331:"556",54768732:"576",57495183:"5003","935f2afb":"53","8fcb4d7f":"81","1cee01a7":"384",a55c4658:"452",f54f1246:"630","59e52bc2":"641",b814814f:"881",c84c75a7:"1233","54eaaaae":"1420",e19cd79a:"1429",bc31cbdb:"1437",fb880757:"1465","464e933c":"1649",b5d213ed:"1990",ad7b17cf:"2030","940eccaa":"2155",ac9dff0b:"2242","13833ed5":"2496","2bc14e22":"2839",ed06a4b6:"2991",e951ea44:"3213","1df93b7f":"3237","76dfa484":"3433","5814edec":"3561","4e92b6b6":"3586",d04b867d:"3699","3720c009":"3751",f76f5ab7:"3776",cdbda324:"4116","55960ee5":"4121",a94703ab:"4368",b07748b5:"4403","9318259a":"4503",f08329ad:"4819","0e27d5d9":"5072","7c434f9a":"5575",f8d74a12:"5807",f43af5ae:"5909",b80d201b:"6061",db044f71:"6159","406c6f1b":"6879","4098ceee":"7182","40c51f74":"7341","68f13ba5":"7342","1a4e3797":"7920","7ccab252":"8054",f10670c6:"8055","546b1c5f":"8263",cffacdf0:"8406",a7bd4aaa:"8518","8b8ccc10":"8534","11e11f3b":"8625","9e767aa9":"8806","3945bec1":"8882",a74a0c51:"9085",df04d3c8:"9140",ac5f2e4a:"9380","1568425c":"9458","45b16189":"9469","024f605e":"9534","3be0564c":"9594","5e95c892":"9661",df203c0f:"9924","7fbd6b3a":"9964"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var f=r.o(e,a)?e[a]:void 0;if(0!==f)if(f)c.push(f[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var b=new Promise(((c,b)=>f=e[a]=[c,b]));c.push(f[2]=b);var t=r.p+r.u(a),d=new Error;r.l(t,(c=>{if(r.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var b=c&&("load"===c.type?"missing":c.type),t=c&&c.target&&c.target.src;d.message="Loading chunk "+a+" failed.\n("+b+": "+t+")",d.name="ChunkLoadError",d.type=b,d.request=t,f[1](d)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var f,b,t=c[0],d=c[1],o=c[2],n=0;if(t.some((a=>0!==e[a]))){for(f in d)r.o(d,f)&&(r.m[f]=d[f]);if(o)var i=o(r)}for(a&&a(c);n MySQL2 | Guia Rápido - + diff --git a/pt-BR/docs/acknowledgements.html b/pt-BR/docs/acknowledgements.html index 635794e5d6..3b569159c0 100644 --- a/pt-BR/docs/acknowledgements.html +++ b/pt-BR/docs/acknowledgements.html @@ -4,7 +4,7 @@ Agradecimentos | Quickstart - + diff --git a/pt-BR/docs/api-and-configurations.html b/pt-BR/docs/api-and-configurations.html index cd9c75d842..5a66f04836 100644 --- a/pt-BR/docs/api-and-configurations.html +++ b/pt-BR/docs/api-and-configurations.html @@ -4,7 +4,7 @@ API e Configuração | Quickstart - + diff --git a/pt-BR/docs/contributing.html b/pt-BR/docs/contributing.html index bffa6a84ce..d638bfae1a 100644 --- a/pt-BR/docs/contributing.html +++ b/pt-BR/docs/contributing.html @@ -4,7 +4,7 @@ Contribuições - + diff --git a/pt-BR/docs/contributing/website.html b/pt-BR/docs/contributing/website.html index c9d8894223..ec6ef897db 100644 --- a/pt-BR/docs/contributing/website.html +++ b/pt-BR/docs/contributing/website.html @@ -4,7 +4,7 @@ Documentation Site | Quickstart - + diff --git a/pt-BR/docs/documentation.html b/pt-BR/docs/documentation.html index e5d22a2998..a00b6720f4 100644 --- a/pt-BR/docs/documentation.html +++ b/pt-BR/docs/documentation.html @@ -4,7 +4,7 @@ Documentation - + diff --git a/pt-BR/docs/documentation/authentication-switch.html b/pt-BR/docs/documentation/authentication-switch.html index d645af9a33..def93cc9d4 100644 --- a/pt-BR/docs/documentation/authentication-switch.html +++ b/pt-BR/docs/documentation/authentication-switch.html @@ -4,7 +4,7 @@ Authentication Switch Request | Quickstart - + diff --git a/pt-BR/docs/documentation/extras.html b/pt-BR/docs/documentation/extras.html index 35316e7b93..f192904b5f 100644 --- a/pt-BR/docs/documentation/extras.html +++ b/pt-BR/docs/documentation/extras.html @@ -4,7 +4,7 @@ Extra Features | Quickstart - + diff --git a/pt-BR/docs/documentation/mysql-server.html b/pt-BR/docs/documentation/mysql-server.html index ebddb7e5e2..b320ddf852 100644 --- a/pt-BR/docs/documentation/mysql-server.html +++ b/pt-BR/docs/documentation/mysql-server.html @@ -4,7 +4,7 @@ MySQL Server API | Quickstart - + diff --git a/pt-BR/docs/documentation/prepared-statements.html b/pt-BR/docs/documentation/prepared-statements.html index 3dec70c5cd..6b800b40b5 100644 --- a/pt-BR/docs/documentation/prepared-statements.html +++ b/pt-BR/docs/documentation/prepared-statements.html @@ -4,7 +4,7 @@ Prepared Statements | Quickstart - + diff --git a/pt-BR/docs/documentation/promise-wrapper.html b/pt-BR/docs/documentation/promise-wrapper.html index 6c91582979..a0d6ca07c2 100644 --- a/pt-BR/docs/documentation/promise-wrapper.html +++ b/pt-BR/docs/documentation/promise-wrapper.html @@ -4,7 +4,7 @@ Promise Wrappers | Quickstart - + diff --git a/pt-BR/docs/documentation/typescript-examples.html b/pt-BR/docs/documentation/typescript-examples.html index e78751065b..b73eda8025 100644 --- a/pt-BR/docs/documentation/typescript-examples.html +++ b/pt-BR/docs/documentation/typescript-examples.html @@ -4,7 +4,7 @@ Using MySQL2 with TypeScript | Quickstart - + diff --git a/pt-BR/docs/examples.html b/pt-BR/docs/examples.html index 1a565b8ad6..9180e359d0 100644 --- a/pt-BR/docs/examples.html +++ b/pt-BR/docs/examples.html @@ -4,7 +4,7 @@ Examples - + diff --git a/pt-BR/docs/examples/binlog-watcher.html b/pt-BR/docs/examples/binlog-watcher.html index 599df9b35a..87fb5cedc8 100644 --- a/pt-BR/docs/examples/binlog-watcher.html +++ b/pt-BR/docs/examples/binlog-watcher.html @@ -4,7 +4,7 @@ Binlog Watcher | Quickstart - + diff --git a/pt-BR/docs/examples/connections/create-connection.html b/pt-BR/docs/examples/connections/create-connection.html index 26caa493ac..267f247023 100644 --- a/pt-BR/docs/examples/connections/create-connection.html +++ b/pt-BR/docs/examples/connections/create-connection.html @@ -4,7 +4,7 @@ createConnection | Quickstart - + diff --git a/pt-BR/docs/examples/connections/create-pool.html b/pt-BR/docs/examples/connections/create-pool.html index 90ad3098df..3e180ce08a 100644 --- a/pt-BR/docs/examples/connections/create-pool.html +++ b/pt-BR/docs/examples/connections/create-pool.html @@ -4,7 +4,7 @@ createPool | Quickstart - + @@ -87,10 +87,7 @@

crea

Glossary

PoolOptions

-
-

PoolOptions extends all options from ConnectionOptions:

-
ConnectionOptions Specification
-
+

PoolOptions extends all options from ConnectionOptions:

ConnectionOptions Specification
PoolOptions Specification
\ No newline at end of file diff --git a/pt-BR/docs/examples/connections/createPoolCluster.html b/pt-BR/docs/examples/connections/createPoolCluster.html index 614da2a374..2fd0b5fd98 100644 --- a/pt-BR/docs/examples/connections/createPoolCluster.html +++ b/pt-BR/docs/examples/connections/createPoolCluster.html @@ -4,7 +4,7 @@ createPoolCluster | Quickstart - + @@ -82,10 +82,7 @@

add(g

Glossary

PoolOptions

-
-

PoolOptions extends all options from ConnectionOptions:

-
ConnectionOptions Specification
-
+

PoolOptions extends all options from ConnectionOptions:

ConnectionOptions Specification
PoolOptions Specification
\ No newline at end of file diff --git a/pt-BR/docs/examples/promise-wrapper/co-await.html b/pt-BR/docs/examples/promise-wrapper/co-await.html index a7f66cba1e..f2761db445 100644 --- a/pt-BR/docs/examples/promise-wrapper/co-await.html +++ b/pt-BR/docs/examples/promise-wrapper/co-await.html @@ -4,7 +4,7 @@ await — co | Quickstart - + diff --git a/pt-BR/docs/examples/queries/prepared-statements.html b/pt-BR/docs/examples/queries/prepared-statements.html index a929b29af5..f2ceaa4d2a 100644 --- a/pt-BR/docs/examples/queries/prepared-statements.html +++ b/pt-BR/docs/examples/queries/prepared-statements.html @@ -4,7 +4,7 @@ Prepared Statements | Quickstart - + diff --git a/pt-BR/docs/examples/queries/prepared-statements/delete.html b/pt-BR/docs/examples/queries/prepared-statements/delete.html index 91862153ae..8f9b887bee 100644 --- a/pt-BR/docs/examples/queries/prepared-statements/delete.html +++ b/pt-BR/docs/examples/queries/prepared-statements/delete.html @@ -4,7 +4,7 @@ DELETE | Quickstart - + diff --git a/pt-BR/docs/examples/queries/prepared-statements/insert.html b/pt-BR/docs/examples/queries/prepared-statements/insert.html index db97b91e98..e567e478d4 100644 --- a/pt-BR/docs/examples/queries/prepared-statements/insert.html +++ b/pt-BR/docs/examples/queries/prepared-statements/insert.html @@ -4,7 +4,7 @@ INSERT | Quickstart - + diff --git a/pt-BR/docs/examples/queries/prepared-statements/select.html b/pt-BR/docs/examples/queries/prepared-statements/select.html index ebb9c81e29..8b667ac8cc 100644 --- a/pt-BR/docs/examples/queries/prepared-statements/select.html +++ b/pt-BR/docs/examples/queries/prepared-statements/select.html @@ -4,7 +4,7 @@ SELECT | Quickstart - + diff --git a/pt-BR/docs/examples/queries/prepared-statements/update.html b/pt-BR/docs/examples/queries/prepared-statements/update.html index 8ca4095ef0..c1a741d5bd 100644 --- a/pt-BR/docs/examples/queries/prepared-statements/update.html +++ b/pt-BR/docs/examples/queries/prepared-statements/update.html @@ -4,7 +4,7 @@ UPDATE | Quickstart - + diff --git a/pt-BR/docs/examples/queries/simple-queries.html b/pt-BR/docs/examples/queries/simple-queries.html index 93c9c824ef..7f3b607286 100644 --- a/pt-BR/docs/examples/queries/simple-queries.html +++ b/pt-BR/docs/examples/queries/simple-queries.html @@ -4,7 +4,7 @@ Simple Queries | Quickstart - + diff --git a/pt-BR/docs/examples/queries/simple-queries/delete.html b/pt-BR/docs/examples/queries/simple-queries/delete.html index 524c9ebc4b..61a14c0281 100644 --- a/pt-BR/docs/examples/queries/simple-queries/delete.html +++ b/pt-BR/docs/examples/queries/simple-queries/delete.html @@ -4,7 +4,7 @@ DELETE | Quickstart - + diff --git a/pt-BR/docs/examples/queries/simple-queries/insert.html b/pt-BR/docs/examples/queries/simple-queries/insert.html index 75bfd23161..07304e5d7b 100644 --- a/pt-BR/docs/examples/queries/simple-queries/insert.html +++ b/pt-BR/docs/examples/queries/simple-queries/insert.html @@ -4,7 +4,7 @@ INSERT | Quickstart - + diff --git a/pt-BR/docs/examples/queries/simple-queries/select.html b/pt-BR/docs/examples/queries/simple-queries/select.html index ad44874505..4346bacd1a 100644 --- a/pt-BR/docs/examples/queries/simple-queries/select.html +++ b/pt-BR/docs/examples/queries/simple-queries/select.html @@ -4,7 +4,7 @@ SELECT | Quickstart - + diff --git a/pt-BR/docs/examples/queries/simple-queries/update.html b/pt-BR/docs/examples/queries/simple-queries/update.html index 60e757e3a1..5bc10de011 100644 --- a/pt-BR/docs/examples/queries/simple-queries/update.html +++ b/pt-BR/docs/examples/queries/simple-queries/update.html @@ -4,7 +4,7 @@ UPDATE | Quickstart - + diff --git a/pt-BR/docs/examples/tests/mysql-proxy.html b/pt-BR/docs/examples/tests/mysql-proxy.html index e85c3dba9c..430ba6fff2 100644 --- a/pt-BR/docs/examples/tests/mysql-proxy.html +++ b/pt-BR/docs/examples/tests/mysql-proxy.html @@ -4,7 +4,7 @@ MySQL Proxy | Quickstart - + diff --git a/pt-BR/docs/examples/tests/pool.html b/pt-BR/docs/examples/tests/pool.html index 1bd97501bc..3763697cdf 100644 --- a/pt-BR/docs/examples/tests/pool.html +++ b/pt-BR/docs/examples/tests/pool.html @@ -4,7 +4,7 @@ Pool | Quickstart - + diff --git a/pt-BR/docs/examples/tests/server.html b/pt-BR/docs/examples/tests/server.html index 95f23a0213..a4a44af81d 100644 --- a/pt-BR/docs/examples/tests/server.html +++ b/pt-BR/docs/examples/tests/server.html @@ -4,7 +4,7 @@ Server | Quickstart - + diff --git a/pt-BR/docs/examples/typescript/basic-custom-class.html b/pt-BR/docs/examples/typescript/basic-custom-class.html index f9243aa43c..7118cf2c72 100644 --- a/pt-BR/docs/examples/typescript/basic-custom-class.html +++ b/pt-BR/docs/examples/typescript/basic-custom-class.html @@ -4,7 +4,7 @@ Basic Custom Class | Quickstart - + diff --git a/pt-BR/docs/examples/typescript/procedure-call/index.html b/pt-BR/docs/examples/typescript/procedure-call/index.html index 43f75c1239..04ec84c13e 100644 --- a/pt-BR/docs/examples/typescript/procedure-call/index.html +++ b/pt-BR/docs/examples/typescript/procedure-call/index.html @@ -4,7 +4,7 @@ Procedure Call Packet | Quickstart - + diff --git a/pt-BR/docs/examples/typescript/procedure-call/row-as-array.html b/pt-BR/docs/examples/typescript/procedure-call/row-as-array.html index be8a795b95..93974694b8 100644 --- a/pt-BR/docs/examples/typescript/procedure-call/row-as-array.html +++ b/pt-BR/docs/examples/typescript/procedure-call/row-as-array.html @@ -4,7 +4,7 @@ Procedure Call Packet (Row as Array) | Quickstart - + diff --git a/pt-BR/docs/examples/typescript/row-data/index.html b/pt-BR/docs/examples/typescript/row-data/index.html index adf39d7ee4..f880ef81de 100644 --- a/pt-BR/docs/examples/typescript/row-data/index.html +++ b/pt-BR/docs/examples/typescript/row-data/index.html @@ -4,7 +4,7 @@ Row Data Packet | Quickstart - + diff --git a/pt-BR/docs/examples/typescript/row-data/multi-statements.html b/pt-BR/docs/examples/typescript/row-data/multi-statements.html index 95bfbdb534..7072c8c6a9 100644 --- a/pt-BR/docs/examples/typescript/row-data/multi-statements.html +++ b/pt-BR/docs/examples/typescript/row-data/multi-statements.html @@ -4,7 +4,7 @@ Row Data Packet (Multi Statements) | Quickstart - + diff --git a/pt-BR/docs/examples/typescript/row-data/row-as-array-multi-statements.html b/pt-BR/docs/examples/typescript/row-data/row-as-array-multi-statements.html index c5bec7e7ce..1e8e69175c 100644 --- a/pt-BR/docs/examples/typescript/row-data/row-as-array-multi-statements.html +++ b/pt-BR/docs/examples/typescript/row-data/row-as-array-multi-statements.html @@ -4,7 +4,7 @@ Row Data Packet (Multi Statements and Row as Array) | Quickstart - + diff --git a/pt-BR/docs/examples/typescript/row-data/row-as-array.html b/pt-BR/docs/examples/typescript/row-data/row-as-array.html index 5589e5b798..b66e3953d4 100644 --- a/pt-BR/docs/examples/typescript/row-data/row-as-array.html +++ b/pt-BR/docs/examples/typescript/row-data/row-as-array.html @@ -4,7 +4,7 @@ Row Data Packet (Row as Array) | Quickstart - + diff --git a/pt-BR/docs/faq.html b/pt-BR/docs/faq.html index 11c96cfa2f..416c239d8e 100644 --- a/pt-BR/docs/faq.html +++ b/pt-BR/docs/faq.html @@ -4,7 +4,7 @@ FAQ - + diff --git a/pt-BR/docs/faq/how-to-handle-errors.html b/pt-BR/docs/faq/how-to-handle-errors.html index f6f5f3bf18..7ca42c7ddd 100644 --- a/pt-BR/docs/faq/how-to-handle-errors.html +++ b/pt-BR/docs/faq/how-to-handle-errors.html @@ -4,7 +4,7 @@ How to handle errors? | Quickstart - + diff --git a/pt-BR/docs/history-and-why-mysq2.html b/pt-BR/docs/history-and-why-mysq2.html index 62f3934fc7..53f47c5aed 100644 --- a/pt-BR/docs/history-and-why-mysq2.html +++ b/pt-BR/docs/history-and-why-mysq2.html @@ -4,7 +4,7 @@ História e Porque o MySQL2 | Quickstart - + diff --git a/pt-BR/docs/stability-badges.html b/pt-BR/docs/stability-badges.html index 1b9163e514..a7f9bb9514 100644 --- a/pt-BR/docs/stability-badges.html +++ b/pt-BR/docs/stability-badges.html @@ -4,7 +4,7 @@ Stability Badges | Quickstart - + diff --git a/pt-BR/docs/tags.html b/pt-BR/docs/tags.html index 38b71d95d5..1d404cd556 100644 --- a/pt-BR/docs/tags.html +++ b/pt-BR/docs/tags.html @@ -4,7 +4,7 @@ Marcadores | Quickstart - + diff --git a/pt-BR/docs/tags/create-connection.html b/pt-BR/docs/tags/create-connection.html index 5e8201d243..922d534983 100644 --- a/pt-BR/docs/tags/create-connection.html +++ b/pt-BR/docs/tags/create-connection.html @@ -4,7 +4,7 @@ Um documento selecionado com "createConnection" | Quickstart - + diff --git a/pt-BR/docs/tags/create-pool-cluster.html b/pt-BR/docs/tags/create-pool-cluster.html index 1162ca2de0..bba981f212 100644 --- a/pt-BR/docs/tags/create-pool-cluster.html +++ b/pt-BR/docs/tags/create-pool-cluster.html @@ -4,7 +4,7 @@ Um documento selecionado com "createPoolCluster" | Quickstart - + diff --git a/pt-BR/docs/tags/create-pool.html b/pt-BR/docs/tags/create-pool.html index b30d89bdb2..0c6eb2bd6f 100644 --- a/pt-BR/docs/tags/create-pool.html +++ b/pt-BR/docs/tags/create-pool.html @@ -4,7 +4,7 @@ Um documento selecionado com "createPool" | Quickstart - + diff --git a/pt-BR/docs/tags/execute.html b/pt-BR/docs/tags/execute.html index 65baf1e0aa..c30a937d32 100644 --- a/pt-BR/docs/tags/execute.html +++ b/pt-BR/docs/tags/execute.html @@ -4,7 +4,7 @@ 5 documentos selecionados com "execute" | Quickstart - + diff --git a/pt-BR/docs/tags/parameters.html b/pt-BR/docs/tags/parameters.html index deecc6f54a..2f390573f2 100644 --- a/pt-BR/docs/tags/parameters.html +++ b/pt-BR/docs/tags/parameters.html @@ -4,7 +4,7 @@ 4 documentos selecionados com "Parameters" | Quickstart - + diff --git a/pt-BR/docs/tags/placeholders.html b/pt-BR/docs/tags/placeholders.html index 427ca25d64..24c86b3a5f 100644 --- a/pt-BR/docs/tags/placeholders.html +++ b/pt-BR/docs/tags/placeholders.html @@ -4,7 +4,7 @@ 4 documentos selecionados com "Placeholders" | Quickstart - + diff --git a/pt-BR/docs/tags/prepared-statements.html b/pt-BR/docs/tags/prepared-statements.html index 3076d98439..f01f5032c4 100644 --- a/pt-BR/docs/tags/prepared-statements.html +++ b/pt-BR/docs/tags/prepared-statements.html @@ -4,7 +4,7 @@ 5 documentos selecionados com "Prepared Statements" | Quickstart - + diff --git a/pt-BR/docs/tags/query.html b/pt-BR/docs/tags/query.html index 9d49391032..5972b8625e 100644 --- a/pt-BR/docs/tags/query.html +++ b/pt-BR/docs/tags/query.html @@ -4,7 +4,7 @@ 4 documentos selecionados com "query" | Quickstart - + diff --git a/pt-BR/docs/tags/rds.html b/pt-BR/docs/tags/rds.html index 326d759ea4..47293eaafd 100644 --- a/pt-BR/docs/tags/rds.html +++ b/pt-BR/docs/tags/rds.html @@ -4,7 +4,7 @@ 3 documentos selecionados com "RDS" | Quickstart - + diff --git a/pt-BR/docs/tags/sha-1.html b/pt-BR/docs/tags/sha-1.html index e3ff68c034..fd1e4012ff 100644 --- a/pt-BR/docs/tags/sha-1.html +++ b/pt-BR/docs/tags/sha-1.html @@ -4,7 +4,7 @@ 3 documentos selecionados com "SHA1" | Quickstart - + diff --git a/pt-BR/docs/tags/socks.html b/pt-BR/docs/tags/socks.html index c33b8c4c14..3408e28f87 100644 --- a/pt-BR/docs/tags/socks.html +++ b/pt-BR/docs/tags/socks.html @@ -4,7 +4,7 @@ 3 documentos selecionados com "Socks" | Quickstart - + diff --git a/pt-BR/docs/tags/ssl.html b/pt-BR/docs/tags/ssl.html index 8a29cd3003..04062de952 100644 --- a/pt-BR/docs/tags/ssl.html +++ b/pt-BR/docs/tags/ssl.html @@ -4,7 +4,7 @@ 3 documentos selecionados com "SSL" | Quickstart - + diff --git a/pt-BR/docs/tags/uri.html b/pt-BR/docs/tags/uri.html index 95d73a7d50..7cd6be9461 100644 --- a/pt-BR/docs/tags/uri.html +++ b/pt-BR/docs/tags/uri.html @@ -4,7 +4,7 @@ 3 documentos selecionados com "URI" | Quickstart - + diff --git a/pt-BR/index.html b/pt-BR/index.html index e37e558489..5f84e764dc 100644 --- a/pt-BR/index.html +++ b/pt-BR/index.html @@ -4,7 +4,7 @@ Quickstart - + diff --git a/pt-BR/search-index.json b/pt-BR/search-index.json index 25528c17a8..18cefdf2a8 100644 --- a/pt-BR/search-index.json +++ b/pt-BR/search-index.json @@ -1 +1 @@ -[{"documents":[{"i":621,"t":"Agradecimentos","u":"/node-mysql2/pt-BR/docs/acknowledgements","b":[]},{"i":623,"t":"MySQL2","u":"/node-mysql2/pt-BR/docs","b":[]},{"i":637,"t":"API e Configuração","u":"/node-mysql2/pt-BR/docs/api-and-configurations","b":[]},{"i":639,"t":"Contribuições","u":"/node-mysql2/pt-BR/docs/contributing","b":["Contribuições"]},{"i":641,"t":"Website Contributing Guidelines","u":"/node-mysql2/pt-BR/docs/contributing/website","b":["Contribuições"]},{"i":659,"t":"Documentation","u":"/node-mysql2/pt-BR/docs/documentation","b":["Docs","Documentação"]},{"i":669,"t":"Authentication Switch Request","u":"/node-mysql2/pt-BR/docs/documentation/authentication-switch","b":["Docs","Documentação"]},{"i":673,"t":"Prepared Statements","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","b":["Docs","Documentação"]},{"i":686,"t":"MySQL Server API","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","b":["Docs","Documentação"]},{"i":695,"t":"Extra Features","u":"/node-mysql2/pt-BR/docs/documentation/extras","b":["Docs","Documentação"]},{"i":704,"t":"Using MySQL2 with TypeScript","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","b":["Docs","Documentação"]},{"i":730,"t":"Promise Wrappers","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","b":["Docs","Documentação"]},{"i":738,"t":"Examples","u":"/node-mysql2/pt-BR/docs/examples","b":["Examples"]},{"i":742,"t":"Binlog Watcher","u":"/node-mysql2/pt-BR/docs/examples/binlog-watcher","b":["Examples"]},{"i":744,"t":"createConnection","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","b":["Examples","Connections"]},{"i":763,"t":"createPoolCluster","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","b":["Examples","Connections"]},{"i":782,"t":"Prepared Statements","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements","b":["Examples","Queries","Prepared Statements"]},{"i":784,"t":"DELETE","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","b":["Examples","Queries","Prepared Statements"]},{"i":796,"t":"createPool","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","b":["Examples","Connections"]},{"i":815,"t":"INSERT","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","b":["Examples","Queries","Prepared Statements"]},{"i":827,"t":"await — co","u":"/node-mysql2/pt-BR/docs/examples/promise-wrapper/co-await","b":["Examples","Promise Wrapper"]},{"i":829,"t":"UPDATE","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","b":["Examples","Queries","Prepared Statements"]},{"i":841,"t":"Simple Queries","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries","b":["Examples","Queries","Simple Queries"]},{"i":843,"t":"DELETE","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","b":["Examples","Queries","Simple Queries"]},{"i":854,"t":"SELECT","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","b":["Examples","Queries","Simple Queries"]},{"i":865,"t":"INSERT","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","b":["Examples","Queries","Simple Queries"]},{"i":876,"t":"MySQL Proxy","u":"/node-mysql2/pt-BR/docs/examples/tests/mysql-proxy","b":["Examples","Tests"]},{"i":878,"t":"Pool","u":"/node-mysql2/pt-BR/docs/examples/tests/pool","b":["Examples","Tests"]},{"i":880,"t":"SELECT","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","b":["Examples","Queries","Prepared Statements"]},{"i":890,"t":"Server","u":"/node-mysql2/pt-BR/docs/examples/tests/server","b":["Examples","Tests"]},{"i":892,"t":"UPDATE","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","b":["Examples","Queries","Simple Queries"]},{"i":903,"t":"Basic Custom Class","u":"/node-mysql2/pt-BR/docs/examples/typescript/basic-custom-class","b":["Examples","TypeScript"]},{"i":905,"t":"Row Data Packet","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/index","b":["Examples","TypeScript","Row Data"]},{"i":907,"t":"Row Data Packet (Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/row-as-array","b":["Examples","TypeScript","Row Data"]},{"i":909,"t":"Row Data Packet (Multi Statements)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/multi-statements","b":["Examples","TypeScript","Row Data"]},{"i":911,"t":"Procedure Call Packet","u":"/node-mysql2/pt-BR/docs/examples/typescript/procedure-call/index","b":["Examples","TypeScript","Procedure Call"]},{"i":913,"t":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/procedure-call/row-as-array","b":["Examples","TypeScript","Procedure Call"]},{"i":915,"t":"Frequently Asked Questions","u":"/node-mysql2/pt-BR/docs/faq","b":["FAQ"]},{"i":917,"t":"História e Porque o MySQL2","u":"/node-mysql2/pt-BR/docs/history-and-why-mysq2","b":[]},{"i":919,"t":"Stability Badges","u":"/node-mysql2/pt-BR/docs/stability-badges","b":[]},{"i":921,"t":"How to handle errors?","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","b":["FAQ"]},{"i":929,"t":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/row-as-array-multi-statements","b":["Examples","TypeScript","Row Data"]}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/621",[0,4.326]],["t/623",[1,3.234]],["t/637",[2,2.484,3,2.484,4,2.93]],["t/639",[5,4.326]],["t/641",[6,2.93,7,2.93,8,2.93]],["t/659",[9,4.326]],["t/669",[10,2.93,11,2.93,12,2.93]],["t/673",[13,2.962,14,2.35]],["t/686",[2,2.484,15,2.484,16,2.484]],["t/695",[17,3.494,18,3.494]],["t/704",[1,2.19,19,2.93,20,2.93]],["t/730",[21,3.494,22,3.494]],["t/738",[23,4.326]],["t/742",[24,3.494,25,3.494]],["t/744",[26,4.326]],["t/763",[27,4.326]],["t/782",[13,2.962,14,2.35]],["t/784",[28,3.668]],["t/796",[29,4.326]],["t/815",[30,3.668]],["t/827",[31,2.93,32,2.93,33,2.93]],["t/829",[34,3.668]],["t/841",[35,3.494,36,3.494]],["t/843",[28,3.668]],["t/854",[37,3.668]],["t/865",[30,3.668]],["t/876",[15,2.962,38,3.494]],["t/878",[39,4.326]],["t/880",[37,3.668]],["t/890",[16,3.668]],["t/892",[34,3.668]],["t/903",[40,2.93,41,2.93,42,2.93]],["t/905",[43,1.796,44,1.971,45,1.65]],["t/907",[43,2.089,44,1.49,45,1.247,46,1.656]],["t/909",[14,1.49,43,1.358,44,1.49,45,1.247,47,1.878]],["t/911",[45,1.65,48,2.484,49,2.484]],["t/913",[43,1.358,45,1.247,46,1.656,48,1.878,49,1.878]],["t/915",[50,2.93,51,2.93,52,2.93]],["t/917",[1,1.656,3,1.878,53,2.215,54,2.215,55,2.215]],["t/919",[56,3.494,57,3.494]],["t/921",[58,3.494,59,3.494]],["t/929",[14,1.198,43,1.759,44,1.198,45,1.003,46,1.331,47,1.51]]],"invertedIndex":[["",{"_index":32,"t":{"827":{"position":[[6,1]]}}}],["agradecimento",{"_index":0,"t":{"621":{"position":[[0,14]]}}}],["api",{"_index":2,"t":{"637":{"position":[[0,3]]},"686":{"position":[[13,3]]}}}],["array",{"_index":46,"t":{"907":{"position":[[24,6]]},"913":{"position":[[30,6]]},"929":{"position":[[45,6]]}}}],["ask",{"_index":51,"t":{"915":{"position":[[11,5]]}}}],["authent",{"_index":10,"t":{"669":{"position":[[0,14]]}}}],["await",{"_index":31,"t":{"827":{"position":[[0,5]]}}}],["badg",{"_index":57,"t":{"919":{"position":[[10,6]]}}}],["basic",{"_index":40,"t":{"903":{"position":[[0,5]]}}}],["binlog",{"_index":24,"t":{"742":{"position":[[0,6]]}}}],["call",{"_index":49,"t":{"911":{"position":[[10,4]]},"913":{"position":[[10,4]]}}}],["class",{"_index":42,"t":{"903":{"position":[[13,5]]}}}],["co",{"_index":33,"t":{"827":{"position":[[8,2]]}}}],["configuração",{"_index":4,"t":{"637":{"position":[[6,12]]}}}],["contribuiçõ",{"_index":5,"t":{"639":{"position":[[0,13]]}}}],["contribut",{"_index":7,"t":{"641":{"position":[[8,12]]}}}],["createconnect",{"_index":26,"t":{"744":{"position":[[0,16]]}}}],["createpool",{"_index":29,"t":{"796":{"position":[[0,10]]}}}],["createpoolclust",{"_index":27,"t":{"763":{"position":[[0,17]]}}}],["custom",{"_index":41,"t":{"903":{"position":[[6,6]]}}}],["data",{"_index":44,"t":{"905":{"position":[[4,4]]},"907":{"position":[[4,4]]},"909":{"position":[[4,4]]},"929":{"position":[[4,4]]}}}],["delet",{"_index":28,"t":{"784":{"position":[[0,6]]},"843":{"position":[[0,6]]}}}],["document",{"_index":9,"t":{"659":{"position":[[0,13]]}}}],["e",{"_index":3,"t":{"637":{"position":[[4,1]]},"917":{"position":[[9,1]]}}}],["error",{"_index":59,"t":{"921":{"position":[[14,7]]}}}],["exampl",{"_index":23,"t":{"738":{"position":[[0,8]]}}}],["extra",{"_index":17,"t":{"695":{"position":[[0,5]]}}}],["featur",{"_index":18,"t":{"695":{"position":[[6,8]]}}}],["frequent",{"_index":50,"t":{"915":{"position":[[0,10]]}}}],["guidelin",{"_index":8,"t":{"641":{"position":[[21,10]]}}}],["handl",{"_index":58,"t":{"921":{"position":[[7,6]]}}}],["história",{"_index":53,"t":{"917":{"position":[[0,8]]}}}],["insert",{"_index":30,"t":{"815":{"position":[[0,6]]},"865":{"position":[[0,6]]}}}],["multi",{"_index":47,"t":{"909":{"position":[[16,6]]},"929":{"position":[[16,6]]}}}],["mysql",{"_index":15,"t":{"686":{"position":[[0,5]]},"876":{"position":[[0,5]]}}}],["mysql2",{"_index":1,"t":{"623":{"position":[[0,6]]},"704":{"position":[[6,6]]},"917":{"position":[[20,6]]}}}],["o",{"_index":55,"t":{"917":{"position":[[18,1]]}}}],["packet",{"_index":45,"t":{"905":{"position":[[9,6]]},"907":{"position":[[9,6]]},"909":{"position":[[9,6]]},"911":{"position":[[15,6]]},"913":{"position":[[15,6]]},"929":{"position":[[9,6]]}}}],["pool",{"_index":39,"t":{"878":{"position":[[0,4]]}}}],["porqu",{"_index":54,"t":{"917":{"position":[[11,6]]}}}],["prepar",{"_index":13,"t":{"673":{"position":[[0,8]]},"782":{"position":[[0,8]]}}}],["procedur",{"_index":48,"t":{"911":{"position":[[0,9]]},"913":{"position":[[0,9]]}}}],["promis",{"_index":21,"t":{"730":{"position":[[0,7]]}}}],["proxi",{"_index":38,"t":{"876":{"position":[[6,5]]}}}],["queri",{"_index":36,"t":{"841":{"position":[[7,7]]}}}],["question",{"_index":52,"t":{"915":{"position":[[17,9]]}}}],["request",{"_index":12,"t":{"669":{"position":[[22,7]]}}}],["row",{"_index":43,"t":{"905":{"position":[[0,3]]},"907":{"position":[[0,3],[16,4]]},"909":{"position":[[0,3]]},"913":{"position":[[22,4]]},"929":{"position":[[0,3],[38,3]]}}}],["select",{"_index":37,"t":{"854":{"position":[[0,6]]},"880":{"position":[[0,6]]}}}],["server",{"_index":16,"t":{"686":{"position":[[6,6]]},"890":{"position":[[0,6]]}}}],["simpl",{"_index":35,"t":{"841":{"position":[[0,6]]}}}],["stabil",{"_index":56,"t":{"919":{"position":[[0,9]]}}}],["statement",{"_index":14,"t":{"673":{"position":[[9,10]]},"782":{"position":[[9,10]]},"909":{"position":[[23,11]]},"929":{"position":[[23,10]]}}}],["switch",{"_index":11,"t":{"669":{"position":[[15,6]]}}}],["typescript",{"_index":20,"t":{"704":{"position":[[18,10]]}}}],["updat",{"_index":34,"t":{"829":{"position":[[0,6]]},"892":{"position":[[0,6]]}}}],["us",{"_index":19,"t":{"704":{"position":[[0,5]]}}}],["watcher",{"_index":25,"t":{"742":{"position":[[7,7]]}}}],["websit",{"_index":6,"t":{"641":{"position":[[0,7]]}}}],["wrapper",{"_index":22,"t":{"730":{"position":[[8,8]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":625,"t":"Instalação","u":"/node-mysql2/pt-BR/docs","h":"#instalação","p":623},{"i":627,"t":"Primeira Consulta (Query)","u":"/node-mysql2/pt-BR/docs","h":"#primeira-consulta-query","p":623},{"i":629,"t":"Usando Instruções Preparadas (Prepared Statements)","u":"/node-mysql2/pt-BR/docs","h":"#usando-instruções-preparadas-prepared-statements","p":623},{"i":631,"t":"Usando Conjunto de Conexões (pools)","u":"/node-mysql2/pt-BR/docs","h":"#using-connection-pools","p":623},{"i":633,"t":"Usando o Promise Wrapper","u":"/node-mysql2/pt-BR/docs","h":"#usando-o-promise-wrapper","p":623},{"i":635,"t":"Resultados em Array","u":"/node-mysql2/pt-BR/docs","h":"#resultados-em-array","p":623},{"i":643,"t":"Environment","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#environment","p":641},{"i":645,"t":"Development","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#development","p":641},{"i":647,"t":"Extras Components","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#extras-components","p":641},{"i":649,"t":"History","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#history","p":641},{"i":651,"t":"Stability","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#stability","p":641},{"i":653,"t":"FAQ","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#faq","p":641},{"i":655,"t":"ExternalCodeEmbed","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#externalcodeembed","p":641},{"i":657,"t":"Running Tests","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#running-tests","p":641},{"i":661,"t":"Examples","u":"/node-mysql2/pt-BR/docs/documentation","h":"#examples","p":659},{"i":663,"t":"Known incompatibilities with Node MySQL","u":"/node-mysql2/pt-BR/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":659},{"i":665,"t":"Other Resources","u":"/node-mysql2/pt-BR/docs/documentation","h":"#other-resources","p":659},{"i":667,"t":"Benchmarks","u":"/node-mysql2/pt-BR/docs/documentation","h":"#benchmarks","p":659},{"i":671,"t":"Multi-factor authentication","u":"/node-mysql2/pt-BR/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":669},{"i":674,"t":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":673},{"i":676,"t":"Manual prepare / execute","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":673},{"i":678,"t":"Configuration","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#configuration","p":673},{"i":680,"t":"Serialization of bind parameters","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":673},{"i":682,"t":"Prepared Statements Helper","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":673},{"i":684,"t":"Examples","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#examples","p":673},{"i":687,"t":"Server","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#server","p":686},{"i":689,"t":"Events","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#events","p":686},{"i":691,"t":"Connection","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#connection","p":686},{"i":693,"t":"Events","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#events-1","p":686},{"i":696,"t":"Named placeholders","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#named-placeholders","p":695},{"i":698,"t":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":695},{"i":700,"t":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":695},{"i":702,"t":"Connecting using custom stream:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#connecting-using-custom-stream","p":695},{"i":705,"t":"Installation","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#installation","p":704},{"i":707,"t":"Usage","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#usage","p":704},{"i":709,"t":"Connection","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#connection","p":704},{"i":711,"t":"Pool Connection","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#pool-connection","p":704},{"i":713,"t":"Query and Execute","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#query-and-execute","p":704},{"i":715,"t":"Type Specification","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#type-specification","p":704},{"i":716,"t":"RowDataPacket[]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#rowdatapacket","p":704},{"i":718,"t":"RowDataPacket[][]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":704},{"i":720,"t":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#resultsetheader","p":704},{"i":722,"t":"ResultSetHeader[]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":704},{"i":724,"t":"ProcedureCallPacket","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":704},{"i":726,"t":"OkPacket","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#okpacket","p":704},{"i":728,"t":"Examples","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#examples","p":704},{"i":732,"t":"Basic Promise","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#basic-promise","p":730},{"i":734,"t":"ES7 Async Await","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#es7-async-await","p":730},{"i":736,"t":"With CO","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#with-co","p":730},{"i":740,"t":"Examples using MySQL server API","u":"/node-mysql2/pt-BR/docs/examples","h":"#examples-using-mysql-server-api","p":738},{"i":746,"t":"createConnection(connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":744},{"i":748,"t":"createConnection(config)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":744},{"i":750,"t":"createConnection(config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":744},{"i":752,"t":"createConnection(config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":744},{"i":754,"t":"createConnection(config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":744},{"i":756,"t":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#related-links","p":744},{"i":758,"t":"createConnection(config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":744},{"i":760,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#glossary","p":744},{"i":761,"t":"ConnectionOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#connectionoptions","p":744},{"i":765,"t":"add(group, connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":763},{"i":767,"t":"add(group, config)","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":763},{"i":769,"t":"add(group, config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":763},{"i":771,"t":"add(group, config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":763},{"i":773,"t":"add(group, config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":763},{"i":775,"t":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#related-links","p":763},{"i":777,"t":"add(group, config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":763},{"i":779,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#glossary","p":763},{"i":780,"t":"PoolOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":763},{"i":785,"t":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":784},{"i":787,"t":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":784},{"i":789,"t":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":784},{"i":791,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#glossary","p":784},{"i":792,"t":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":784},{"i":794,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":784},{"i":798,"t":"createPool(connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":796},{"i":800,"t":"createPool(config)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig","p":796},{"i":802,"t":"createPool(config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":796},{"i":804,"t":"createPool(config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":796},{"i":806,"t":"createPool(config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":796},{"i":808,"t":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#related-links","p":796},{"i":810,"t":"createPool(config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":796},{"i":812,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#glossary","p":796},{"i":813,"t":"PoolOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#pooloptions","p":796},{"i":816,"t":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":815},{"i":818,"t":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":815},{"i":820,"t":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":815},{"i":822,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#glossary","p":815},{"i":823,"t":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":815},{"i":825,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":815},{"i":830,"t":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":829},{"i":832,"t":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":829},{"i":834,"t":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":829},{"i":836,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#glossary","p":829},{"i":837,"t":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":829},{"i":839,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":829},{"i":845,"t":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#querysql","p":843},{"i":847,"t":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":843},{"i":849,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#glossary","p":843},{"i":850,"t":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":843},{"i":852,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":843},{"i":856,"t":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#querysql","p":854},{"i":858,"t":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":854},{"i":860,"t":"query(options) — Row as Array","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":854},{"i":862,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#glossary","p":854},{"i":863,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":854},{"i":867,"t":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#querysql","p":865},{"i":869,"t":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":865},{"i":871,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#glossary","p":865},{"i":872,"t":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":865},{"i":874,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":865},{"i":881,"t":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":880},{"i":883,"t":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":880},{"i":885,"t":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":880},{"i":887,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#glossary","p":880},{"i":888,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":880},{"i":894,"t":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#querysql","p":892},{"i":896,"t":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":892},{"i":898,"t":"Glossary","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#glossary","p":892},{"i":899,"t":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":892},{"i":901,"t":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":892},{"i":923,"t":"Using callbacks","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":921},{"i":925,"t":"Using promises","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#using-promises","p":921},{"i":927,"t":"Related Links","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#related-links","p":921}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/625",[0,5.484]],["t/627",[1,3.58,2,3.58,3,3.166]],["t/629",[4,2.147,5,2.657,6,2.657,7,2.147,8,2.35]],["t/631",[4,2.147,9,2.657,10,2.657,11,2.657,12,2.35]],["t/633",[4,2.465,13,3.05,14,2.465,15,3.05]],["t/635",[16,3.58,17,3.58,18,2.893]],["t/643",[19,5.484]],["t/645",[20,5.484]],["t/647",[21,4.332,22,4.332]],["t/649",[23,5.484]],["t/651",[24,5.484]],["t/653",[25,5.484]],["t/655",[26,5.484]],["t/657",[27,4.332,28,4.332]],["t/661",[29,4.119]],["t/663",[30,3.05,31,3.05,32,3.05,33,2.697]],["t/665",[34,5.484]],["t/667",[35,5.484]],["t/671",[36,3.58,37,3.58,38,3.58]],["t/674",[39,2.354,40,2.354,41,2.354,42,2.354,43,1.661,44,1.661]],["t/676",[7,2.465,45,3.05,46,1.483,47,2.697]],["t/678",[48,5.484]],["t/680",[49,3.58,50,3.58,51,3.58]],["t/682",[7,2.893,8,3.166,52,3.58]],["t/684",[29,4.119]],["t/687",[53,4.85]],["t/689",[54,4.85]],["t/691",[44,3.87]],["t/693",[54,4.85]],["t/696",[55,3.831,56,4.332]],["t/698",[18,1.417,55,1.55,57,1.753,58,1.55,59,2.97,60,1.753,61,1.753,62,1.753]],["t/700",[63,2.113,64,2.113,65,2.113,66,2.113,67,2.113,68,2.113,69,1.868]],["t/702",[43,2.153,44,2.153,69,2.697,70,3.05]],["t/705",[71,5.484]],["t/707",[72,5.484]],["t/709",[44,3.87]],["t/711",[12,3.831,44,3.057]],["t/713",[3,3.831,47,3.831]],["t/715",[73,4.332,74,4.332]],["t/716",[75,4.85]],["t/718",[75,4.85]],["t/720",[76,3.329]],["t/722",[76,3.329]],["t/724",[77,5.484]],["t/726",[78,5.484]],["t/728",[29,4.119]],["t/732",[14,3.5,79,4.332]],["t/734",[80,3.58,81,3.58,82,3.58]],["t/736",[83,5.484]],["t/740",[29,1.996,33,2.35,43,1.875,53,2.35,84,2.657]],["t/746",[85,5.484]],["t/748",[86,3.87]],["t/750",[46,1.74,86,2.526,87,2.893]],["t/752",[46,1.74,86,2.526,88,2.391]],["t/754",[46,1.483,86,2.153,88,2.037,89,2.465]],["t/756",[90,3.254,91,3.254]],["t/758",[46,1.74,86,2.526,92,2.893]],["t/760",[93,2.954]],["t/761",[94,5.484]],["t/765",[95,2.893,96,4.332]],["t/767",[95,2.893,97,3.057]],["t/769",[46,1.483,87,2.465,95,2.037,97,2.153]],["t/771",[46,1.483,88,2.037,95,2.037,97,2.153]],["t/773",[46,1.292,88,1.775,89,2.147,95,1.775,97,1.875]],["t/775",[90,3.254,91,3.254]],["t/777",[46,1.483,92,2.465,95,2.037,97,2.153]],["t/779",[93,2.954]],["t/780",[98,4.85]],["t/785",[99,3.254,100,2.63]],["t/787",[101,3.329]],["t/789",[100,2.63,101,2.63]],["t/791",[93,2.954]],["t/792",[76,3.329]],["t/794",[102,3.329]],["t/798",[103,5.484]],["t/800",[104,3.87]],["t/802",[46,1.74,87,2.893,104,2.526]],["t/804",[46,1.74,88,2.391,104,2.526]],["t/806",[46,1.483,88,2.037,89,2.465,104,2.153]],["t/808",[90,3.254,91,3.254]],["t/810",[46,1.74,92,2.893,104,2.526]],["t/812",[93,2.954]],["t/813",[98,4.85]],["t/816",[99,3.254,100,2.63]],["t/818",[101,3.329]],["t/820",[100,2.63,101,2.63]],["t/822",[93,2.954]],["t/823",[76,3.329]],["t/825",[102,3.329]],["t/830",[99,3.254,100,2.63]],["t/832",[101,3.329]],["t/834",[100,2.63,101,2.63]],["t/836",[93,2.954]],["t/837",[76,3.329]],["t/839",[102,3.329]],["t/845",[105,4.119]],["t/847",[106,3.87]],["t/849",[93,2.954]],["t/850",[76,3.329]],["t/852",[102,3.329]],["t/856",[105,4.119]],["t/858",[106,3.87]],["t/860",[18,2.465,46,1.483,58,2.697,106,2.153]],["t/862",[93,2.954]],["t/863",[102,3.329]],["t/867",[105,4.119]],["t/869",[106,3.87]],["t/871",[93,2.954]],["t/872",[76,3.329]],["t/874",[102,3.329]],["t/881",[99,3.254,100,2.63]],["t/883",[101,3.329]],["t/885",[100,2.63,101,2.63]],["t/887",[93,2.954]],["t/888",[102,3.329]],["t/894",[105,4.119]],["t/896",[106,3.87]],["t/898",[93,2.954]],["t/899",[76,3.329]],["t/901",[102,3.329]],["t/923",[43,3.057,107,4.332]],["t/925",[14,3.5,43,3.057]],["t/927",[90,3.254,91,3.254]]],"invertedIndex":[["",{"_index":46,"t":{"676":{"position":[[15,1]]},"750":{"position":[[25,1]]},"752":{"position":[[25,1]]},"754":{"position":[[25,1]]},"758":{"position":[[25,1]]},"769":{"position":[[19,1]]},"771":{"position":[[19,1]]},"773":{"position":[[19,1]]},"777":{"position":[[19,1]]},"802":{"position":[[19,1]]},"804":{"position":[[19,1]]},"806":{"position":[[19,1]]},"810":{"position":[[19,1]]},"860":{"position":[[15,1]]}}}],["add(group",{"_index":95,"t":{"765":{"position":[[0,10]]},"767":{"position":[[0,10]]},"769":{"position":[[0,10]]},"771":{"position":[[0,10]]},"773":{"position":[[0,10]]},"777":{"position":[[0,10]]}}}],["api",{"_index":84,"t":{"740":{"position":[[28,3]]}}}],["array",{"_index":18,"t":{"635":{"position":[[14,5]]},"698":{"position":[[18,5]]},"860":{"position":[[24,5]]}}}],["async",{"_index":81,"t":{"734":{"position":[[4,5]]}}}],["authent",{"_index":38,"t":{"671":{"position":[[13,14]]}}}],["automat",{"_index":39,"t":{"674":{"position":[[0,9]]}}}],["await",{"_index":82,"t":{"734":{"position":[[10,5]]}}}],["basic",{"_index":79,"t":{"732":{"position":[[0,5]]}}}],["benchmark",{"_index":35,"t":{"667":{"position":[[0,10]]}}}],["bind",{"_index":50,"t":{"680":{"position":[[17,4]]}}}],["cach",{"_index":41,"t":{"674":{"position":[[20,6]]}}}],["callback",{"_index":107,"t":{"923":{"position":[[6,9]]}}}],["co",{"_index":83,"t":{"736":{"position":[[5,2]]}}}],["column",{"_index":59,"t":{"698":{"position":[[27,7],[56,6]]}}}],["compon",{"_index":22,"t":{"647":{"position":[[7,10]]}}}],["conexõ",{"_index":11,"t":{"631":{"position":[[19,8]]}}}],["config",{"_index":97,"t":{"767":{"position":[[11,7]]},"769":{"position":[[11,7]]},"771":{"position":[[11,7]]},"773":{"position":[[11,7]]},"777":{"position":[[11,7]]}}}],["configur",{"_index":48,"t":{"678":{"position":[[0,13]]}}}],["conjunto",{"_index":9,"t":{"631":{"position":[[7,8]]}}}],["connect",{"_index":44,"t":{"674":{"position":[[42,10]]},"691":{"position":[[0,10]]},"702":{"position":[[0,10]]},"709":{"position":[[0,10]]},"711":{"position":[[5,10]]}}}],["connectionopt",{"_index":94,"t":{"761":{"position":[[0,17]]}}}],["connectionuri",{"_index":96,"t":{"765":{"position":[[11,14]]}}}],["consulta",{"_index":2,"t":{"627":{"position":[[9,8]]}}}],["createconnection(config",{"_index":86,"t":{"748":{"position":[[0,24]]},"750":{"position":[[0,24]]},"752":{"position":[[0,24]]},"754":{"position":[[0,24]]},"758":{"position":[[0,24]]}}}],["createconnection(connectionuri",{"_index":85,"t":{"746":{"position":[[0,31]]}}}],["createpool(config",{"_index":104,"t":{"800":{"position":[[0,18]]},"802":{"position":[[0,18]]},"804":{"position":[[0,18]]},"806":{"position":[[0,18]]},"810":{"position":[[0,18]]}}}],["createpool(connectionuri",{"_index":103,"t":{"798":{"position":[[0,25]]}}}],["creation",{"_index":40,"t":{"674":{"position":[[10,9]]}}}],["custom",{"_index":70,"t":{"702":{"position":[[17,6]]}}}],["data",{"_index":65,"t":{"700":{"position":[[16,4]]}}}],["de",{"_index":10,"t":{"631":{"position":[[16,2]]}}}],["develop",{"_index":20,"t":{"645":{"position":[[0,11]]}}}],["em",{"_index":17,"t":{"635":{"position":[[11,2]]}}}],["environ",{"_index":19,"t":{"643":{"position":[[0,11]]}}}],["es7",{"_index":80,"t":{"734":{"position":[[0,3]]}}}],["event",{"_index":54,"t":{"689":{"position":[[0,6]]},"693":{"position":[[0,6]]}}}],["exampl",{"_index":29,"t":{"661":{"position":[[0,8]]},"684":{"position":[[0,8]]},"728":{"position":[[0,8]]},"740":{"position":[[0,8]]}}}],["execut",{"_index":47,"t":{"676":{"position":[[17,7]]},"713":{"position":[[10,7]]}}}],["execute(opt",{"_index":101,"t":{"787":{"position":[[0,16]]},"789":{"position":[[0,16]]},"818":{"position":[[0,16]]},"820":{"position":[[0,16]]},"832":{"position":[[0,16]]},"834":{"position":[[0,16]]},"883":{"position":[[0,16]]},"885":{"position":[[0,16]]}}}],["execute(sql",{"_index":99,"t":{"785":{"position":[[0,12]]},"816":{"position":[[0,12]]},"830":{"position":[[0,12]]},"881":{"position":[[0,12]]}}}],["externalcodeemb",{"_index":26,"t":{"655":{"position":[[0,17]]}}}],["extra",{"_index":21,"t":{"647":{"position":[[0,6]]}}}],["factor",{"_index":37,"t":{"671":{"position":[[6,6]]}}}],["faq",{"_index":25,"t":{"653":{"position":[[0,3]]}}}],["glossari",{"_index":93,"t":{"760":{"position":[[0,8]]},"779":{"position":[[0,8]]},"791":{"position":[[0,8]]},"812":{"position":[[0,8]]},"822":{"position":[[0,8]]},"836":{"position":[[0,8]]},"849":{"position":[[0,8]]},"862":{"position":[[0,8]]},"871":{"position":[[0,8]]},"887":{"position":[[0,8]]},"898":{"position":[[0,8]]}}}],["hash",{"_index":61,"t":{"698":{"position":[[46,4]]}}}],["helper",{"_index":52,"t":{"682":{"position":[[20,6]]}}}],["histori",{"_index":23,"t":{"649":{"position":[[0,7]]}}}],["incompat",{"_index":31,"t":{"663":{"position":[[6,17]]}}}],["infil",{"_index":67,"t":{"700":{"position":[[32,7]]}}}],["instal",{"_index":71,"t":{"705":{"position":[[0,12]]}}}],["instalação",{"_index":0,"t":{"625":{"position":[[0,10]]}}}],["instead",{"_index":60,"t":{"698":{"position":[[35,7]]}}}],["instruçõ",{"_index":5,"t":{"629":{"position":[[7,10]]}}}],["key",{"_index":62,"t":{"698":{"position":[[71,4]]}}}],["known",{"_index":30,"t":{"663":{"position":[[0,5]]}}}],["link",{"_index":91,"t":{"756":{"position":[[8,5]]},"775":{"position":[[8,5]]},"808":{"position":[[8,5]]},"927":{"position":[[8,5]]}}}],["load",{"_index":66,"t":{"700":{"position":[[26,5]]}}}],["local",{"_index":68,"t":{"700":{"position":[[44,5]]}}}],["manual",{"_index":45,"t":{"676":{"position":[[0,6]]}}}],["multi",{"_index":36,"t":{"671":{"position":[[0,5]]}}}],["mysql",{"_index":33,"t":{"663":{"position":[[34,5]]},"740":{"position":[[15,5]]}}}],["name",{"_index":55,"t":{"696":{"position":[[0,5]]},"698":{"position":[[63,4]]}}}],["node",{"_index":32,"t":{"663":{"position":[[29,4]]}}}],["o",{"_index":13,"t":{"633":{"position":[[7,1]]}}}],["okpacket",{"_index":78,"t":{"726":{"position":[[0,8]]}}}],["paramet",{"_index":51,"t":{"680":{"position":[[22,10]]}}}],["placehold",{"_index":56,"t":{"696":{"position":[[6,12]]}}}],["pool",{"_index":12,"t":{"631":{"position":[[28,7]]},"711":{"position":[[0,4]]}}}],["poolopt",{"_index":98,"t":{"780":{"position":[[0,11]]},"813":{"position":[[0,11]]}}}],["prepar",{"_index":7,"t":{"629":{"position":[[29,9]]},"676":{"position":[[7,7]]},"682":{"position":[[0,8]]}}}],["preparada",{"_index":6,"t":{"629":{"position":[[18,10]]}}}],["primeira",{"_index":1,"t":{"627":{"position":[[0,8]]}}}],["procedurecallpacket",{"_index":77,"t":{"724":{"position":[[0,19]]}}}],["promis",{"_index":14,"t":{"633":{"position":[[9,7]]},"732":{"position":[[6,7]]},"925":{"position":[[6,8]]}}}],["queri",{"_index":3,"t":{"627":{"position":[[18,7]]},"713":{"position":[[0,5]]}}}],["query(opt",{"_index":106,"t":{"847":{"position":[[0,14]]},"858":{"position":[[0,14]]},"860":{"position":[[0,14]]},"869":{"position":[[0,14]]},"896":{"position":[[0,14]]}}}],["query(sql",{"_index":105,"t":{"845":{"position":[[0,10]]},"856":{"position":[[0,10]]},"867":{"position":[[0,10]]},"894":{"position":[[0,10]]}}}],["queryopt",{"_index":102,"t":{"794":{"position":[[0,12]]},"825":{"position":[[0,12]]},"839":{"position":[[0,12]]},"852":{"position":[[0,12]]},"863":{"position":[[0,12]]},"874":{"position":[[0,12]]},"888":{"position":[[0,12]]},"901":{"position":[[0,12]]}}}],["rd",{"_index":89,"t":{"754":{"position":[[27,3]]},"773":{"position":[[21,3]]},"806":{"position":[[21,3]]}}}],["re",{"_index":42,"t":{"674":{"position":[[31,2]]}}}],["receiv",{"_index":57,"t":{"698":{"position":[[0,9]]}}}],["relat",{"_index":90,"t":{"756":{"position":[[0,7]]},"775":{"position":[[0,7]]},"808":{"position":[[0,7]]},"927":{"position":[[0,7]]}}}],["resourc",{"_index":34,"t":{"665":{"position":[[6,9]]}}}],["resultado",{"_index":16,"t":{"635":{"position":[[0,10]]}}}],["resultsethead",{"_index":76,"t":{"720":{"position":[[0,15]]},"722":{"position":[[0,17]]},"792":{"position":[[0,15]]},"823":{"position":[[0,15]]},"837":{"position":[[0,15]]},"850":{"position":[[0,15]]},"872":{"position":[[0,15]]},"899":{"position":[[0,15]]}}}],["row",{"_index":58,"t":{"698":{"position":[[10,4]]},"860":{"position":[[17,3]]}}}],["rowdatapacket",{"_index":75,"t":{"716":{"position":[[0,15]]},"718":{"position":[[0,17]]}}}],["run",{"_index":27,"t":{"657":{"position":[[0,7]]}}}],["send",{"_index":63,"t":{"700":{"position":[[0,7]]}}}],["serial",{"_index":49,"t":{"680":{"position":[[0,13]]}}}],["server",{"_index":53,"t":{"687":{"position":[[0,6]]},"740":{"position":[[21,6]]}}}],["sha1",{"_index":87,"t":{"750":{"position":[[27,4]]},"769":{"position":[[21,4]]},"802":{"position":[[21,4]]}}}],["sock",{"_index":92,"t":{"758":{"position":[[27,5]]},"777":{"position":[[21,5]]},"810":{"position":[[21,5]]}}}],["specif",{"_index":74,"t":{"715":{"position":[[5,13]]}}}],["ssl",{"_index":88,"t":{"752":{"position":[[27,3]]},"754":{"position":[[31,3]]},"771":{"position":[[21,3]]},"773":{"position":[[25,3]]},"804":{"position":[[21,3]]},"806":{"position":[[25,3]]}}}],["stabil",{"_index":24,"t":{"651":{"position":[[0,9]]}}}],["statement",{"_index":8,"t":{"629":{"position":[[39,11]]},"682":{"position":[[9,10]]}}}],["stream",{"_index":69,"t":{"700":{"position":[[50,7]]},"702":{"position":[[24,7]]}}}],["tabular",{"_index":64,"t":{"700":{"position":[[8,7]]}}}],["test",{"_index":28,"t":{"657":{"position":[[8,5]]}}}],["type",{"_index":73,"t":{"715":{"position":[[0,4]]}}}],["us",{"_index":43,"t":{"674":{"position":[[34,4]]},"702":{"position":[[11,5]]},"740":{"position":[[9,5]]},"923":{"position":[[0,5]]},"925":{"position":[[0,5]]}}}],["usag",{"_index":72,"t":{"707":{"position":[[0,5]]}}}],["usando",{"_index":4,"t":{"629":{"position":[[0,6]]},"631":{"position":[[0,6]]},"633":{"position":[[0,6]]}}}],["valu",{"_index":100,"t":{"785":{"position":[[13,7]]},"789":{"position":[[17,7]]},"816":{"position":[[13,7]]},"820":{"position":[[17,7]]},"830":{"position":[[13,7]]},"834":{"position":[[17,7]]},"881":{"position":[[13,7]]},"885":{"position":[[17,7]]}}}],["wrapper",{"_index":15,"t":{"633":{"position":[[17,7]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":622,"t":"O protocolo interno é escrito por @sidorares MySQL-Native Constants, interpolação de parâmetros SQL, Pooling e a classe ConnectionConfig foram retirados do node-mysql O Código de atualização SSL é baseado no código feito por @TooTallNate Flags de API de conexão segura / comprimida compatíveis com o cliente MariaSQL. Contribuidores","s":"Agradecimentos","u":"/node-mysql2/pt-BR/docs/acknowledgements","h":"","p":621},{"i":624,"t":"Cliente MySQL para Node.js com foco em performance. Suporta instruções preparadas (prepared statements), Codificações non-utf8, protocolo de log binário (binary log protocol), compressão, SSL e muito mais.","s":"MySQL2","u":"/node-mysql2/pt-BR/docs","h":"","p":623},{"i":626,"t":"O MySQL2 não tem restrições nativas e pode ser instalado no Linux, Mac OS ou Windows sem qualquer problema. JavaScript TypeScript npm install --save mysql2 npm install --save mysql2 npm install --save-dev @types/node Para documentação e exemplos usando TypeScript, veja aqui.","s":"Instalação","u":"/node-mysql2/pt-BR/docs","h":"#instalação","p":623},{"i":628,"t":"Para explorar mais exemplos de consulta (queries), visite a seção de exemplos Consultas Simples e Instruções Preparadas (Prepared Statements). Promise Callback // Obtém o cliente import mysql from 'mysql2/promise'; // Cria a conexão com o Banco de Dados const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // Consulta simples try { const [results, fields] = await connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45' ); console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } catch (err) { console.log(err); } // Utilizando espaços reservados (placeholders) try { const [results] = await connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45] ); console.log(results); } catch (err) { console.log(err); } // Obtém o cliente const mysql = require('mysql2'); // Cria a conexão com o Banco de Dados const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // Consulta simples connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45', function (err, results, fields) { console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } ); // Utilizando espaços reservados (placeholders) connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45], function (err, results) { console.log(results); } );","s":"Primeira Consulta (Query)","u":"/node-mysql2/pt-BR/docs","h":"#primeira-consulta-query","p":623},{"i":630,"t":"Com o MySQL2 você também pode obter Instruções Preparadas (Prepared Statements). Dessa forma o MySQL não precisa preparar um plano para a mesma consulta todas as vezes, resultando em um melhor desempenho. Se você não sabe por que isso é importante, veja essa discussão: Como as instruções preparadas (prepared statements) podem proteger contra ataques de injeção SQL O MySQL2 fornece o método auxiliar execute que irá preparar e consultar as declarações (statements) SQL. Além disso, você também pode usar os métodos prepare e unprepare para preparar ou desfazer a preparação de declarações (statements) manualmente, se necessário. Para explorar mais exemplos de Instruções Preparadas (Prepared Statements), visite a seção de exemplos Instruções Preparadas (Prepared Statements). Promise Callback import mysql from 'mysql2/promise'; try { // Cria a conexão com o Banco de Dados const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // \"execute\" irá chamar internamente a preparação e a consulta (query) const [results, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53] ); console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } catch (err) { console.log(err); } const mysql = require('mysql2'); // Cria a conexão com o Banco de Dados const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // \"execute\" irá chamar internamente a preparação e a consulta (query) connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53], function (err, results, fields) { console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } ); dica Se você executar a mesma declaração novamente, ela será selecionada a partir do LRU Cache, o que economizará tempo de preparação da consulta e proporcionará melhor desempenho.","s":"Usando Instruções Preparadas (Prepared Statements)","u":"/node-mysql2/pt-BR/docs","h":"#usando-instruções-preparadas-prepared-statements","p":623},{"i":632,"t":"O conjunto de conexões (pools) ajuda a reduzir o tempo gasto na conexão com o servidor MySQL, reutilizando uma conexão anterior e deixando-as abertas ao invés de fechá-las quando você termina de usá-las. Isto melhora a latência das consultas (queries), pois evita toda a sobrecarga associada à criação de uma nova conexão. Para explorar mais exemplos de Conjunto de Conexões (pools), visite a seção de exemplos createPool. Promise Callback import mysql from 'mysql2/promise'; // Cria a conexão (pool). As definições específicadas do \"createPool\" são as predefinições padrões const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // Máximo de conexões inativas; o valor padrão é o mesmo que \"connectionLimit\" idleTimeout: 60000, // Tempo limite das conexões inativas em milissegundos; o valor padrão é \"60000\" queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); const mysql = require('mysql2'); // Cria a conexão (pool). As definições específicadas do \"createPool\" são as predefinições padrões const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // Máximo de conexões inativas; o valor padrão é o mesmo que \"connectionLimit\" idleTimeout: 60000, // Tempo limite das conexões inativas em milissegundos; o valor padrão é \"60000\" queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); nota O pool não estabelece todas as conexões previamente, mas as cria sob demanda até que o limite de conexões seja atingido. Você pode usar o pool da mesma maneira como em uma conexão (usando pool.query() e pool.execute()): Promise Callback try { // Para a inicialização do \"pool\", veja acima const [rows, fields] = await pool.query('SELECT `field` FROM `table`'); // A conexão é automaticamente liberada quando a consulta (query) é resolvida } catch (err) { console.log(err); } // Para a inicialização do \"pool\", veja acima pool.query('SELECT `field` FROM `table`', function (err, rows, fields) { // A conexão é automaticamente liberada quando a consulta (query) é resolvida }); Alternativamente, também existe a possibilidade de adquirir manualmente uma conexão do pool e liberá-la posteriormente: Promise Callback // Para a inicialização do \"pool\", veja acima const conn = await pool.getConnection(); // Fazer algo com a conexão await conn.query(/* ... */); // Não se esqueça de liberar a conexão quando terminar! pool.releaseConnection(conn); // Para a inicialização do \"pool\", veja acima pool.getConnection(function (err, conn) { // Fazer algo com a conexão conn.query(/* ... */); // Não se esqueça de liberar a conexão quando terminar! pool.releaseConnection(conn); }); Adicionalmente, você pode liberar a conexão usando o objeto connection: conn.release();","s":"Usando Conjunto de Conexões (pools)","u":"/node-mysql2/pt-BR/docs","h":"#using-connection-pools","p":623},{"i":634,"t":"O MySQL2 também suporta Promise API. O que funciona muito bem com o ES7 async await. import mysql from 'mysql2/promise'; async function main() { // Cria a conexão com o Banco de Dados const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // Consulta no Banco de Dados const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); } O MySQL2 usa o objeto Promise padrão disponível no escopo. Mas você pode escolher qual implementação de Promise deseja usar. // Obtém o cliente import mysql from 'mysql2/promise'; // Obtém a implementação de \"Promise\" (nós usaremos o \"bluebird\") import bluebird from 'bluebird'; // Cria a conexão, especificando o \"bluebird\" como \"Promise\" const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', Promise: bluebird, }); // Consulta no Banco de Dados const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); MySQL2 also exposes a .promise() function on Pools, so you can create a promise/non-promise connections from the same pool. import mysql from 'mysql2'; async function main() { // create the pool const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', }); // now get a Promise wrapped instance of that pool const promisePool = pool.promise(); // query database using promises const [rows, fields] = await promisePool.query('SELECT 1'); } O MySQL2 também expõe o método .promise() em Pools, então você pode criar conexões \"promise/non-promise\" para o mesmo pool. const mysql = require('mysql2'); // Cria a conexão const conn = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); conn .promise() .query('SELECT 1') .then(([rows, fields]) => { console.log(rows); }) .catch(console.log) .then(() => conn.end());","s":"Usando o Promise Wrapper","u":"/node-mysql2/pt-BR/docs","h":"#usando-o-promise-wrapper","p":623},{"i":636,"t":"Se você tiver duas colunas com o mesmo nome, pode preferir receber os resultados como um array, em vez de um objeto, para evitar conflitos. Isso é uma divergência da biblioteca Node MySQL. Por exemplo: SELECT 1 AS `foo`, 2 AS `foo`. Você pode habilitar essa configuração tanto no nível de conexão (aplica-se a todas as consultas), quanto no nível de consulta (aplica-se apenas a essa consulta específica). Connection Level​ Promise Callback const conn = await mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); const conn = mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); Query Level​ Promise Callback try { const [results, fields] = await conn.query({ sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }); console.log(results); // nessa consulta, \"results\" contêm um array de arrays ao invés de um array de objetos console.log(fields); // \"fields\" mantêm-se inalterados } catch (err) { console.log(err); } conn.query( { sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }, function (err, results, fields) { console.log(results); // nessa consulta, \"results\" contêm um array de arrays ao invés de um array de objetos console.log(fields); // \"fields\" mantêm-se inalterados } ); Obtendo Ajuda Precisa de ajuda? Faça sua pergunta no Stack Overflow ou GitHub. Se você encontrou um erro, registre-o no GitHub.","s":"Resultados em Array","u":"/node-mysql2/pt-BR/docs","h":"#resultados-em-array","p":623},{"i":638,"t":"O MySQL2 é maioritariamente compatível com a API do Node MySQL. Uma incompatibilidade conhecida é que os valores em DECIMAL são retornados como strings, enquanto no Node MySQL eles são retornados como números. Isso inclui o resultado das funções SUM() e AVG() quando aplicadas a argumentos INTEGER. Isso é feito deliberadamente para evitar a perda de precisão - veja https://github.com/sidorares/node-mysql2/issues/935. info Se você encontrar qualquer outra incompatibilidade com o Node MySQL, por favor, reporte através do acompanhamento de Issues. Nós corrigiremos a incompatibilidade relatada como uma prioridade.","s":"API e Configuração","u":"/node-mysql2/pt-BR/docs/api-and-configurations","h":"","p":637},{"i":640,"t":"Quer melhorar algo no MySQL2? Consulte o arquivo Contributing.md para instruções detalhadas sobre como começar.","s":"Contribuições","u":"/node-mysql2/pt-BR/docs/contributing","h":"","p":639},{"i":642,"t":"This website is built using Docusaurus 3, a modern static website generator.","s":"Website Contributing Guidelines","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"","p":641},{"i":644,"t":"You will need these tools installed on your system: Node.js (18.x or higher)","s":"Environment","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#environment","p":641},{"i":646,"t":"Fork the MySQL2 repository. Download your forked repository locally. The website's workspace is the \"website\" directory in node-mysql2 root. Create a new branch from master (optional). Run cd website to enter the website workspace. Run npm ci to install the dependecies from package-lock.json. Run npm start to starting the local development. It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. For Docusaurus complete documentation, please see here. CLI example git clone https://github.com/sidorares/node-mysql2.git git checkout -b website # optional cd /path-to/node-mysql2/website npm ci npm start Documentation is auto-generated from MDX files placed in these directories: ./docs/documentation ./docs/examples ./docs/faq Caution Note that the website has its own package.json. Please, do not install dependencies for the website in node-mysql2 root.","s":"Development","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#development","p":641},{"i":648,"t":"Every extra component is thoroughly documented with complete typings descriptions. Docusaurus Markdown Features: The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences.","s":"Extras Components","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#extras-components","p":641},{"i":650,"t":"The History component displays version changes in a table format, listing version numbers alongside their changes. import { History } from '@site/src/components/History'; dica You can also utilize React components in the changes option. Example History Version Changes v1.0.0 Some change message.","s":"History","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#history","p":641},{"i":652,"t":"See the Stability Badges for more detais. import { Stability } from '@site/src/components/Stability'; dica You can also utilize React components in the message option. Available levels: 0, 1, 1.1, 1.2, 2 and 3. Example 2Stable 2Stable Some message.","s":"Stability","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#stability","p":641},{"i":654,"t":"import { FAQ } from '@site/src/components/FAQ'; > Some markdown (**MDX**) content. dica The FAQ component can be utilized in any section or page. Code blocks are compatible and can be used within the FAQ component. Example Title Some markdown (MDX) content.","s":"FAQ","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#faq","p":641},{"i":656,"t":"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; Example","s":"ExternalCodeEmbed","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#externalcodeembed","p":641},{"i":658,"t":"npm run test Check Prettier and ESLint rules for compliance npm run lintcheck Included in the GitHub Actions workflow. Check for typings errors 1Experimental Checks for MDX components are missing. npm run typecheck Included in the GitHub Actions workflow. Clear and build the website npm run clear npm run build Included in the GitHub Actions workflow. Fix issues from Prettier and ESLint rules npm run lint To prevent lint issues, it is recommended to execute this command before creating your commit. Not included in the GitHub Actions workflow.","s":"Running Tests","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#running-tests","p":641},{"i":660,"t":"MySQL2 aims to be a drop in replacement for Node MySQL. nota If you see any API incompatibilities with Node MySQL, please report via github issue. Not only MySQL2 offers better performance over Node MySQL, we also support these additional features: Prepared Statements Promise Wrapper Authentication Switch More Features MySQL Server Pooling SSL MySQL Compression Binary Log Protocol Client","s":"Documentation","u":"/node-mysql2/pt-BR/docs/documentation","h":"","p":659},{"i":662,"t":"Please check these examples for MySQL2.","s":"Examples","u":"/node-mysql2/pt-BR/docs/documentation","h":"#examples","p":659},{"i":664,"t":"zeroFill flag is ignored in type conversion. You need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you. DECIMAL and NEWDECIMAL types always returned as string unless you pass this config option: { decimalNumbers: true, } nota This option could lose precision on the number as Javascript Number is a Float!","s":"Known incompatibilities with Node MySQL","u":"/node-mysql2/pt-BR/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":659},{"i":666,"t":"Wire protocol documentation Node MySQL - Most popular node.js mysql client library node-mariasql - Bindings to libmariasql. One of the fastest clients node-libmysqlclient - Bindings to libmysqlclient go-mysql - MySQL Go client (prepared statements, binlog protocol, server)","s":"Other Resources","u":"/node-mysql2/pt-BR/docs/documentation","h":"#other-resources","p":659},{"i":668,"t":"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b npm run benchmarks node-mysql-benchmarks try to run example benchmarks on your system","s":"Benchmarks","u":"/node-mysql2/pt-BR/docs/documentation","h":"#benchmarks","p":659},{"i":670,"t":"During the connection phase the server may ask the client to switch to a different auth method. If the authPlugins connection config option is set, it must be an object where each key is the name of a potential authentication plugin requested by the server, and the corresponding value must be a function that optionally receives the connection config options and returns another function, which in turn, optionally receives the switch request data. The plugin is loaded with a ({user,password,...}) signature, and each call has a (pluginData) signature. Each call should make the plugin return any additional authentication data (Buffer) that should be sent back to the server, either synchronously or asynchronously using a Promise, or should yield an error accordingly. Example: (imaginary ssh-key-auth plugin) pseudo code const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authPlugins: { 'ssh-key-auth': function ({ password }) { return function (pluginData) { return getPrivate(key) .then((key) => { const response = encrypt(key, password, pluginData); // continue handshake by sending response data return response; }) .catch((err) => { // throw error to propagate error to connect/changeUser handlers }); }; }, }, }); There is also a deprecated API where if a authSwitchHandler connection config option is set it must be a function that receives switch request data and responds via a callback. In this case, the first invocation always has a ({pluginName, pluginData}) signature, following calls - ({pluginData}). The client replies with an opaque blob matching the requested plugin via callback(null, data: Buffer). const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authSwitchHandler: function ({ pluginName, pluginData }, cb) { if (pluginName === 'ssh-key-auth') { getPrivateKey((key) => { const response = encrypt(key, pluginData); // continue handshake by sending response data // respond with error to propagate error to connect/changeUser handlers cb(null, response); }); } else { const err = new Error( `Unknown AuthSwitchRequest plugin name ${pluginName}` ); err.fatal = true; cb(err); } }, }); The initial handshake is always performed using mysql_native_password plugin. This will be possible to override in future versions. Note that if the mysql_native_password method is requested it will be handled internally according to Authentication::Native41 and no authPlugins function or the authSwitchHandler will be invoked. These MAY be called multiple times if the plugin algorithm requires multiple roundtrips of data exchange between client and server.","s":"Authentication Switch Request","u":"/node-mysql2/pt-BR/docs/documentation/authentication-switch","h":"","p":669},{"i":672,"t":"If the user requires multi-factor authentication in the server, the client will receive a AuthNextFactor request, which is similar in structure to the regular authentication switch request and contains the name and possible initial data for the additional authentication factor plugin (up to 3). Additional passwords can be provided using the connection config options - password2 and password3. Again, for each authentication factor, multiple roundtrips of data exchange can be required by the plugin algoritm. const conn = mysql.createConnection({ user: 'test_user', password: 'secret1', password2: 'secret2', password3: 'secret3', database: 'test_database', authPlugins: { // password1 === password 'auth-plugin1': function ({ password1 }) { return function (serverPluginData) { return clientPluginData(password1, serverPluginData); }; }, 'auth-plugin2': function ({ password2 }) { return function (serverPluginData) { return clientPluginData(password2, serverPluginData); }; }, 'auth-plugin3': function ({ password3 }) { return function (serverPluginData) { return clientPluginData(password3, serverPluginData); }; }, }, });","s":"Multi-factor authentication","u":"/node-mysql2/pt-BR/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":669},{"i":675,"t":"Similar to connection.query(). connection.execute('select 1 + ? + ? as result', [5, 6], (err, rows) => { // rows: [ { result: 12 } ] // internally 'select 1 + ? + ? as result' is prepared first. On subsequent calls cached statement is re-used }); // close cached statement for 'select 1 + ? + ? as result'. noop if not in cache connection.unprepare('select 1 + ? + ? as result'); Note that connection.execute() will cache the prepared statement for better performance, remove the cache with connection.unprepare() when you're done.","s":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":673},{"i":677,"t":"Manually prepared statements doesn't comes with LRU cache and SHOULD be closed using statement.close() instead of connection.unprepare(). connection.prepare('select ? + ? as tests', (err, statement) => { // statement.parameters - array of column definitions, length === number of params, here 2 // statement.columns - array of result column definitions. Can be empty if result schema is dynamic / not known // statement.id // statement.query statement.execute([1, 2], (err, rows, columns) => { // -> [ { tests: 3 } ] }); // don't use connection.unprepare(), it won't work! // note that there is no callback here. There is no statement close ack at protocol level. statement.close(); }); Note that you should not use statement after connection reset (changeUser() or disconnect). Statement scope is connection, you need to prepare statement for each new connection in order to use it.","s":"Manual prepare / execute","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":673},{"i":679,"t":"maxPreparedStatements : We keep the cached statements in a lru-cache. Default size is 16000 but you can use this option to override it. Any statements that are dropped from cache will be closed.","s":"Configuration","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#configuration","p":673},{"i":681,"t":"The bind parameter values passed to execute are serialized JS -> MySQL as: null -> NULL number -> DOUBLE boolean -> TINY (0 for false, 1 for true) object -> depending on prototype: Date -> DATETIME JSON like object - JSON Buffer -> VAR_STRING Other -> VAR_STRING Passing in undefined or a function will result in an error.","s":"Serialization of bind parameters","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":673},{"i":683,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [1, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.unprepare('select ?+1 as qqq, ? as rrr, ? as yyy'); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); } ); } ); } );","s":"Prepared Statements Helper","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":673},{"i":685,"t":"For Prepared Statements examples, please see here.","s":"Examples","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#examples","p":673},{"i":688,"t":"createServer() - creates server instance Server.listen - listen port / unix socket (same arguments as net.Server.listen)","s":"Server","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#server","p":686},{"i":690,"t":"connect new incoming connection.","s":"Events","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#events","p":686},{"i":692,"t":"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags }) send server handshake initialisation packet, wait handshake response and start listening for commands writeOk({ affectedRows: num, insertId: num }) send OK packet to client writeEof(warnings, statusFlags) send EOF packet writeTextResult(rows, fields) write query result to client. Rows and fields are in the same format as in connection.query callback. writeColumns(fields) write fields + EOF packets. writeTextRow(row) write array (not hash!) of values as result row TODO: binary protocol","s":"Connection","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#connection","p":686},{"i":694,"t":"Every command packet received by the server will be emitted as a packet event with the parameters: packet: Packet The packet itself knownCommand: boolean is this command known to the server *commandCode: number the parsed command code (first byte) In addition special events are emitted for commands received from the client. If no listener is present a fallback behavior will be invoked. quit() Default: close the connection init_db(schemaName: string) Default: return OK query(sql: string) Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR field_list(table: string, fields: string) Default: return ER_WARN_DEPRECATED_SYNTAX ping() - Default: return OK","s":"Events","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#events-1","p":686},{"i":697,"t":"You can use named placeholders for parameters by setting namedPlaceholders config value or query/execute time option. Named placeholders are converted to unnamed ? on the client (mysql protocol does not support named parameters). If you reference parameter multiple times under the same name it is sent to server multiple times. Unnamed placeholders can still be used by providing the values as an array instead of an object. connection.config.namedPlaceholders = true; connection.execute('select :x + :y as z', { x: 1, y: 2 }, (err, rows) => { // statement prepared as \"select ? + ? as z\" and executed with [1,2] values // rows returned: [ { z: 3 } ] }); connection.execute('select :x + :x as z', { x: 1 }, (err, rows) => { // select ? + ? as z, execute with [1, 1] }); connection.query('select :x + :x as z', { x: 1 }, (err, rows) => { // query select 1 + 1 as z }); // unnamed placeholders are still valid if the values are provided in an array connection.query('select ? + ? as z', [1, 1], (err, rows) => { // query select 1 + 1 as z });","s":"Named placeholders","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#named-placeholders","p":695},{"i":699,"t":"const options = { sql: 'select A,B,C,D from foo', rowsAsArray: true }; connection.query(options, (err, results) => { /* results will be an array of arrays like this now: [[ 'field A value', 'field B value', 'field C value', 'field D value', ], ...] */ });","s":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":695},{"i":701,"t":"In addition to sending local fs files you can send any stream using infileStreamFactory query option. If set, it has to be a function that return a readable stream. It gets file path from query as a parameter. Note: starting from version 2.0 infileStreamFactory is required parameter for LOAD DATA LOCAL INFILE. Response from server indicates that it wants access to a local file and no infileStreamFactory option is provided the query ends with error. // local file connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)', onInserted1 ); // local stream const sql = 'LOAD DATA LOCAL INFILE \"mystream\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)'; connection.query( { sql: sql, infileStreamFactory: function (path) { return getStream(); }, }, onInserted2 ); The infileStreamFactory option may also be set at a connection-level: const fs = require('fs'); const mysql = require('mysql2'); const connection = mysql.createConnection({ user: 'test', database: 'test', infileStreamFactory: (path) => { // Validate file path const validPaths = ['/tmp/data.csv']; if (!validPaths.includes(path)) { throw new Error( `invalid file path: ${path}: expected to be one of ${validPaths.join( ',' )}` ); } return fs.createReadStream(path); }, }); connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test', onInserted );","s":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":695},{"i":703,"t":"const net = require('net'); const mysql = require('mysql2'); const shape = require('shaper'); const connection = mysql.createConnection({ user: 'test', database: 'test', stream: net.connect('/tmp/mysql.sock').pipe(shape(10)), // emulate 10 bytes/sec link }); connection.query('SELECT 1+1 as test1', console.log); stream also can be a function. In that case function result has to be duplex stream, and it is used for connection transport. This is required if you connect pool using custom transport as new pooled connection needs new stream. Example connecting over socks5 proxy: const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ database: 'test', user: 'foo', password: 'bar', stream: function (cb) { const newStream = new SocksConnection( { host: 'remote.host', port: 3306 }, { host: 'localhost', port: 1080 } ); cb(null, newStream); }, }); In addition to password createConnection(), createPool() and changeUser() accept passwordSha1 option. This is useful when implementing proxies as plaintext password might be not available.","s":"Connecting using custom stream:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#connecting-using-custom-stream","p":695},{"i":706,"t":"npm install --save mysql2 npm install --save-dev @types/node The @types/node ensure the proper interaction between TypeScript and the Node.js modules used by MySQL2 (net, events, stream, tls, etc.). info Requires TypeScript >=4.5.2.","s":"Installation","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#installation","p":704},{"i":708,"t":"You can import MySQL2 in two ways: By setting the esModuleInterop option to true in tsconfig.json import mysql from 'mysql2'; import mysql from 'mysql2/promise'; By setting the esModuleInterop option to false in tsconfig.json import * as mysql from 'mysql2'; import * as mysql from 'mysql2/promise';","s":"Usage","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#usage","p":704},{"i":710,"t":"import mysql, { ConnectionOptions } from 'mysql2'; const access: ConnectionOptions = { user: 'test', database: 'test', }; const conn = mysql.createConnection(access);","s":"Connection","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#connection","p":704},{"i":712,"t":"import mysql, { PoolOptions } from 'mysql2'; const access: PoolOptions = { user: 'test', database: 'test', }; const conn = mysql.createPool(access);","s":"Pool Connection","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#pool-connection","p":704},{"i":714,"t":"A simple query​ conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); conn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); The rows output will be these possible types: RowDataPacket[] RowDataPacket[][] ResultSetHeader ResultSetHeader[] ProcedureCallPacket In this example, you need to manually check the output types","s":"Query and Execute","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#query-and-execute","p":704},{"i":717,"t":"2Stable An array with the returned rows, for example: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); // SELECT conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { test: 2 } ] */ }); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { Tables_in_test: 'test' } ] */ }); Using rowsAsArray option as true: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', rowsAsArray: true, }); // SELECT conn.query( 'SELECT 1 + 1 AS test, 2 + 2 AS test;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 2, 4 ] ] */ } ); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 'test' ] ] */ });","s":"RowDataPacket[]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#rowdatapacket","p":704},{"i":719,"t":"2Stable Using multipleStatements option as true with multiple queries: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SELECT 1 + 1 AS test; SELECT 2 + 2 AS test; `; conn.query(sql, (_err, rows) => { console.log(rows); /** * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ] */ });","s":"RowDataPacket[][]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":704},{"i":721,"t":"2Stable History Version Changes v3.5.1 OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead. changedRows option is deprecated and might be removed in the future major release. Please use affectedRows instead. For INSERT, UPDATE, DELETE, TRUNCATE, etc.: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); const sql = ` SET @1 = 1; `; conn.query(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ });","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#resultsetheader","p":704},{"i":723,"t":"2Stable History Version Changes v3.5.1 Introduce ResultSetHeader[] For multiples INSERT, UPDATE, DELETE, TRUNCATE, etc. when using multipleStatements as true: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SET @1 = 1; SET @2 = 2; `; conn.query(sql, (_err, results) => { console.log(results); /** * @results: [ ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 10, warningStatus: 0, changedRows: 0 }, ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } ] */ });","s":"ResultSetHeader[]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":704},{"i":725,"t":"2Stable History Version Changes v3.5.1 Introduce ProcedureCallPacket dica By performing a Call Procedure using INSERT, UPDATE, etc., the return will be a ProcedureCallPacket (even if you perform multiples queries and set multipleStatements to true): import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); /** ResultSetHeader */ conn.query('DROP PROCEDURE IF EXISTS myProcedure'); /** ResultSetHeader */ conn.query(` CREATE PROCEDURE myProcedure() BEGIN SET @1 = 1; SET @2 = 2; END `); /** ProcedureCallPacket */ const sql = 'CALL myProcedure()'; conn.query>(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ }); For CREATE PROCEDURE and DROP PROCEDURE, these returns will be the default ResultSetHeader. By using SELECT and SHOW queries in a Procedure Call, it groups the results as: /** ProcedureCallPacket */ [RowDataPacket[], ResultSetHeader] For ProcedureCallPacket, please see the following examples.","s":"ProcedureCallPacket","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":704},{"i":727,"t":"0Deprecated OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead.","s":"OkPacket","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#okpacket","p":704},{"i":729,"t":"You can also check some code examples using MySQL2 and TypeScript to understand advanced concepts: Extending and using Interfaces with RowDataPacket Extending and using Interfaces with RowDataPacket and rowAsArray Extending and using Interfaces with RowDataPacket and multipleStatements Extending and using Interfaces with RowDataPacket, rowAsArray and multipleStatements Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket from ProcedureCallPacket Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket and rowAsArray from ProcedureCallPacket Creating a basic custom MySQL2 Class","s":"Examples","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#examples","p":704},{"i":731,"t":"In addition to errback interface there is thin wrapper to expose Promise-based api","s":"Promise Wrappers","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"","p":730},{"i":733,"t":"/* eslint-env es6 */ const mysql = require('mysql2/promise'); // or require('mysql2').createConnectionPromise mysql .createConnection({ /* same parameters as for non-promise createConnection */ }) .then((conn) => conn.query('select foo from bar')) .then(([rows, fields]) => console.log(rows[0].foo)); const pool = require('mysql2/promise').createPool({}); // or require('mysql2').createPoolPromise({}) or require('mysql2').createPool({}).promise() pool .getConnection() .then((conn) => { const res = conn.query('select foo from bar'); conn.release(); return res; }) .then((result) => { console.log(result[0][0].foo); }) .catch((err) => { console.log(err); // any of connection time or query time errors from above });","s":"Basic Promise","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#basic-promise","p":730},{"i":735,"t":"async function example1() { const mysql = require('mysql2/promise'); const conn = await mysql.createConnection({ database: test }); const [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]); await conn.end(); } async function example2() { const mysql = require('mysql2/promise'); const pool = mysql.createPool({ database: test }); // execute in parallel, next console.log in 3 seconds await Promise.all([ pool.query('select sleep(2)'), pool.query('select sleep(3)'), ]); console.log('3 seconds after'); await pool.end(); }","s":"ES7 Async Await","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#es7-async-await","p":730},{"i":737,"t":"const mysql = require('mysql2'); const co = require('co'); co(function* () { const c = yield mysql.createConnectionPromise({ user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }); Examples in /examples/promise-co-await","s":"With CO","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#with-co","p":730},{"i":739,"t":"dica To explore the examples, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Examples","u":"/node-mysql2/pt-BR/docs/examples","h":"","p":738},{"i":741,"t":"MySQL-pg-proxy - MySQL to Postgres proxy server. MySQLite.js - MySQL server with JS-only (emscripten compiled) sqlite backend. SQL-engine - MySQL server with LevelDB backend. MySQL-osquery-proxy - Connect to facebook osquery using MySQL client PlyQL - Connect to Druid using MySQL client","s":"Examples using MySQL server API","u":"/node-mysql2/pt-BR/docs/examples","h":"#examples-using-mysql-server-api","p":738},{"i":743,"t":"index.js 'use strict'; const mysql = require('mysql2'); const through2 = require('through2'); const binlogStream = mysql.createBinlogStream({ serverId: 123, // slave ID, first field in \"show slave hosts\" sql response // you can also specify slave host, username, password and port masterId: 0, filename: 'mysql-bin.000007', binlogPos: 120, flags: 1, // 1 = \"non-blocking mode\" }); binlogStream.pipe( through2.obj((obj, enc, next) => { console.log(obj); next(); }) );","s":"Binlog Watcher","u":"/node-mysql2/pt-BR/docs/examples/binlog-watcher","h":"","p":742},{"i":745,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createConnection","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"","p":744},{"i":747,"t":"createConnection(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":744},{"i":749,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":744},{"i":751,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":744},{"i":753,"t":"createConnection(config: ConnectionOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); connection.addListener('error', (err) => { console.log(err); }); See ssl/certs.","s":"createConnection(config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":744},{"i":755,"t":"createConnection(config: ConnectionOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await connection.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); connection.addListener('error', (err) => { console.log(err); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { connection.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); });","s":"createConnection(config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":744},{"i":757,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#related-links","p":744},{"i":759,"t":"createConnection(config: ConnectionOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const connection = mysql.createConnection({ stream: socksProxy, }); connection.addListener('error', (err) => { console.log(err); }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const connection = mysql.createConnection({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); connection.addListener('error', (err) => { console.log(err); }); Testing connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createConnection(config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":744},{"i":762,"t":"ConnectionOptions Specification","s":"ConnectionOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#connectionoptions","p":744},{"i":764,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPoolCluster","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"","p":763},{"i":766,"t":"add(group: string, connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":763},{"i":768,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config)","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":763},{"i":770,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":763},{"i":772,"t":"add(group: string, config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":763},{"i":774,"t":"add(group: string, config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await poolCluster.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { poolCluster.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":763},{"i":776,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#related-links","p":763},{"i":778,"t":"add(group: string, config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { stream: socksProxy, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); Testing poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"add(group, config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":763},{"i":781,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":763},{"i":783,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. See detailed documentaion in Prepared Statements. dica If you execute same statement again, it will be picked form a LRU cache which will save query preparation time and give better performance. Usage examples: INSERT SELECT UPDATE DELETE","s":"Prepared Statements","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements","h":"","p":782},{"i":786,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":784},{"i":788,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":784},{"i":790,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":784},{"i":793,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":784},{"i":795,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":784},{"i":797,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPool","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"","p":796},{"i":799,"t":"createPool(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":796},{"i":801,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig","p":796},{"i":803,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":796},{"i":805,"t":"createPool(config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":796},{"i":807,"t":"createPool(config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await pool.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { pool.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":796},{"i":809,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#related-links","p":796},{"i":811,"t":"createPool(config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const pool = mysql.createPool({ stream: socksProxy, }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); Testing pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createPool(config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":796},{"i":814,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#pooloptions","p":796},{"i":817,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":815},{"i":819,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":815},{"i":821,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":815},{"i":824,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":815},{"i":826,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":815},{"i":828,"t":"await.js co.js .babelrc package.json 'use strict'; const mysql = require('mysql2/promise'); async function test() { const c = await mysql.createConnection({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log('connected!'); const [rows, fields] = await c.query('show databases'); console.log(rows); try { const [rows, fields] = await c.query('some invalid sql here'); } catch (e) { console.log('caught exception!', e); } console.log(await c.execute('select sleep(0.5)')); console.log('after first sleep'); console.log(await c.execute('select sleep(0.5)')); console.log('after second sleep'); let start = +new Date(); console.log( await Promise.all([ c.execute('select sleep(2.5)'), c.execute('select sleep(2.5)'), ]) ); console.log( 'after 2+3 parallel sleep which is in fact not parallel because commands are queued per connection' ); let end = +new Date(); console.log(end - start); await c.end(); const p = mysql.createPool({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log(await p.execute('select sleep(0.5)')); console.log('after first pool sleep'); start = +new Date(); console.log( await Promise.all([ p.execute('select sleep(2.5)'), p.execute('select sleep(2.5)'), ]) ); console.log('after 2+3 parallel pool sleep'); end = +new Date(); console.log(end - start); await p.end(); } test() .then(() => { console.log('done'); }) .catch((err) => { console.log('error!', err); throw err; }); 'use strict'; const mysql = require('mysql2/promise'); const co = require('co'); co(function* () { const c = yield mysql.createConnection({ port: 3306, user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }) .then(function () { console.log('done'); }) .catch(function (err) { console.log(err); throw err; }); { \"plugins\": [\"transform-async-to-generator\"] } { \"name\": \"promise-co-await\", \"version\": \"1.0.0\", \"description\": \"\", \"main\": \"await.js\", \"scripts\": { \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\" }, \"author\": \"\", \"license\": \"ISC\", \"dependencies\": { \"babel-cli\": \"^6.9.0\" } }","s":"await — co","u":"/node-mysql2/pt-BR/docs/examples/promise-wrapper/co-await","h":"","p":827},{"i":831,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":829},{"i":833,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":829},{"i":835,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":829},{"i":838,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":829},{"i":840,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":829},{"i":842,"t":"info For Prepared Statements or Placeholders / Parameters examples, please see here. Usage examples: INSERT SELECT UPDATE DELETE","s":"Simple Queries","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries","h":"","p":841},{"i":844,"t":"The examples below also work for the execute method.","s":"DELETE","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"","p":843},{"i":846,"t":"query(sql: string) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#querysql","p":843},{"i":848,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":843},{"i":851,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":843},{"i":853,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":843},{"i":855,"t":"The examples below also work for the execute method.","s":"SELECT","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"","p":854},{"i":857,"t":"query(sql: string) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query(sql); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query(sql, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#querysql","p":854},{"i":859,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":854},{"i":861,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, rowsAsArray: true, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, rowsAsArray: true, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server as array fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options) — Row as Array","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":854},{"i":864,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":854},{"i":866,"t":"The examples below also work for the execute method.","s":"INSERT","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"","p":865},{"i":868,"t":"query(sql: string) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#querysql","p":865},{"i":870,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":865},{"i":873,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":865},{"i":875,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":865},{"i":877,"t":"index.js 'use strict'; const mysql = require('mysql2'); const ClientFlags = require('mysql2/lib/constants/client.js'); const server = mysql.createServer(); server.listen(3307); server.on('connection', (conn) => { console.log('connection'); conn.serverHandshake({ protocolVersion: 10, serverVersion: 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, capabilityFlags: 0xffffff ^ ClientFlags.COMPRESS, }); conn.on('field_list', (table, fields) => { console.log('field list:', table, fields); conn.writeEof(); }); const remote = mysql.createConnection({ user: 'root', database: 'dbname', host: 'server.example.com', password: 'secret', }); conn.on('query', (sql) => { console.log(`proxying query: ${sql}`); remote.query(sql, function (err) { // overloaded args, either (err, result :object) // or (err, rows :array, columns :array) if (Array.isArray(arguments[1])) { // response to a 'select', 'show' or similar const rows = arguments[1], columns = arguments[2]; console.log('rows', rows); console.log('columns', columns); conn.writeTextResult(rows, columns); } else { // response to an 'insert', 'update' or 'delete' const result = arguments[1]; console.log('result', result); conn.writeOk(result); } }); }); conn.on('end', remote.end.bind(remote)); });","s":"MySQL Proxy","u":"/node-mysql2/pt-BR/docs/examples/tests/mysql-proxy","h":"","p":876},{"i":879,"t":"index.js 'use strict'; const pool = require('mysql2').createPool({ host: 'localhost', user: 'root', database: 'test', password: 'root', }); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.query((err, rows, fields) => { console.log(rows, fields); // Connection is automatically released once query resolves }); } }, 1000); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.getConnection((err, db) => { db.query('select sleep(0.5) as qqq', (err, rows, fields) => { console.log(rows, fields); db.release(); }); }); } }, 1000);","s":"Pool","u":"/node-mysql2/pt-BR/docs/examples/tests/pool","h":"","p":878},{"i":882,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute(sql, values); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute(sql, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":880},{"i":884,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute({ sql, values, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, values, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":880},{"i":886,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, // ... other options }, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":880},{"i":889,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":880},{"i":891,"t":"index.js 'use strict'; const mysql = require('mysql2'); const flags = require('mysql2/lib/constants/client.js'); const auth = require('mysql2/lib/auth_41.js'); function authenticate(params, cb) { console.log(params); const doubleSha = auth.doubleSha1('pass123'); const isValid = auth.verifyToken( params.authPluginData1, params.authPluginData2, params.authToken, doubleSha ); if (isValid) { cb(null); } else { // for list of codes lib/constants/errors.js cb(null, { message: 'wrong password dude', code: 1045 }); } } const server = mysql.createServer(); server.listen(3333); server.on('connection', (conn) => { // we can deny connection here: // conn.writeError({ message: 'secret', code: 123 }); // conn.close(); conn.serverHandshake({ protocolVersion: 10, serverVersion: '5.6.10', // 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, // capabilityFlags: 0xffffff, // capabilityFlags: -2113931265, capabilityFlags: 2181036031, authCallback: authenticate, }); conn.on('field_list', (table, fields) => { console.log('FIELD LIST:', table, fields); conn.writeEof(); }); conn.on('query', (query) => { conn.writeColumns([ { catalog: 'def', schema: 'test', table: 'test_table', orgTable: 'test_table', name: 'beta', orgName: 'beta', characterSet: 33, columnLength: 384, columnType: 253, flags: 0, decimals: 0, }, ]); conn.writeTextRow(['test тест テスト փորձարկում পরীক্ষা kiểm tra ']); conn.writeTextRow(['ტესტი પરીક્ષણ מבחן פּרובירן اختبار परीक्षण']); conn.writeEof(); conn.close(); }); });","s":"Server","u":"/node-mysql2/pt-BR/docs/examples/tests/server","h":"","p":890},{"i":893,"t":"The examples below also work for the execute method.","s":"UPDATE","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"","p":892},{"i":895,"t":"query(sql: string) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#querysql","p":892},{"i":897,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":892},{"i":900,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":892},{"i":902,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":892},{"i":904,"t":"index.ts db.ts /** * The types are explicity for learning purpose */ import { PoolOptions } from 'mysql2/promise'; import { MySQL } from './db.js'; interface User extends RowDataPacket { id: number; name: string; } const access: PoolOptions = { host: '', user: '', password: '', database: '', }; (async () => { const mysql = new MySQL(access); /** Deleting the `users` table, if it exists */ await mysql.queryResult('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await mysql.queryResult( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await mysql.executeResult( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await mysql.queryRows( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user: User) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await mysql.connection.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */ /** * The types are explicity for learning purpose */ import { createPool, PoolOptions, Pool, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; export class MySQL { private conn: Pool; private credentials: PoolOptions; constructor(credentials: PoolOptions) { this.credentials = credentials; this.conn = createPool(this.credentials); } /** A random method to simulate a step before to get the class methods */ private ensureConnection() { if (!this?.conn) this.conn = createPool(this.credentials); } /** For `SELECT` and `SHOW` */ get queryRows() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get queryRowsAsArray() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get queryResult() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get queryResults() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` */ get executeRows() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get executeRowsAsArray() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get executeResult() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get executeResults() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** Expose the Pool Connection */ get connection() { return this.conn; } }","s":"Basic Custom Class","u":"/node-mysql2/pt-BR/docs/examples/typescript/basic-custom-class","h":"","p":903},{"i":906,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/index","h":"","p":905},{"i":908,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/row-as-array","h":"","p":907},{"i":910,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/multi-statements","h":"","p":909},{"i":912,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user.id); console.log('name:', user.name); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet","u":"/node-mysql2/pt-BR/docs/examples/typescript/procedure-call/index","h":"","p":911},{"i":914,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/procedure-call/row-as-array","h":"","p":913},{"i":916,"t":"This section provides answers to commonly asked questions about MySQL2. dica To explore the FAQs, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Frequently Asked Questions","u":"/node-mysql2/pt-BR/docs/faq","h":"","p":915},{"i":918,"t":"O projeto MySQL2 é uma continuação do MySQL-Native. O código do analisador de protocolo (protocol parser) foi reescrito do zero e a API foi alterada para corresponder ao popular mysqljs/mysql. A equipe do MySQL2 está trabalhando em conjunto com a equipe do mysqljs/mysql para fatorar o código compartilhado e movê-lo para a organização mysqljs. O MySQL2 é maioritariamente compatível com a API do mysqljs e suporta a maioria de suas funcionalidades. O MySQL2 também oferece essas funcionalidades adicionais: Desempenho mais rápido / melhor Instruções Preparadas (Prepared Statements) Protocolo de log binário MySQL (MySQL Binary Log Protocol) Servidor MySQL Estende o suporte para Encoding and Collation Promise Wrapper Compressão SSL e Authentication Switch Streams Personalizados Conjunto de Conexões (Pooling)","s":"História e Porque o MySQL2","u":"/node-mysql2/pt-BR/docs/history-and-why-mysq2","h":"","p":917},{"i":920,"t":"The Stability Badges are indications of a section's stability. The stability indices are as follows: 0Deprecated The feature might generate warnings and does not assure backward compatibility. Experimental: These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged. Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features. Experimental features are classified into stages: 1Experimental Experimental features at this stage are currently in development and prone to considerable changes. 1.1Early Development Experimental features at this stage are approaching minimum viability. 1.2Release Candidate Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification. 2Stable Compatibility with the MySQL ecosystem is a high priority. 3Legacy This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available. Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed.","s":"Stability Badges","u":"/node-mysql2/pt-BR/docs/stability-badges","h":"","p":919},{"i":922,"t":"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.","s":"How to handle errors?","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"","p":921},{"i":924,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors by adding an error event listener: const mysql = require('mysql2'); connection = mysql.createConnection({ host: '', user: '', database: '', }); connection.addListener('error', (err) => { if (err instanceof Error) { console.log(`createConnection error:`, err); } }); createPool 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const pool = mysql.createPool({ host: '', user: '', database: '', }); pool.getConnection((err, connection) => { if (err instanceof Error) { console.log('pool.getConnection error:', err); return; } }); createPoolCluster 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); poolCluster.getConnection('NodeI', (err, connection) => { if (err instanceof Error) { console.log('poolCluster.getConnection error:', err); return; } }); execute 2Stable This solution has been tested. Handling execute errors through callback's err parameter: connection.execute('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('execute error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through callback's err parameter: connection.query('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('query error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using callbacks","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":921},{"i":926,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: '', user: '', database: '', }); } catch (err) { if (err instanceof Error) { console.log(err); } } createPool 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const pool = mysql.createPool({ host: '', user: '', database: '', }); try { const connection = await pool.getConnection(); } catch (err) { if (err instanceof Error) { console.log(err); } } createPoolCluster 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); try { await poolCluster.getConnection('NodeI'); } catch (err) { if (err instanceof Error) { console.log('createConnection error:', err); } } execute 2Stable This solution has been tested. Handling execute errors through try-catch block: try { const [rows] = await connection.execute('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('execute error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through try-catch block: try { const [rows] = await connection.query('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('query error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using promises","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#using-promises","p":921},{"i":928,"t":"Discussions #1998 #2282","s":"Related Links","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#related-links","p":921},{"i":930,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/row-as-array-multi-statements","h":"","p":929}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/622",[0,4.519,1,4.45,2,5.461,3,0.693,4,5.461,5,5.382,6,5.461,7,1.363,8,4.851,9,5.461,10,5.461,11,4.963,12,5.461,13,1.721,14,2.401,15,3.259,16,4.45,17,5.461,18,5.461,19,5.461,20,3.541,21,6.292,22,5.461,23,2.84,24,5.461,25,4.851,26,5.461,27,3.911,28,3.541,29,3.712,30,5.461,31,5.461,32,5.461,33,3.259,34,2.932,35,4.851,36,5.461]],["t/624",[1,5.053,7,1.193,11,3.701,15,3.701,23,3.225,33,3.701,34,3.329,37,3.565,38,4.215,39,6.201,40,4.021,41,3.851,42,5.053,43,4.441,44,4.713,45,2.953,46,2.873,47,6.201,48,4.713,49,6.201,50,6.255,51,5.509,52,4.713,53,4.021,54,5.509,55,5.509,56,4.441]],["t/626",[0,3.263,15,4.332,37,3.263,57,3.194,58,4.624,59,5.675,60,5.675,61,5.675,62,4.064,63,5.041,64,5.675,65,5.675,66,5.675,67,4.064,68,4.624,69,5.041,70,5.675,71,5.041,72,5.675,73,5.041,74,5.916,75,5.733,76,6.084,77,6.523,78,5.041,79,5.041,80,5.675,81,4.064,82,5.041,83,4.313,84,5.675]],["t/628",[0,3.417,3,0.842,7,0.811,11,3.547,15,1.591,29,2.865,33,2.516,34,2.263,37,1.532,43,1.909,44,2.026,45,1.269,46,1.235,56,1.909,67,3.019,81,3.019,85,2.172,86,4.256,87,0.513,88,2.172,89,2.172,90,3.745,91,1.479,92,1.728,93,3.745,94,0.732,95,0.951,96,3.204,97,3.435,98,3.435,99,0.971,100,0.858,101,1.168,102,1.643,103,1.643,104,2.424,105,0.996,106,2.192,107,1.355,108,1.328,109,1.115,110,2.456,111,1.633,112,3.547,113,2.167,114,2.83,115,1.991,116,2.682,117,2.613,118,3.191,119,2.487,120,4.843,121,3.745,122,3.745,123,3.745,124,3.204,125,1.643,126,3.745,127,3.435,128,3.435,129,3.204,130,3.204,131,3.745,132,1.136,133,1.279,134,1.034,135,4.215,136,4.215,137,4.215,138,3.435,139,0.931,140,1.643]],["t/630",[0,3.82,3,0.801,5,1.659,7,0.879,11,3.965,13,1.131,15,3.49,29,2.439,33,2.727,37,2.627,40,1.416,43,3.79,44,4.022,45,2.785,46,2.913,56,1.564,57,1.432,58,2.925,62,2.57,63,1.94,67,3.272,68,1.779,81,2.57,83,1.659,85,1.779,86,3.79,87,0.691,88,1.779,89,1.779,91,1.212,92,1.416,94,0.6,95,0.779,96,2.728,97,2.925,98,2.925,99,0.793,100,0.73,101,0.802,102,1.399,103,1.399,104,2.063,105,0.848,106,1.866,107,1.154,108,1.131,109,0.577,110,1.888,111,1.454,113,1.309,114,1.709,115,1.202,117,1.578,119,1.502,120,4.313,121,3.188,122,3.188,123,3.188,124,2.728,125,1.399,126,3.188,127,2.925,128,2.925,129,2.728,130,2.728,131,3.188,132,0.589,133,0.772,134,0.536,139,0.763,140,0.851,141,3.79,142,2.728,143,2.183,144,2.183,145,2.183,146,1.94,147,4.569,148,3.188,149,2.183,150,3.188,151,1.779,152,2.183,153,2.183,154,3.188,155,3.188,156,3.473,157,2.183,158,3.473,159,1.779,160,2.183,161,1.779,162,2.183,163,1.484,164,2.183,165,2.183,166,2.183,167,2.183,168,2.183,169,2.183,170,3.188,171,2.183,172,1.33,173,4.569,174,2.183,175,3.589,176,2.183,177,2.183,178,1.779,179,1.779,180,2.183,181,5.292,182,1.94,183,2.183,184,3.589,185,3.589,186,1.927,187,3.589,188,2.728,189,3.589,190,3.589,191,1.356,192,2.183,193,2.183,194,2.183,195,2.183,196,2.183,197,2.183,198,1.659,199,1.564,200,2.183,201,1.94,202,1.659,203,2.183]],["t/632",[0,4.27,3,0.804,7,0.762,11,4.432,14,3.265,15,2.363,29,5.144,33,2.363,37,3.006,40,2.567,56,1.281,58,3.226,62,2.175,81,2.175,82,2.698,83,3.547,85,1.457,86,2.835,87,0.762,88,1.457,89,1.457,91,2.198,92,2.567,94,0.491,95,0.638,96,3.009,99,0.784,100,0.364,101,0.884,103,1.184,104,1.746,105,0.718,106,1.58,107,0.977,108,0.957,109,0.473,111,1.282,114,1.446,124,1.359,130,3.974,132,0.482,133,0.852,134,0.439,139,0.625,140,0.697,141,2.835,142,1.359,150,1.589,151,2.475,156,2.308,158,3.009,163,1.215,178,1.457,182,1.589,201,3.517,202,3.547,204,2.698,205,5.198,206,1.589,207,1.788,208,1.788,209,1.788,210,1.788,211,3.547,212,1.788,213,1.788,214,1.788,215,1.457,216,1.589,217,1.788,218,3.959,219,1.788,220,1.788,221,1.788,222,1.788,223,1.788,224,1.788,225,1.788,226,1.788,227,1.788,228,1.788,229,1.444,230,3.037,231,3.037,232,2.698,233,3.037,234,3.037,235,1.631,236,3.037,237,2.001,238,4.667,239,3.026,240,3.037,241,3.037,242,4.667,243,4.146,244,4.146,245,2.475,246,3.037,247,4.667,248,2.059,249,3.037,250,3.037,251,2.427,252,3.037,253,3.037,254,1.457,255,1.788,256,1.788,257,1.589,258,1.788,259,1.788,260,1.788,261,1.788,262,1.788,263,1.788,264,1.788,265,4.667,266,4.667,267,1.039,268,2.698,269,3.037,270,3.037,271,3.037,272,1.788,273,1.067,274,1.788,275,1.788,276,1.788,277,1.788,278,1.241,279,1.16,280,3.037,281,2.698,282,2.475,283,3.037,284,3.959,285,3.037,286,3.037,287,1.215,288,1.788,289,1.457,290,1.589]],["t/634",[0,4.552,3,0.826,7,1.067,11,3.636,14,3.02,28,1.531,29,3.278,33,2.283,34,1.268,37,1.358,40,1.531,42,1.924,55,2.098,57,2.431,62,2.74,86,2.74,87,0.454,91,4.468,93,3.399,94,1.524,95,1.365,96,3.665,97,3.93,98,3.93,99,1.108,100,0.982,101,1.457,102,1.88,103,2.162,104,3.188,105,1.31,106,2.884,107,1.959,108,1.747,111,1.524,113,1.395,114,1.822,115,1.282,117,1.682,139,0.825,140,1.88,141,2.74,142,2.908,158,1.795,163,1.605,170,2.098,178,1.924,186,2.054,205,1.924,235,1.268,244,2.098,245,1.924,257,2.098,267,1.65,278,1.563,289,1.924,291,2.361,292,2.361,293,2.361,294,2.773,295,3.399,296,3.826,297,3.826,298,2.361,299,2.361,300,2.361,301,2.361,302,2.361,303,3.826,304,2.361,305,2.098,306,2.361,307,6.093,308,2.361,309,1.924,310,1.93,311,3.826,312,1.605,313,2.098,314,2.361,315,1.691,316,2.361,317,2.361,318,0.398,319,2.361,320,1.136,321,2.361,322,2.361,323,2.361,324,2.361,325,2.098,326,1.094,327,2.361,328,1.467]],["t/636",[0,2.478,3,0.783,5,2.083,7,0.527,11,4.743,13,1.358,20,1.777,29,1.863,33,1.636,37,1.576,40,1.777,62,3.086,67,1.963,68,2.234,81,1.963,86,4.7,87,0.527,91,2.392,92,2.794,99,0.798,100,0.558,101,0.963,102,1.68,103,1.68,104,2.478,105,1.018,106,2.241,107,1.386,108,1.358,109,0.725,110,2.154,111,1.658,113,1.942,119,1.803,120,3.512,125,1.68,129,2.083,132,0.739,133,0.928,134,0.672,140,1.069,141,3.814,146,2.435,148,6.474,151,2.234,156,5.295,159,2.234,161,3.512,163,1.863,202,2.083,206,3.828,211,2.083,215,3.512,216,3.828,237,2.588,245,2.234,278,1.76,282,3.512,289,4.339,320,1.581,329,2.741,330,2.741,331,2.741,332,2.741,333,2.741,334,2.741,335,4.526,336,2.741,337,2.435,338,2.741,339,2.741,340,2.741,341,5.295,342,2.283,343,2.741,344,2.741,345,2.741,346,4.309,347,4.309,348,2.741,349,2.741,350,2.741,351,3.275,352,3.914,353,4.309,354,4.309,355,4.309,356,2.741,357,2.741,358,2.435,359,2.741,360,2.741,361,2.741,362,3.512,363,2.741,364,2.741,365,2.741]],["t/638",[0,4.11,3,0.63,5,3.438,7,1.376,11,3.726,15,2.7,20,4.636,25,4.019,28,2.933,33,3.726,37,2.601,40,2.933,57,1.805,67,3.24,71,4.019,83,3.438,129,3.438,130,3.438,141,3.24,156,3.438,158,3.438,159,5.087,163,4.859,202,3.438,211,4.745,232,5.546,243,4.019,305,4.019,337,4.019,366,4.019,367,4.019,368,7.149,369,4.523,370,3.686,371,6.243,372,1.614,373,4.523,374,4.523,375,4.523,376,4.523,377,4.523,378,4.019,379,4.523,380,4.523,381,4.523,382,4.523,383,4.523,384,4.523,385,4.523,386,4.019,387,4.523,388,1.484,389,4.523,390,4.523,391,4.523,392,4.019,393,4.523,394,4.523,395,3.075,396,4.523,397,4.523,398,4.523]],["t/640",[0,3.96,37,3.96,43,4.933,57,2.748,128,5.613,163,4.682,281,6.12,399,6.888,400,6.888,401,6.888,402,6.888,403,6.888,404,6.888,405,6.888]],["t/642",[318,1.209,406,6.828,407,7.172,408,5.845,409,3.618,410,7.172,411,7.172,412,5.451]],["t/644",[38,4.957,76,5.543,413,5.223,414,7.293,415,6.479,416,7.293,417,7.293]],["t/646",[3,0.361,20,3.777,57,2.704,69,3.64,75,5.286,76,4.427,106,3.029,310,2.067,386,3.64,406,6.603,408,3.339,412,3.114,418,5.825,419,5.825,420,4.097,421,6.021,422,4.097,423,5.825,424,5.825,425,2.274,426,4.097,427,4.097,428,1.951,429,5.523,430,5.825,431,4.097,432,5.825,433,4.097,434,4.097,435,4.097,436,5.61,437,5.175,438,1.835,439,4.097,440,3.64,441,4.097,442,2.785,443,4.097,444,4.097,445,4.097,446,4.097,447,4.097,448,3.64,449,4.747,450,2.938,451,2.131,452,2.785,453,3.64,454,1.562,455,5.825,456,4.097,457,4.097,458,4.097,459,3.64,460,3.64,461,4.097,462,4.097,463,4.097,464,3.114,465,3.339,466,4.097,467,4.097,468,4.097,469,4.097,470,3.64,471,2.934,472,3.64,473,3.339]],["t/648",[310,3.02,318,1.009,408,4.879,448,5.319,449,4.879,464,4.55,465,4.879,474,2.446,475,5.877,476,5.987,477,3.323,478,5.319,479,7.29,480,4.879,481,5.319,482,5.319,483,6.12,484,5.987,485,5.987,486,6.672,487,5.987,488,5.987,489,5.987,490,5.319,491,5.987,492,3.719,493,5.987]],["t/650",[3,0.787,94,1.559,114,2.702,191,3.525,428,1.901,442,6.164,454,2.163,475,5.199,483,4.624,494,6.413,495,5.675,496,5.241,497,5.041,498,4.624,499,3.047,500,5.675,501,5.675,502,5.675,503,5.041,504,5.916,505,4.624,506,5.675]],["t/652",[3,0.753,94,1.612,191,3.643,251,3.051,320,1.742,342,2.515,351,4.458,409,2.959,428,1.965,451,3.051,454,2.236,475,4.201,483,4.78,504,6.625,505,4.78,507,7.588,508,5.211,509,5.211,510,5.866,511,5.866,512,7.414,513,5.866,514,2.287,515,5.866,516,5.866,517,4.425]],["t/654",[3,0.731,94,1.68,116,2.759,191,3.797,318,1.03,454,2.33,464,5.783,475,5.449,479,6.76,486,6.76,490,5.431,505,4.982,518,7.922,519,6.113,520,6.113,521,4.982,522,3.797,523,4.982,524,4.378,525,5.431]],["t/656",[3,0.786,94,1.821,454,2.525,526,8.584,527,6.626,528,6.626,529,6.626,530,6.626,531,6.626,532,6.626,533,6.626,534,6.626,535,6.626,536,6.626]],["t/658",[75,6.147,108,1.555,172,1.437,310,2.489,362,6.512,395,4.502,406,4.021,429,6.994,464,3.75,475,3.534,477,2.739,537,5.355,538,6.623,539,5.884,540,6.623,541,4.934,542,4.934,543,7.991,544,7.991,545,7.991,546,1.28,547,4.383,548,4.934,549,4.934,550,6.623,551,6.623,552,3.75,553,6.623,554,4.934,555,4.934,556,3.534,557,4.383,558,4.934]],["t/660",[7,1.665,14,2.432,20,5.127,23,2.876,28,3.586,34,2.969,41,3.435,45,2.634,46,2.563,50,4.507,52,4.203,53,3.586,57,2.849,91,3.07,254,4.507,362,4.507,392,4.913,395,3.759,438,1.743,450,2.79,451,2.876,480,5.819,509,4.913,559,5.53,560,4.507,561,5.53,562,5.53,563,4.913,564,5.53,565,4.507,566,3.961,567,4.913,568,3.586,569,4.507,570,3.961,571,4.203,572,5.53]],["t/662",[57,2.985,450,3.774,454,2.851,537,5.358]],["t/664",[3,0.651,27,5.287,73,5.177,94,1.601,237,2.499,254,4.748,370,4.748,372,2.634,413,4.173,428,2.473,477,4.098,499,3.963,537,4.173,573,7.383,574,5.827,575,5.827,576,4.748,577,5.827,578,5.177,579,4.173,580,5.827,581,4.428,582,1.403,583,5.827,584,5.177,585,3.477,586,5.827,587,5.827,588,5.827,589,5.827]],["t/666",[7,1.664,20,5.355,34,4.433,35,5.393,38,4.126,45,2.891,46,2.813,53,4.912,438,1.913,449,4.947,590,6.071,591,5.393,592,5.393,593,6.73,594,6.071,595,5.393,596,6.071,597,7.575,598,7.575,599,6.071]],["t/668",[7,1.347,20,4.539,75,5.013,109,1.851,415,6.218,429,6.731,454,2.668,600,6.999,601,8.786]],["t/670",[3,0.815,28,1.456,34,2.501,41,1.395,91,1.246,92,1.456,99,0.89,100,1.095,102,1.432,105,0.868,107,1.181,108,1.157,115,1.23,133,0.483,140,2.622,237,0.963,278,1.5,318,0.619,425,1.246,428,1.988,438,1.696,454,0.856,471,1.608,496,1.395,522,1.395,546,1.653,563,3.262,568,1.456,570,2.63,571,3.541,576,1.83,581,2.791,582,1.429,585,2.781,602,2.245,603,2.245,604,1.995,605,2.245,606,4.386,607,1.256,608,4.139,609,1.972,610,0.94,611,3.797,612,2.988,613,2.245,614,5.717,615,4.25,616,0.784,617,3.797,618,2.245,619,2.245,620,2.506,621,1.995,622,2.245,623,4.659,624,4.386,625,6.724,626,1.707,627,3.262,628,1.995,629,2.245,630,2.245,631,2.245,632,1.83,633,2.245,634,2.245,635,4.659,636,2.245,637,3.262,638,2.429,639,3.262,640,2.245,641,2.245,642,4.563,643,3.672,644,3.672,645,4.139,646,2.993,647,1.83,648,1.83,649,3.672,650,3.672,651,3.672,652,1.707,653,4.659,654,3.672,655,1.608,656,1.608,657,2.245,658,5.382,659,1.83,660,2.245,661,2.245,662,2.245,663,2.245,664,2.245,665,1.83,666,2.245,667,1.83,668,1.83,669,2.245,670,2.245,671,2.245,672,1.995,673,3.672,674,1.83,675,1.995,676,1.707,677,1.707,678,1.995,679,2.245,680,2.245,681,1.995,682,2.381,683,1.707,684,2.245,685,1.608,686,1.995,687,1.995,688,1.995]],["t/672",[3,0.831,34,2.036,99,0.569,100,0.772,102,1.479,105,1.302,107,1.22,115,1.271,140,3.078,278,1.549,318,0.639,409,1.913,428,1.271,438,1.195,440,3.37,568,3.574,570,5.102,571,2.883,582,1.9,585,2.264,606,5.289,608,3.37,611,3.091,614,4.491,615,3.947,617,3.091,620,2.054,637,3.37,638,2.929,639,3.37,672,3.37,674,3.091,682,2.46,685,3.947,686,3.37,687,3.37,689,3.793,690,6.491,691,3.793,692,3.091,693,3.793,694,3.793,695,1.549,696,1.587,697,6.491,698,6.491,699,3.37,700,3.793,701,3.793,702,3.793,703,3.793,704,5.511,705,3.793,706,7.894,707,3.793,708,3.793,709,3.793,710,3.793,711,3.793]],["t/675",[3,0.851,41,2.916,45,3.05,46,3.377,110,2.924,112,2.802,113,2.335,133,1.01,186,2.52,199,5.869,267,2.19,318,0.791,320,2.325,471,3.362,565,3.825,624,3.825,656,3.362,678,4.17,692,3.825,712,3.825,713,4.17,714,4.694,715,4.694,716,4.694,717,3.362,718,3.362,719,4.694,720,4.17,721,3.568,722,4.17,723,4.694,724,4.694]],["t/677",[3,0.836,45,2.783,46,3.76,53,2.669,92,2.669,100,1.383,108,1.842,110,2.086,133,1.258,198,3.129,199,2.948,267,1.408,318,1.246,335,3.63,342,2.506,351,3.129,409,2.077,413,2.948,425,2.285,452,3.972,471,4.186,499,2.21,579,2.948,611,3.355,718,4.186,722,5.192,725,4.116,726,4.116,727,5.844,728,2.948,729,4.116,730,4.116,731,6.037,732,5.844,733,4.116,734,4.116,735,4.116,736,4.116,737,3.657,738,4.116,739,3.657,740,4.116,741,4.116,742,4.116,743,2.285,744,4.116,745,2.669,746,4.116,747,4.116,748,3.657,749,4.116,750,4.116,751,2.557]],["t/679",[3,0.593,46,3.738,198,5.114,199,6.188,318,1.134,428,2.254,560,5.483,675,5.978,718,4.819,752,6.728,753,6.728,754,5.483,755,6.728,756,6.728]],["t/681",[3,0.809,7,1.085,110,2.012,140,2.198,172,1.641,237,2.418,251,2.932,320,1.674,473,4.594,499,3.027,546,1.463,584,6.422,593,5.009,610,3.025,616,1.969,627,5.009,757,3.656,758,5.638,759,5.009,760,6.422,761,5.638,762,5.009,763,5.638,764,4.285,765,5.638,766,5.009,767,5.638,768,7.229,769,7.229,770,5.638]],["t/683",[3,0.839,45,3.349,46,2.832,57,1.75,87,0.844,111,2.276,113,2.565,133,1.514,134,1.725,172,1.277,179,4.98,186,3.776,267,2.833,320,2.375,409,4.035,579,3.142,607,1.5,696,1.835,720,3.897,760,6.248,771,3.897,772,4.933,773,7.607,774,7.607]],["t/685",[45,3.502,46,3.408,450,3.71,451,3.825,452,4.999,454,2.803]],["t/688",[3,0.612,310,3.503,312,4.719,315,4.973,438,2.188,775,6.943,776,6.943,777,5.277,778,3.992,779,6.943,780,6.943,781,6.943,782,6.943]],["t/690",[100,1.747,425,4.153,783,7.481]],["t/692",[3,0.663,34,3.583,52,3.793,53,3.236,87,0.96,92,3.236,110,2.382,111,2.066,112,2.978,267,2.283,312,3.392,335,3.1,436,3.793,438,1.573,497,4.434,556,3.574,616,1.743,642,3.574,645,5.929,646,6.128,777,3.793,784,4.991,785,4.067,786,4.067,787,4.067,788,5.439,789,4.067,790,4.067,791,4.991,792,7.133,793,4.991,794,4.991,795,3.392,796,6.674,797,3.392,798,4.434,799,4.991,800,6.674,801,4.991,802,7.52,803,4.991,804,4.991,805,4.991,806,4.991]],["t/694",[34,2.649,100,1.004,111,1.356,372,2.852,438,2.087,450,2.489,499,2.649,522,3.065,556,5.723,568,3.199,582,1.924,617,5.398,656,3.534,681,4.383,718,3.534,739,4.383,754,6.793,757,3.199,762,4.383,777,5.034,792,7.406,798,5.884,807,6.623,808,5.398,809,4.934,810,4.934,811,4.934,812,4.934,813,4.934,814,4.934,815,4.934,816,4.934,817,4.934,818,4.934,819,4.934,820,3.534,821,4.934,822,4.934,823,4.934,824,4.934,825,4.934]],["t/697",[3,0.849,7,0.633,34,1.767,45,1.567,46,1.525,53,2.134,87,0.955,113,2.424,115,2.227,133,1.431,138,5.417,172,1.444,237,1.411,267,2.44,312,2.237,318,0.836,320,2.519,335,3.081,342,1.411,409,1.66,428,1.102,438,1.037,567,2.924,578,2.924,582,0.792,585,1.964,609,1.767,610,1.377,616,2.322,628,2.924,682,3.217,683,4.538,696,2.076,712,4.043,728,2.357,757,3.872,826,2.682,827,3.291,828,5.971,829,3.291,830,2.924,831,4.407,832,3.291,833,8.009,834,4.961,835,8.195,836,3.291,837,4.407,838,2.924]],["t/699",[3,0.833,13,1.836,99,0.873,110,2.634,111,2.341,113,2.125,133,1.254,188,4.428,237,2.499,313,5.177,335,4.585,341,4.428,352,3.778,428,1.952,459,5.177,616,2.976,839,5.827,840,5.827,841,5.827]],["t/701",[3,0.821,7,0.621,13,1.86,87,1.136,99,1.061,100,0.995,102,1.259,105,0.763,107,1.038,108,2.229,111,1.344,112,3.523,114,2.811,139,1.128,140,1.907,318,0.544,351,2.455,421,7.075,425,1.793,428,1.977,436,2.455,438,1.018,460,6.613,465,6.066,471,2.313,496,2.006,525,4.345,546,1.269,568,2.094,582,1.421,595,2.869,609,2.626,620,2.454,621,5.85,642,2.313,646,3.986,648,2.632,685,2.313,696,1.351,757,3.172,838,2.869,842,4.891,843,3.828,844,7.444,845,3.23,846,2.006,847,3.23,848,6.584,849,2.869,850,1.734,851,2.313,852,5.903,853,4.891,854,2.919,855,3.23,856,3.23,857,3.23,858,3.23,859,3.23,860,3.23,861,3.23,862,2.869,863,2.869,864,3.23,865,3.23,866,3.23]],["t/703",[3,0.813,7,1.06,14,2.854,99,1.251,100,1.54,102,1.479,103,2.149,104,2.181,105,1.302,107,1.772,108,2.045,110,1.354,139,1.925,140,2.531,229,1.383,235,2.036,239,2.46,318,1.094,341,2.883,413,2.717,425,3.603,428,1.271,454,1.446,514,1.479,566,2.717,568,2.46,638,2.929,655,2.717,665,3.091,667,3.091,685,2.717,748,3.37,778,3.169,837,3.37,843,4.907,867,3.37,868,3.793,869,3.793,870,3.793,871,3.793,872,3.793,873,3.793,874,3.793,875,3.793,876,3.793,877,2.181,878,3.793,879,5.511,880,3.37,881,3.793,882,4.896,883,4.188,884,2.883,885,3.37,886,5.511,887,3.793,888,2.356,889,3.793,890,1.414,891,3.793,892,2.883,893,3.793,894,3.793]],["t/706",[38,4.215,57,3.063,74,6.255,75,5.497,76,5.834,77,6.255,78,5.509,79,6.819,318,1.045,388,2.035,685,4.441,688,5.509,808,5.053,843,4.021,867,5.509,895,6.201,896,6.201,897,6.201,898,6.201,899,4.713,900,4.441,901,6.201]],["t/708",[3,0.677,7,1.676,57,3.326,94,2.46,95,2.739,237,2.659,428,2.571,609,4.121,764,4.713,902,6.201,903,6.201,904,7.676,905,7.676]],["t/710",[3,0.816,7,1.265,57,2.624,94,1.807,99,1.193,105,1.554,107,2.114,108,2.507,278,2.686,850,3.53,906,3.898,907,4.264]],["t/712",[3,0.816,7,1.265,57,2.624,94,1.807,99,1.193,105,1.554,107,2.114,108,2.507,278,2.686,850,3.53,908,4.014,909,6.576]],["t/714",[3,0.851,87,0.989,90,3.68,108,2.559,267,2.89,320,2.411,342,2.918,413,3.68,454,1.958,477,3.777,537,3.68,579,3.68,674,4.187,910,4.565,911,4.625,912,4.565,913,4.227,914,3.653,915,2.144,916,3.68]],["t/717",[3,0.86,7,1.006,57,2.086,94,1.437,99,0.784,102,2.039,105,1.235,107,1.681,108,2.749,113,2.271,114,2.49,237,2.242,267,2.857,278,2.136,318,0.595,320,2.044,326,3.19,335,2.193,342,2.952,352,3.391,428,1.183,454,1.346,517,2.108,582,0.85,911,4.679,914,2.807,917,3.531,918,3.391,919,5.229,920,3.531,921,3.531,922,2.108]],["t/719",[3,0.853,7,0.949,13,1.555,57,1.969,87,0.949,94,1.356,99,0.993,102,1.924,105,1.166,107,1.586,108,2.704,113,2.415,237,2.84,267,2.265,278,2.015,318,0.831,320,1.966,326,2.286,342,3.206,428,1.653,517,2.945,682,3.199,911,3.354,914,2.649,922,2.945,923,4.295,924,4.934]],["t/721",[3,0.827,7,0.857,13,1.403,57,1.777,94,1.224,99,0.926,102,1.736,105,1.052,107,1.432,108,1.946,110,2.204,119,1.864,251,4.183,278,1.819,318,1.041,320,1.834,342,1.91,388,1.462,428,1.492,442,3.027,450,3.116,494,3.385,496,2.766,517,2.658,609,2.391,652,4.694,676,4.694,721,4.694,728,4.424,795,4.198,797,3.027,900,3.19,911,3.027,915,2.234,925,3.629,926,3.957,927,5.033,928,3.116,929,4.424,930,2.01,931,2.182,932,2.064,933,3.957,934,4.454,935,3.19,936,3.19,937,3.19]],["t/723",[3,0.838,7,0.815,13,1.335,57,1.69,94,1.164,99,0.894,102,1.652,105,1.001,107,1.362,108,1.88,110,2.128,119,1.773,237,2.558,239,2.747,251,4.604,278,1.731,318,0.714,320,1.771,342,2.96,388,1.957,442,2.88,494,3.22,496,2.632,517,2.529,609,3.202,682,2.747,795,4.054,797,4.054,900,3.034,911,2.88,915,2.361,923,3.868,925,3.453,929,4.272,930,1.912,931,2.076,932,1.963,933,3.764,935,4.272,936,4.272,937,4.272,938,3.764,939,4.237]],["t/725",[3,0.83,7,0.702,13,1.15,41,3.328,57,1.456,87,1.031,94,1.003,99,0.803,102,1.423,105,0.862,107,1.174,108,1.688,110,2.265,113,1.331,119,1.527,191,2.267,237,1.565,251,3.875,273,2.178,278,1.491,282,2.974,310,2.703,318,0.903,320,1.591,342,2.722,388,1.198,442,2.481,450,1.841,451,1.898,454,1.391,494,2.774,496,2.267,517,2.178,560,2.974,582,1.29,609,3.408,624,5.174,659,2.974,682,2.367,754,2.974,795,2.481,797,2.481,851,2.614,900,2.614,911,2.481,914,1.96,915,2.454,916,4.547,918,2.367,923,2.367,925,2.974,929,2.614,930,1.647,931,1.788,935,2.614,936,2.614,937,2.614,938,3.243,940,6.347,941,3.65,942,3.65,943,3.65,944,6.348,945,2.974,946,3.65,947,3.65,948,5.358]],["t/727",[318,1.189,450,3.559,652,5.363,676,5.363,721,5.363,728,5.054,915,2.223,926,6.269,927,5.75,928,3.559,949,6.269]],["t/729",[16,4.395,57,2.803,74,4.395,310,2.721,318,1.51,454,2.056,522,3.35,537,5.595,880,4.791,914,4.724,915,2.214,916,5.031,923,4.555,950,5.393,951,5.393,952,5.393,953,5.059,954,5.252,955,6.941,956,5.393]],["t/731",[28,4.651,91,3.981,309,5.845,568,4.651,569,5.845,954,4.281,957,7.172,958,7.172,959,6.372]],["t/733",[3,0.846,7,1.251,14,2.858,48,3.647,87,0.923,91,2.663,99,1.105,100,0.977,111,1.318,134,1.177,290,4.262,312,3.261,325,4.262,341,4.94,539,4.262,546,1.245,582,1.155,647,3.91,683,4.94,717,4.655,757,3.111,885,5.774,890,2.423,910,5.774,960,4.798,961,4.798,962,3.91,963,4.798,964,6.5,965,4.798,966,4.798,967,4.798,968,4.798,969,4.798,970,4.798,971,4.798,972,4.798]],["t/735",[3,0.827,7,1.279,14,2.182,99,1.252,101,1.866,102,1.935,107,2.138,108,2.095,111,1.363,140,2.592,172,1.445,235,2.664,267,1.697,268,5.907,278,2.027,294,3.823,328,3.082,342,2.851,378,4.408,409,2.503,877,2.853,912,4.408,962,5.418,973,4.962,974,4.962,975,4.408,976,4.408,977,5.907,978,4.408,979,4.962,980,4.962,981,4.962,982,4.408]],["t/737",[3,0.823,7,1.078,99,1.259,101,1.251,105,1.323,106,2.913,107,1.801,139,1.957,188,4.257,237,2.402,239,3.632,267,1.916,326,2.596,454,2.135,632,6.483,772,3.632,826,4.565,983,6.396,984,4.976,985,4.976,986,5.601,987,4.976,988,4.976,989,4.976,990,4.976,991,4.976,992,4.976,993,5.601]],["t/739",[191,4.347,318,1.179,450,3.531,454,2.668,850,3.758,994,6.218,995,6.218,996,6.218,997,6.218,998,6.218,999,6.218,1000,6.218]],["t/741",[7,1.758,13,1.848,34,3.98,100,1.509,318,1.249,438,2.562,481,5.211,759,5.211,882,7.222,1001,5.866,1002,5.866,1003,5.866,1004,5.866,1005,5.866,1006,7.414,1007,5.866,1008,5.866,1009,7.414,1010,5.866,1011,5.866,1012,5.866]],["t/743",[3,0.82,7,1.294,13,1.591,27,3.616,48,3.837,99,1.134,103,2.622,111,1.387,139,1.764,251,2.626,318,0.851,320,1.997,523,4.114,638,2.278,642,3.616,656,3.616,778,2.903,854,3.013,918,3.274,976,5.975,1013,3.837,1014,3.616,1015,5.049,1016,5.049,1017,5.049,1018,5.049,1019,5.049,1020,4.485,1021,7.563,1022,4.485,1023,5.049,1024,5.049,1025,5.049,1026,5.049,1027,5.049,1028,5.049,1029,5.049,1030,5.049,1031,5.049,1032,5.049,1033,5.049]],["t/745",[45,3.416,46,3.324,87,1.612,90,5.137,388,2.354,450,3.618,451,3.73,454,2.734]],["t/747",[3,0.837,7,1.415,94,1.59,95,2.065,99,1.211,100,1.496,101,1.293,102,2.866,109,1.531,132,1.56,133,1.582,134,1.803,139,2.022,372,2.065,1034,5.788,1035,1.753,1036,1.753,1037,6.531,1038,3.753]],["t/749",[3,0.842,7,1.294,94,1.387,95,1.802,99,1.134,100,1.369,101,1.128,102,2.622,103,2.622,104,3.867,105,1.589,106,3.498,107,2.163,108,2.119,109,1.335,132,1.361,133,1.448,134,1.65,139,1.764,638,3.035,778,3.867,888,4.177,906,2.473,1035,1.529,1036,1.529,1038,3.274,1039,3.616]],["t/751",[3,0.846,7,1.357,94,1.491,95,1.936,99,1.175,100,1.436,101,1.212,102,2.75,109,1.435,132,1.463,133,1.518,134,1.73,139,1.896,892,5.361,906,2.658,1035,1.643,1036,1.643,1038,3.519,1039,3.887,1040,4.422,1041,4.422,1042,5.748,1043,4.422]],["t/753",[3,0.848,7,1.237,23,3.343,94,1.297,95,1.684,99,1.096,100,1.308,101,1.054,102,2.506,109,1.248,132,1.272,133,1.383,134,1.576,139,1.649,451,2.455,612,3.568,906,2.312,1035,1.429,1036,1.429,1038,3.06,1039,3.38,1044,3.846,1045,5.58,1046,6.395,1047,5.238,1048,3.836,1049,3.836,1050,5.238,1051,3.846]],["t/755",[3,0.835,7,1.262,23,3.963,94,1.061,95,1.378,99,1.077,100,1.334,101,1.465,102,2.176,103,2.176,108,1.759,109,1.476,132,1.505,133,1.64,134,1.762,139,1.349,140,1.505,318,0.941,372,1.378,546,1.002,566,2.765,582,0.929,616,1.349,655,2.765,717,3.998,906,1.891,1035,1.169,1036,1.169,1038,2.503,1039,2.765,1045,2.624,1048,2.304,1049,3.331,1052,4.882,1053,4.882,1054,3.146,1055,3.146,1056,3.146,1057,4.549,1058,4.549,1059,4.549,1060,3.146,1061,4.549,1062,4.549,1063,5.582,1064,4.549,1065,3.146,1066,1.146]],["t/757",[3,0.738,23,3.248,315,4.473,395,4.245,522,3.879,524,4.473,552,4.747,615,4.473,626,4.747,899,4.747,931,3.777,1048,4.601,1049,3.727,1052,5.24,1053,5.24,1067,5.089,1068,5.089,1069,5.089,1070,5.089,1071,5.089,1072,5.089]],["t/759",[3,0.847,7,1.05,99,1.216,100,1.111,102,2.128,108,1.18,111,2.159,133,1.79,134,1.846,139,1.907,140,1.46,267,2.204,320,1.112,326,2.985,425,3.03,546,1.672,582,1.704,712,5.25,772,3.54,778,3.139,843,3.54,883,5.381,884,4.149,888,3.391,906,1.834,1038,3.54,1039,2.682,1066,1.913,1073,3.051,1074,3.051,1075,4.449,1076,3.051,1077,3.051,1078,3.051,1079,4.449]],["t/762",[906,3.729,1080,3.527]],["t/764",[45,3.416,46,3.324,87,1.612,90,5.137,388,2.354,450,3.618,451,3.73,454,2.734]],["t/766",[3,0.84,7,1.232,87,1.232,94,1.29,95,1.675,99,1.174,100,1.484,101,1.049,109,1.242,132,1.265,133,1.569,134,1.571,139,1.64,140,1.83,318,0.791,372,2.285,546,1.218,582,1.13,743,2.606,928,2.368,1035,1.421,1036,1.421,1037,5.689,1066,1.394,1081,3.191,1082,4.694,1083,3.977,1084,3.977,1085,4.353,1086,4.353,1087,4.586,1088,4.191,1089,2.699,1090,2.699,1091,2.699]],["t/768",[3,0.847,7,1.125,87,1.125,94,1.131,95,1.469,99,1.109,100,1.383,101,0.92,103,2.279,104,3.36,105,1.381,106,3.039,107,1.879,108,1.842,109,1.089,132,1.11,133,1.463,134,1.433,139,1.438,140,1.605,318,0.694,372,1.469,546,1.068,582,0.991,585,2.457,638,2.637,743,2.285,778,3.36,888,3.63,908,2.077,928,2.077,1035,1.246,1036,1.246,1066,1.222,1081,2.798,1083,3.63,1084,3.63,1085,3.972,1086,3.972,1087,4.186,1088,3.907,1089,2.367,1090,2.367,1091,2.367]],["t/770",[3,0.85,7,1.172,87,1.172,94,1.199,95,1.557,99,1.138,100,1.428,101,0.975,109,1.154,132,1.176,133,1.51,134,1.494,139,1.525,140,1.702,318,0.735,372,1.557,546,1.133,582,1.051,585,2.605,743,2.423,892,4.628,908,2.202,928,2.202,1035,1.322,1036,1.322,1040,3.557,1041,3.557,1042,4.963,1043,3.557,1066,1.296,1081,2.966,1083,3.782,1084,3.782,1085,4.139,1086,4.139,1087,4.362,1088,4.033,1089,2.509,1090,2.509,1091,2.509]],["t/772",[3,0.851,7,1.081,23,2.922,87,1.081,94,1.07,95,1.39,99,1.081,100,1.341,101,0.87,109,1.03,132,1.05,133,1.418,134,1.378,139,1.361,140,1.519,318,0.656,372,1.39,451,2.026,546,1.011,582,0.938,585,2.325,612,3.118,743,2.162,908,1.965,928,1.965,1035,1.179,1036,1.179,1044,3.174,1045,5.198,1046,5.878,1047,4.578,1048,3.353,1049,3.353,1050,4.578,1051,3.174,1066,1.156,1081,2.648,1083,3.489,1084,3.489,1085,3.818,1086,3.818,1087,4.023,1088,3.788,1089,2.24,1090,2.24,1091,2.24]],["t/774",[3,0.841,7,1.149,23,3.709,87,0.955,94,0.904,95,1.174,99,1.069,100,1.353,101,1.334,103,1.934,108,1.563,109,1.312,132,1.337,133,1.614,134,1.63,139,1.15,140,1.934,318,1.006,372,1.77,546,1.287,566,2.357,582,1.194,585,1.964,616,1.15,655,2.357,717,3.553,743,1.827,908,1.66,928,1.66,1035,0.996,1036,0.996,1045,2.237,1048,1.964,1049,2.961,1052,4.518,1053,4.518,1054,2.682,1055,2.682,1056,2.682,1057,4.043,1058,4.043,1059,4.043,1060,2.682,1061,4.043,1062,4.043,1064,4.043,1065,2.682,1066,1.473,1081,2.237,1083,3.081,1084,3.081,1085,3.372,1086,3.372,1087,3.553,1088,3.433,1089,1.892,1090,1.892,1091,1.892,1092,4.961]],["t/776",[3,0.738,23,3.248,315,4.473,395,4.245,522,3.879,524,4.473,552,4.747,615,4.473,626,4.747,899,4.747,931,3.777,1048,4.601,1049,3.727,1052,5.24,1053,5.24,1067,5.089,1068,5.089,1069,5.089,1070,5.089,1071,5.089,1072,5.089]],["t/778",[3,0.847,7,1.025,99,1.26,108,1.141,111,2.134,133,1.671,134,1.55,139,1.86,140,1.411,267,2.161,320,1.075,326,2.927,372,1.292,425,2.956,546,1.64,582,1.677,585,2.16,772,3.453,778,3.062,843,3.453,883,5.295,884,4.047,888,3.308,908,1.826,1066,1.876,1073,2.95,1074,2.95,1075,4.34,1076,2.95,1077,2.95,1078,2.95,1079,4.34,1081,2.46,1083,3.308,1084,3.308,1085,3.62,1086,3.62,1093,5.325,1094,5.325,1095,6.318]],["t/781",[428,2.423,906,4.124,908,4.247,953,4.158,1080,3.901]],["t/783",[3,0.635,41,3.479,45,4.136,46,3.891,57,2.235,77,4.565,87,1.385,113,2.043,172,2.096,179,5.867,191,3.479,198,4.257,199,4.012,312,3.807,451,2.913,454,2.135,565,4.565,579,4.012,607,1.916,683,4.257,696,2.344,699,4.976,771,4.976,930,2.528,931,2.744,932,2.596,1096,2.596,1097,5.601,1098,5.601,1099,5.601,1100,5.601,1101,4.976]],["t/786",[3,0.825,13,1.873,87,0.811,99,1.182,100,0.858,101,0.942,105,1.404,109,1.115,110,2.457,111,1.892,115,1.991,116,2.682,119,2.487,125,2.318,132,1.137,133,1.482,134,1.458,172,1.731,229,1.537,248,3.091,318,0.71,320,1.765,372,1.505,388,1.384,438,1.329,474,1.722,514,1.644,546,1.094,582,1.015,607,1.442,610,1.764,616,2.753,620,1.572,695,2.428,696,1.764,890,1.572,915,1.329,932,2.754,1035,1.277,1036,1.277,1066,1.252,1096,1.954,1102,3.204,1103,4.518,1104,2.912,1105,1.764,1106,1.764,1107,1.682,1108,1.644]],["t/788",[3,0.839,13,2.301,87,0.77,99,1.159,100,0.815,101,0.894,105,1.353,109,1.059,110,2.387,111,1.838,115,1.919,116,2.585,119,2.397,125,2.234,132,1.079,133,1.44,134,1.405,172,1.668,186,3.076,229,1.46,248,2.979,318,0.675,320,1.701,388,1.314,428,1.919,438,1.261,474,1.635,514,1.561,546,1.039,582,0.964,607,1.369,610,1.675,616,2.551,620,1.492,695,2.34,696,1.675,890,1.492,915,1.261,932,2.655,1035,1.212,1036,1.212,1066,1.188,1096,1.855,1104,2.806,1105,1.675,1106,1.675,1107,1.597,1108,1.561,1109,2.486,1110,1.675]],["t/790",[3,0.842,13,2.287,87,0.76,99,1.152,100,0.804,101,0.882,105,1.34,109,1.044,110,2.369,111,1.824,115,1.9,116,2.56,119,2.374,125,2.212,132,1.064,133,1.429,134,1.391,172,1.652,186,3.046,229,1.44,248,2.95,318,0.665,320,1.684,388,1.296,428,1.9,438,1.244,474,1.613,514,1.539,546,1.025,582,0.95,607,1.35,610,1.652,616,2.685,620,1.472,695,2.317,696,1.652,890,1.472,915,1.244,932,2.629,1035,1.196,1036,1.196,1066,1.172,1096,1.83,1104,2.779,1105,1.652,1106,1.652,1107,1.575,1108,1.539,1109,2.452,1110,1.652]],["t/793",[915,2.399,1080,3.527]],["t/795",[1080,3.527,1110,3.185]],["t/797",[45,3.416,46,3.324,87,1.612,90,5.137,388,2.354,450,3.618,451,3.73,454,2.734]],["t/799",[3,0.836,7,1.289,14,2.946,87,1.289,94,1.379,95,1.791,99,1.206,100,1.535,101,1.121,109,1.328,132,1.353,133,1.623,134,1.643,139,1.753,279,3.255,287,3.412,318,0.846,372,1.791,546,1.303,582,1.208,743,2.786,928,2.532,1035,1.52,1036,1.52,1066,1.49,1088,4.336,1089,2.886,1090,2.886,1091,2.886,1111,5.019,1112,6.7,1113,3.595]],["t/801",[3,0.842,7,1.172,14,2.678,87,1.172,94,1.199,95,1.557,99,1.138,100,1.428,101,0.975,103,2.374,104,3.501,105,1.439,106,3.167,107,1.958,108,1.919,109,1.154,132,1.176,133,1.51,134,1.494,139,1.525,235,3.269,279,2.83,287,2.966,318,0.735,546,1.133,582,1.051,638,2.748,743,2.423,778,3.501,888,3.782,908,2.202,928,2.202,1035,1.322,1036,1.322,1066,1.296,1088,4.033,1089,2.509,1090,2.509,1091,2.509,1113,3.126,1114,3.126]],["t/803",[3,0.845,7,1.223,14,2.795,87,1.223,94,1.276,95,1.657,99,1.168,100,1.475,101,1.038,109,1.228,132,1.252,133,1.56,134,1.559,139,1.622,235,3.413,279,3.011,287,3.157,318,0.783,546,1.205,582,1.118,743,2.578,892,4.832,908,2.343,928,2.343,1035,1.406,1036,1.406,1040,3.785,1041,3.785,1042,5.18,1043,3.785,1066,1.379,1088,4.167,1089,2.67,1090,2.67,1091,2.67,1113,3.326,1114,3.326]],["t/805",[3,0.847,7,1.125,14,2.57,23,3.039,87,1.125,94,1.131,95,1.469,99,1.109,100,1.383,101,0.92,109,1.089,132,1.11,133,1.463,134,1.433,139,1.438,235,3.138,279,2.669,287,2.798,318,0.694,451,2.141,546,1.068,582,0.991,612,3.244,743,2.285,908,2.077,928,2.077,1035,1.246,1036,1.246,1044,3.355,1045,5.31,1046,6.028,1047,4.763,1048,3.488,1049,3.488,1050,4.763,1051,3.355,1066,1.222,1088,3.907,1089,2.367,1090,2.367,1091,2.367,1113,2.948,1114,2.948]],["t/807",[3,0.836,7,1.181,14,2.259,23,3.784,87,0.988,94,0.947,95,1.23,99,1.091,100,1.385,101,1.372,103,2.003,108,1.619,109,1.359,132,1.385,133,1.642,134,1.669,139,1.204,140,1.344,235,2.758,279,2.235,287,2.343,318,1.035,372,1.23,546,1.333,566,2.469,582,1.236,616,1.204,655,2.469,717,3.679,743,1.914,908,1.739,928,1.739,982,4.563,1035,1.044,1036,1.044,1045,2.343,1048,2.057,1049,3.066,1052,4.624,1053,4.624,1054,2.809,1055,2.809,1056,2.809,1057,4.186,1058,4.186,1059,4.186,1060,2.809,1061,4.186,1062,4.186,1064,4.186,1065,2.809,1066,1.525,1088,3.53,1089,1.982,1090,1.982,1091,1.982,1113,2.469,1114,2.469]],["t/809",[3,0.738,23,3.248,315,4.473,395,4.245,522,3.879,524,4.473,552,4.747,615,4.473,626,4.747,899,4.747,931,3.777,1048,4.601,1049,3.727,1052,5.24,1053,5.24,1067,5.089,1068,5.089,1069,5.089,1070,5.089,1071,5.089,1072,5.089]],["t/811",[3,0.843,7,1.092,14,2.495,99,1.236,108,1.244,111,2.199,133,1.723,134,1.628,139,1.982,140,1.539,235,3.046,267,2.271,320,1.172,326,3.077,425,3.149,546,1.723,582,1.747,772,3.678,778,3.262,843,3.678,883,5.516,884,4.311,888,3.523,908,1.992,1066,1.971,1073,3.217,1074,3.217,1075,4.623,1076,3.217,1077,3.217,1078,3.217,1079,4.623,1114,2.828,1115,6.639]],["t/814",[428,2.423,906,4.124,908,4.247,953,4.158,1080,3.901]],["t/817",[3,0.828,13,1.835,87,0.788,99,1.169,100,0.834,101,0.915,109,1.084,110,2.418,111,1.862,116,2.628,117,2.561,118,3.127,119,2.437,125,2.271,132,1.104,133,1.459,134,1.429,172,1.696,229,1.494,318,0.69,372,1.462,388,1.344,438,1.291,474,1.674,514,1.597,546,1.063,582,0.986,607,1.401,610,1.714,616,2.912,620,1.527,695,2.379,696,1.714,890,1.527,915,1.291,930,2.628,1035,1.241,1036,1.241,1066,1.216,1096,1.898,1102,3.114,1103,4.427,1104,2.853,1105,1.714,1106,1.714,1107,1.635,1108,1.597,1116,3.127,1117,2.699,1118,4.172]],["t/819",[3,0.841,13,2.273,87,0.75,99,1.146,100,0.793,101,0.87,109,1.03,110,2.351,111,1.81,116,2.535,117,2.47,118,3.016,119,2.351,125,2.19,132,1.05,133,1.418,134,1.378,172,1.636,186,3.016,229,1.42,318,0.656,388,1.278,428,1.882,438,1.227,474,1.591,514,1.519,546,1.011,582,0.938,607,1.332,610,1.63,616,2.783,620,1.452,695,2.295,696,1.63,890,1.452,915,1.227,930,2.535,1035,1.179,1036,1.179,1066,1.156,1096,1.805,1104,2.752,1105,1.63,1106,1.63,1107,1.554,1108,1.519,1109,2.419,1110,1.63,1116,3.016,1117,2.603,1118,4.023]],["t/821",[3,0.843,13,2.259,87,0.74,99,1.14,100,0.782,101,0.859,109,1.017,110,2.334,111,1.797,116,2.511,117,2.447,118,2.987,119,2.328,125,2.169,132,1.036,133,1.408,134,1.365,172,1.62,186,2.987,229,1.402,318,0.648,388,1.261,428,1.864,438,1.211,474,1.57,514,1.499,546,0.997,582,0.925,607,1.315,610,1.608,616,2.857,620,1.433,695,2.273,696,1.608,890,1.433,915,1.211,930,2.511,1035,1.164,1036,1.164,1066,1.141,1096,1.781,1104,2.726,1105,1.608,1106,1.608,1107,1.533,1108,1.499,1109,2.387,1110,1.608,1116,2.987,1117,2.578,1118,3.985]],["t/824",[915,2.399,1080,3.527]],["t/826",[1080,3.527,1110,3.185]],["t/828",[3,0.838,7,0.739,13,0.748,14,1.69,15,2.293,91,1.318,99,1.11,100,0.483,101,1.601,102,1.498,105,1.144,106,1.235,107,1.236,108,1.753,109,0.628,111,1.056,115,0.795,132,0.64,133,1.197,134,0.582,140,0.926,188,2.921,235,1.275,237,2.076,239,1.54,267,1.656,294,2.209,295,2.109,318,0.648,320,0.705,326,1.781,412,1.804,425,3.088,436,4.228,452,1.614,453,2.109,472,2.109,473,1.935,478,2.109,482,2.109,496,1.475,503,2.109,546,0.616,556,1.7,614,1.935,632,3.945,638,1.734,647,1.935,648,3.131,656,2.752,766,4.942,772,1.54,778,2.783,826,3.945,851,2.752,862,2.109,877,2.783,888,3.007,962,3.131,975,4.3,977,2.109,978,3.414,983,3.414,984,2.109,985,2.109,987,3.414,988,2.109,989,5.428,990,2.109,991,2.109,992,3.414,1014,2.752,1022,2.109,1119,3.843,1120,2.374,1121,2.374,1122,3.843,1123,3.843,1124,2.109,1125,2.374,1126,2.374,1127,2.374,1128,4.841,1129,4.3,1130,5.563,1131,6.11,1132,5.563,1133,3.843,1134,2.374,1135,2.374,1136,2.374,1137,3.843,1138,2.374,1139,4.841,1140,2.374,1141,3.843,1142,2.374,1143,2.374,1144,2.374,1145,2.374,1146,2.374,1147,2.374,1148,2.374,1149,2.374,1150,2.374,1151,2.374,1152,2.374]],["t/831",[3,0.831,13,1.811,87,0.774,99,1.161,100,0.818,101,0.898,105,1.358,109,1.064,110,2.394,111,1.843,115,1.925,117,2.527,119,2.405,125,2.241,132,1.084,133,1.444,134,1.41,172,1.673,229,1.466,248,2.989,318,0.678,320,1.707,372,1.435,388,1.32,438,1.267,474,1.643,514,1.568,546,1.044,582,0.968,607,1.375,609,3.086,610,1.683,616,2.704,620,1.499,695,2.348,696,1.683,890,1.499,915,1.267,931,2.816,1035,1.218,1036,1.218,1066,1.194,1096,1.863,1102,3.056,1103,4.368,1104,2.816,1105,1.683,1106,1.683,1107,1.604,1108,1.568,1117,2.663,1153,4.116]],["t/833",[3,0.842,13,2.254,87,0.736,99,1.138,100,0.779,101,0.855,105,1.31,109,1.012,110,2.328,111,1.792,115,1.858,117,2.439,119,2.321,125,2.162,132,1.032,133,1.404,134,1.36,172,1.615,186,2.978,229,1.395,248,2.884,318,0.645,320,1.647,388,1.256,428,1.858,438,1.206,474,1.563,514,1.492,546,0.993,582,0.921,607,1.309,609,2.978,610,1.601,616,2.499,620,1.426,695,2.265,696,1.601,890,1.426,915,1.206,931,2.717,1035,1.159,1036,1.159,1066,1.136,1096,1.773,1104,2.717,1105,1.601,1106,1.601,1107,1.527,1108,1.492,1109,2.377,1110,1.601,1117,2.57,1153,3.972]],["t/835",[3,0.844,13,2.24,87,0.727,99,1.132,100,0.769,101,0.844,105,1.298,109,0.999,110,2.31,111,1.779,115,1.84,117,2.416,119,2.299,125,2.142,132,1.018,133,1.394,134,1.347,172,1.599,186,2.949,229,1.377,248,2.857,318,0.636,320,1.631,388,1.239,428,1.84,438,1.19,474,1.543,514,1.472,546,0.98,582,0.909,607,1.292,609,2.949,610,1.58,616,2.639,620,1.408,695,2.244,696,1.58,890,1.408,915,1.19,931,2.691,1035,1.144,1036,1.144,1066,1.121,1096,1.75,1104,2.691,1105,1.58,1106,1.58,1107,1.507,1108,1.472,1109,2.346,1110,1.58,1117,2.546,1153,3.934]],["t/838",[915,2.399,1080,3.527]],["t/840",[1080,3.527,1110,3.185]],["t/842",[3,0.598,45,3.229,46,3.142,113,2.473,138,5.526,388,2.225,450,3.421,451,3.526,452,4.609,454,3.089,757,4.397,930,3.06,931,3.322,932,3.142,1101,6.024]],["t/844",[172,2.16,454,2.827,607,2.537,745,4.81,1154,5.637]],["t/846",[3,0.815,13,1.946,87,1.189,99,1.063,100,0.907,101,0.995,105,1.459,109,1.178,110,2.53,111,1.948,115,2.069,116,2.787,119,2.584,125,2.408,132,1.201,133,1.526,134,1.515,172,1.297,229,1.624,248,3.212,318,0.751,320,1.834,372,1.589,388,1.462,438,1.403,474,1.819,514,1.736,546,1.156,582,1.072,607,1.523,610,1.864,620,1.66,695,2.523,696,1.864,820,3.19,890,1.66,915,1.403,932,2.862,1035,1.349,1036,1.349,1066,1.322,1096,2.064,1104,3.026,1105,1.864,1106,1.864,1107,1.777,1108,1.736,1155,4.694]],["t/848",[3,0.835,13,2.351,87,1.14,99,1.029,100,0.854,101,0.937,105,1.4,109,1.11,110,2.45,111,1.887,112,3.535,115,1.984,116,2.673,119,2.479,125,2.31,132,1.131,133,1.478,134,1.453,172,1.222,229,1.53,248,3.081,318,0.707,320,1.759,388,1.377,428,1.984,438,1.322,474,1.714,514,1.636,546,1.089,582,1.01,607,1.435,610,1.756,620,1.564,695,2.42,696,1.756,890,1.564,915,1.322,932,2.745,1035,1.271,1036,1.271,1066,1.246,1096,1.944,1104,2.902,1105,1.756,1106,1.756,1107,1.674,1108,1.636,1110,1.756,1156,3.005]],["t/851",[915,2.399,1080,3.527]],["t/853",[1080,3.527,1110,3.185]],["t/855",[172,2.16,454,2.827,607,2.537,745,4.81,1154,5.637]],["t/857",[3,0.83,13,1.946,87,1.189,99,1.063,100,0.907,101,0.995,105,1.459,109,1.178,111,1.948,113,2.252,115,2.069,116,2.787,117,2.716,118,3.316,125,2.408,132,1.201,133,1.526,134,1.515,229,1.624,267,2.751,318,0.751,326,2.862,372,1.589,388,1.462,438,1.403,474,1.819,514,1.736,546,1.156,582,1.487,607,1.523,620,1.66,695,2.523,820,3.19,890,1.66,1035,1.349,1036,1.349,1066,1.322,1105,1.864,1106,1.864,1107,1.777,1108,1.736,1155,4.694]],["t/859",[3,0.843,13,2.351,87,1.14,99,1.029,100,0.854,101,0.937,105,1.4,109,1.11,111,1.887,112,3.535,113,2.16,115,1.984,116,2.673,117,2.605,118,3.18,125,2.31,132,1.131,133,1.478,134,1.453,229,1.53,267,2.691,318,0.707,326,2.745,388,1.377,428,1.984,438,1.322,474,1.714,514,1.636,546,1.089,582,1.426,607,1.435,620,1.564,695,2.42,890,1.564,1035,1.271,1036,1.271,1066,1.246,1105,1.756,1106,1.756,1107,1.674,1108,1.636,1110,1.756,1156,3.005]],["t/861",[3,0.841,13,2.326,87,1.121,99,1.016,100,0.834,101,0.915,105,1.376,109,1.084,111,1.862,112,3.476,113,2.124,115,1.951,116,2.628,117,2.561,118,3.127,125,2.271,132,1.104,133,1.459,134,1.429,229,1.494,237,2.498,267,2.667,318,0.69,326,2.699,335,2.545,352,3.777,388,1.344,428,1.951,438,1.291,474,1.674,514,1.597,546,1.063,582,1.402,607,1.401,620,1.527,695,2.379,890,1.527,1035,1.241,1036,1.241,1066,1.216,1105,1.714,1106,1.714,1107,1.635,1108,1.597,1110,1.714,1156,2.934]],["t/864",[1080,3.527,1110,3.185]],["t/866",[172,2.16,454,2.827,607,2.537,745,4.81,1154,5.637]],["t/868",[3,0.802,13,1.933,87,1.18,99,1.057,100,0.897,101,0.985,109,1.166,110,2.517,111,1.938,116,2.767,117,2.697,118,3.293,119,2.566,125,2.391,132,1.188,133,1.518,134,1.504,172,1.284,229,1.608,318,0.743,372,1.573,388,1.447,438,1.389,474,1.801,514,1.719,546,1.144,582,1.061,607,1.508,610,1.845,616,2.142,620,1.643,695,2.505,696,1.845,820,3.157,890,1.643,915,1.389,930,2.767,1035,1.335,1036,1.335,1066,1.309,1096,2.043,1104,3.004,1105,1.845,1106,1.845,1107,1.759,1108,1.719,1116,3.293,1117,2.842,1118,4.392,1155,4.661]],["t/870",[3,0.829,13,2.341,87,1.132,99,1.024,100,0.846,101,0.928,109,1.099,110,2.437,111,1.877,112,3.512,116,2.655,117,2.587,118,3.159,119,2.462,125,2.294,132,1.12,133,1.47,134,1.443,172,1.21,229,1.515,318,0.7,388,1.364,428,1.971,438,1.31,474,1.698,514,1.62,546,1.079,582,1,607,1.421,610,1.739,616,2.055,620,1.549,695,2.403,696,1.739,890,1.549,915,1.31,930,2.655,1035,1.258,1036,1.258,1066,1.234,1096,1.926,1104,2.882,1105,1.739,1106,1.739,1107,1.658,1108,1.62,1110,1.739,1116,3.159,1117,2.726,1118,4.214,1156,2.976]],["t/873",[915,2.399,1080,3.527]],["t/875",[1080,3.527,1110,3.185]],["t/877",[3,0.838,7,0.705,13,1.694,38,2.491,87,0.705,99,1.169,102,1.429,103,1.429,105,0.866,106,1.906,107,1.179,110,2.271,111,1.477,113,1.337,114,2.56,133,1.37,139,1.28,140,1.429,239,2.377,267,2.177,278,1.497,318,0.618,335,3.338,342,1.572,438,1.155,498,2.987,610,1.534,638,1.654,642,3.849,692,2.987,731,6.227,785,2.987,786,2.987,787,2.987,788,2.987,789,2.987,790,2.987,918,2.377,930,1.654,931,1.796,932,1.698,1013,2.786,1014,2.625,1124,3.256,1157,3.665,1158,3.256,1159,3.256,1160,3.665,1161,3.256,1162,3.256,1163,3.256,1164,3.256,1165,3.256,1166,3.256,1167,3.665,1168,3.256,1169,3.256,1170,3.256,1171,3.665,1172,3.665,1173,3.665,1174,3.256,1175,3.256,1176,3.665,1177,3.665,1178,3.665,1179,3.665,1180,3.665,1181,5.375,1182,3.665,1183,3.665,1184,3.665,1185,3.665,1186,3.665,1187,3.665,1188,3.665,1189,3.665]],["t/879",[3,0.852,14,2.098,87,0.918,99,0.715,100,0.971,103,1.86,104,2.743,105,1.127,106,3.368,107,1.534,108,1.504,111,2.166,133,1.027,251,3.368,267,2.215,318,0.804,326,3.001,638,2.153,713,5.753,772,3.094,928,2.407,1013,3.626,1014,3.417,1129,4.239,1190,4.772,1191,6.475,1192,4.772,1193,4.772,1194,4.772,1195,4.772,1196,6.475,1197,4.239,1198,4.772,1199,4.772,1200,4.772]],["t/882",[3,0.839,13,1.86,87,0.804,99,1.177,100,0.85,101,0.933,105,1.395,109,1.104,111,1.882,113,2.153,115,1.978,116,2.664,117,2.596,118,3.17,125,2.302,132,1.126,133,1.474,134,1.448,172,1.216,229,1.523,267,2.686,318,0.704,326,2.736,372,1.49,388,1.37,438,1.316,474,1.706,514,1.628,546,1.084,582,1.421,607,1.428,616,2.744,620,1.556,695,2.412,890,1.556,1035,1.264,1036,1.264,1066,1.24,1102,3.174,1103,4.487,1105,1.747,1106,1.747,1107,1.666,1108,1.628]],["t/884",[3,0.847,13,2.292,87,0.763,99,1.154,100,0.807,101,0.886,105,1.345,109,1.049,111,1.829,113,2.075,115,1.906,116,2.568,117,2.503,118,3.055,125,2.219,132,1.069,133,1.433,134,1.396,172,1.155,186,3.055,229,1.446,267,2.634,318,0.668,326,2.637,388,1.302,428,1.906,438,1.25,474,1.62,514,1.546,546,1.029,582,1.37,607,1.357,616,2.541,620,1.478,695,2.325,890,1.478,1035,1.201,1036,1.201,1066,1.178,1105,1.66,1106,1.66,1107,1.582,1108,1.546,1109,2.463,1110,1.66]],["t/886",[3,0.849,13,2.278,87,0.753,99,1.148,100,0.796,101,0.874,105,1.332,109,1.035,111,1.815,113,2.055,115,1.888,116,2.543,117,2.478,118,3.026,125,2.197,132,1.055,133,1.422,134,1.382,172,1.139,186,3.026,229,1.427,267,2.62,318,0.659,326,2.612,388,1.284,428,1.888,438,1.233,474,1.598,514,1.525,546,1.015,582,1.357,607,1.338,616,2.676,620,1.458,695,2.302,890,1.458,1035,1.185,1036,1.185,1066,1.162,1105,1.637,1106,1.637,1107,1.561,1108,1.525,1109,2.43,1110,1.637]],["t/889",[1080,3.527,1110,3.185]],["t/891",[3,0.849,7,0.617,27,3.483,38,2.179,87,0.617,99,1.113,100,0.652,108,1.01,111,1.336,114,2.799,115,1.074,139,1.12,140,1.25,239,2.079,251,2.529,278,1.31,318,0.54,342,1.375,370,2.612,438,1.01,452,2.179,498,3.963,504,3.963,522,3.65,570,2.296,606,2.612,638,1.447,665,2.612,667,3.963,737,2.848,785,2.612,786,2.612,787,2.612,788,2.612,789,3.963,790,4.789,1013,2.437,1014,2.296,1020,2.848,1158,2.848,1159,2.848,1161,2.848,1162,2.848,1163,2.848,1164,2.848,1165,2.848,1166,2.848,1168,2.848,1169,2.848,1170,4.321,1174,2.848,1175,2.848,1201,3.206,1202,3.206,1203,3.206,1204,4.864,1205,3.206,1206,4.864,1207,3.206,1208,3.206,1209,3.206,1210,3.206,1211,3.206,1212,3.206,1213,3.206,1214,3.206,1215,3.206,1216,3.206,1217,3.206,1218,4.864,1219,3.206,1220,3.206,1221,3.206,1222,3.206,1223,3.206,1224,3.206,1225,3.206,1226,4.864,1227,3.206,1228,4.864,1229,3.206,1230,3.206,1231,3.206,1232,3.206,1233,3.206,1234,3.206,1235,3.206,1236,3.206,1237,3.206,1238,3.206]],["t/893",[172,2.16,454,2.827,607,2.537,745,4.81,1154,5.637]],["t/895",[3,0.819,13,1.893,87,1.156,99,1.04,100,0.871,101,0.956,105,1.419,109,1.132,110,2.476,111,1.907,115,2.012,117,2.641,119,2.513,125,2.342,132,1.153,133,1.494,134,1.473,172,1.246,229,1.56,248,3.123,318,0.721,320,1.783,372,1.527,388,1.404,438,1.348,474,1.748,514,1.668,546,1.11,582,1.03,607,1.463,609,3.224,610,1.79,620,1.595,695,2.453,696,1.79,820,3.064,890,1.595,915,1.348,931,2.942,1035,1.296,1036,1.296,1066,1.27,1096,1.983,1104,2.942,1105,1.79,1106,1.79,1107,1.707,1108,1.668,1117,2.783,1153,4.301,1155,4.565]],["t/897",[3,0.836,13,2.311,87,1.11,99,1.008,100,0.822,101,0.903,105,1.362,109,1.068,110,2.4,111,1.848,112,3.442,115,1.932,117,2.536,119,2.413,125,2.248,132,1.089,133,1.447,134,1.414,172,1.176,229,1.473,248,2.999,318,0.681,320,1.712,388,1.326,428,1.932,438,1.273,474,1.65,514,1.575,546,1.048,582,0.972,607,1.382,609,3.096,610,1.69,620,1.506,695,2.356,696,1.69,890,1.506,915,1.273,931,2.825,1035,1.223,1036,1.223,1066,1.199,1096,1.872,1104,2.825,1105,1.69,1106,1.69,1107,1.612,1108,1.575,1110,1.69,1117,2.672,1153,4.13,1156,2.893]],["t/900",[915,2.399,1080,3.527]],["t/902",[1080,3.527,1110,3.185]],["t/904",[3,0.857,7,0.818,14,1.869,16,2.686,94,1.168,95,1.176,99,0.745,100,0.671,101,1.235,103,0.768,105,1.732,107,0.634,113,2.016,114,2.365,115,2.126,229,0.719,237,2.13,273,1.967,278,0.805,294,1.133,309,1.606,310,1.663,320,0.585,342,0.845,372,0.703,409,0.994,425,1.094,477,1.83,492,2.047,499,1.058,557,1.751,582,1.664,607,1.127,612,1.094,616,0.688,638,0.889,682,2.138,751,1.224,846,1.224,850,1.058,854,3.787,877,1.133,900,3.557,908,2.788,913,1.224,914,1.77,915,0.621,918,3.221,922,1.967,923,2.138,930,3.002,931,2.433,932,0.913,953,1.133,954,1.176,955,2.929,1116,1.058,1117,1.527,1239,1.278,1240,1.971,1241,2.138,1242,2.138,1243,1.971,1244,1.971,1245,1.971,1246,1.278,1247,1.971,1248,1.278,1249,1.278,1250,1.278,1251,1.278,1252,1.971,1253,2.138,1254,2.138,1255,2.138,1256,1.278,1257,1.278,1258,1.971,1259,1.278,1260,1.278,1261,1.278,1262,1.498,1263,1.278,1264,1.498,1265,1.971,1266,1.971,1267,4.249,1268,3.296,1269,1.971,1270,1.971,1271,4.249,1272,3.296,1273,1.971,1274,1.971,1275,1.971,1276,1.971,1277,1.971,1278,1.971,1279,6.653,1280,3.296,1281,1.971,1282,3.296,1283,3.296,1284,1.971,1285,3.296,1286,1.971,1287,3.296,1288,3.296]],["t/906",[3,0.854,7,0.585,87,0.585,94,0.835,95,1.084,99,0.956,101,1.624,103,1.184,105,1.932,107,0.977,113,1.108,114,3.038,115,2.535,172,0.884,273,2.786,278,1.241,294,1.747,310,2.355,318,0.512,320,0.902,328,1.887,342,1.303,372,1.084,409,1.532,477,1.686,492,1.887,499,1.631,612,1.686,616,1.061,638,1.371,751,1.887,846,1.887,850,1.631,854,4.517,877,1.747,906,2.287,907,1.97,913,1.887,914,3.052,915,0.957,922,2.786,930,2.879,932,1.408,953,2.684,954,2.786,1116,1.631,1117,2.163,1239,1.97,1241,1.97,1242,1.97,1246,1.97,1248,1.97,1249,1.97,1250,1.97,1251,1.97,1253,3.027,1254,3.027,1255,3.027,1256,1.97,1257,1.97,1259,1.97,1260,1.97,1261,1.97,1262,2.309,1263,1.97,1264,2.309,1289,2.065,1290,2.065,1291,2.065,1292,2.309]],["t/908",[3,0.855,7,0.569,87,0.569,94,0.812,95,1.055,99,0.942,101,1.606,103,1.152,105,1.918,107,0.95,113,1.078,114,2.994,115,2.51,172,0.86,237,1.267,251,1.537,273,2.727,278,1.207,294,1.699,310,2.305,318,0.498,320,1.357,328,1.836,342,1.267,352,1.916,372,1.055,409,1.491,477,1.64,492,1.836,499,1.587,612,1.64,616,1.032,638,1.334,751,1.836,846,1.836,850,1.587,854,4.472,877,1.699,906,2.239,907,1.916,913,1.836,914,3,915,0.931,922,2.727,930,2.837,932,1.369,953,2.627,954,2.727,1116,1.587,1117,2.117,1239,1.916,1241,1.916,1242,1.916,1246,1.916,1248,1.916,1249,1.916,1250,1.916,1251,1.916,1253,2.963,1254,2.963,1255,2.963,1256,1.916,1257,1.916,1259,1.916,1260,1.916,1261,1.916,1263,1.916,1289,2.009,1290,2.009,1291,2.009,1292,2.246,1293,2.408,1294,2.408]],["t/910",[3,0.854,7,0.545,87,0.545,94,0.778,95,1.01,99,0.921,101,1.577,103,1.103,105,1.895,107,0.91,113,1.611,114,2.925,115,2.556,172,0.824,237,1.214,248,2.298,267,0.968,273,2.637,278,1.156,294,1.627,310,2.229,318,0.477,320,0.84,328,1.758,342,2.634,372,1.01,409,1.428,477,1.571,492,1.758,499,1.519,612,1.571,616,0.989,638,1.277,751,2.744,846,1.758,850,1.519,854,4.402,877,1.627,906,2.165,907,1.835,913,1.758,914,2.918,915,0.892,922,2.637,923,1.835,930,2.772,932,1.311,953,2.541,954,2.637,1116,1.519,1117,2.048,1239,1.835,1241,1.835,1242,1.835,1246,1.835,1248,1.835,1249,1.835,1250,1.835,1251,1.835,1253,2.865,1254,2.865,1255,2.865,1256,1.835,1257,1.835,1259,2.865,1260,1.835,1261,1.835,1262,2.151,1263,1.835,1264,2.151,1289,1.924,1290,1.924,1291,1.924,1292,2.151,1295,2.514,1296,2.514,1297,2.514]],["t/912",[3,0.854,7,0.446,41,1.439,87,0.446,94,0.637,95,0.827,99,0.969,101,1.586,103,0.903,105,1.783,107,0.745,113,1.374,114,2.612,115,2.283,172,0.675,251,1.205,267,1.289,273,3.273,278,0.947,294,1.332,310,2.766,318,0.39,320,0.688,328,1.439,342,0.994,372,0.827,388,0.76,409,1.169,477,1.286,492,1.439,499,1.244,581,1.761,582,0.907,610,0.97,612,2.643,616,0.809,620,2.249,638,1.046,668,1.888,751,1.439,764,1.761,795,1.575,797,1.575,846,1.439,850,1.244,851,1.66,854,4.067,877,2.166,906,1.846,907,1.503,913,1.439,914,2.556,915,1.5,916,1.66,918,1.503,922,2.249,929,1.66,930,2.475,932,1.746,935,1.66,936,1.66,937,1.66,940,4.469,945,1.888,953,2.166,954,2.249,1116,1.244,1117,1.746,1239,1.503,1241,1.503,1242,1.503,1246,1.503,1248,1.503,1249,1.503,1250,1.503,1251,1.503,1253,2.443,1254,2.443,1255,2.443,1256,1.503,1257,1.503,1259,1.503,1260,1.503,1261,1.503,1262,1.761,1263,1.503,1264,1.761,1289,2.561,1290,2.561,1291,1.575,1298,2.059,1299,2.059,1300,2.059,1301,4.872,1302,3.347,1303,2.059,1304,2.059,1305,2.059,1306,2.059,1307,2.059,1308,2.059,1309,2.059,1310,2.059]],["t/914",[3,0.855,7,0.437,41,1.409,87,0.437,94,0.623,95,0.81,99,0.96,101,1.574,103,0.885,105,1.771,107,0.73,113,1.35,114,2.579,115,2.262,172,0.661,237,0.973,251,1.926,267,1.267,273,3.232,278,0.927,294,1.305,310,2.732,318,0.382,320,1.1,328,1.409,342,0.973,352,1.471,372,0.81,388,0.745,409,1.145,477,1.259,492,1.409,499,1.218,581,1.724,582,0.891,610,0.949,612,2.605,616,0.793,620,2.224,638,1.024,668,1.849,751,1.409,764,1.724,795,1.542,797,1.542,846,1.409,850,1.218,851,1.625,854,4.031,877,2.129,906,1.814,907,1.471,913,1.409,914,2.519,915,1.479,916,1.625,918,1.471,922,2.21,929,1.625,930,2.444,932,1.716,935,1.625,936,1.625,937,1.625,940,4.413,945,1.849,953,2.129,954,2.21,1116,1.218,1117,1.716,1239,1.471,1241,1.471,1242,1.471,1246,1.471,1248,1.471,1249,1.471,1250,1.471,1251,1.471,1253,2.402,1254,2.402,1255,2.402,1256,1.471,1257,1.471,1259,1.471,1260,1.471,1261,1.471,1263,1.471,1289,2.517,1290,2.517,1291,1.542,1293,1.849,1294,1.849,1298,2.016,1299,2.016,1300,2.016,1301,4.811,1302,3.29,1303,2.016,1304,2.016,1305,2.016,1306,2.016,1307,2.016,1308,2.016,1309,2.016,1310,2.016]],["t/916",[57,2.644,191,4.115,318,1.117,450,3.342,518,5.887,521,5.4,604,5.887,696,2.772,850,3.557,994,5.887,995,5.887,996,5.887,997,5.887,998,5.887,999,5.887,1000,5.887,1311,5.4,1312,6.626,1313,6.626]],["t/918",[0,4.608,1,4.638,3,0.587,7,1.4,8,3.524,11,4.341,14,1.744,15,4.341,21,5.056,23,2.063,28,3.691,33,3.397,37,4.182,40,2.572,42,3.232,43,2.841,44,3.014,45,1.889,46,1.838,50,4.638,51,3.524,52,3.014,53,3.691,54,3.524,56,2.841,57,2.902,91,2.202,124,3.014,127,3.232,142,3.014,154,3.524,155,3.524,161,3.232,204,5.056,205,3.232,211,3.014,215,3.232,358,3.524,366,3.524,367,3.524,569,3.232,570,2.841,571,3.014,576,3.232,591,3.524,843,2.572,1314,3.966,1315,3.966,1316,3.966,1317,3.966,1318,5.691,1319,3.966,1320,3.966,1321,3.966,1322,5.691,1323,5.691,1324,3.966,1325,3.966,1326,3.966,1327,3.966,1328,3.966,1329,3.966,1330,3.966,1331,5.691,1332,3.966,1333,5.691,1334,3.966,1335,3.966,1336,3.966,1337,3.966,1338,3.966,1339,3.966,1340,3.966]],["t/920",[7,1.018,27,2.571,48,2.728,94,0.986,105,1.25,108,1.131,318,1.169,412,2.728,428,1.202,437,4.702,442,4.717,470,3.189,480,7.207,496,3.287,507,6.165,508,3.189,514,1.4,517,2.142,524,4.503,547,3.189,556,2.571,592,3.189,652,2.728,659,2.925,676,2.728,718,2.571,721,4.023,728,2.571,830,3.189,831,4.702,849,4.702,863,4.702,927,2.925,928,1.811,949,3.189,959,3.189,1341,3.59,1342,3.59,1343,3.59,1344,5.293,1345,8.006,1346,3.59,1347,5.293,1348,3.59,1349,3.59,1350,3.59,1351,3.59,1352,3.59,1353,3.59,1354,3.59,1355,3.59,1356,3.59,1357,5.293,1358,6.287,1359,3.59,1360,3.59,1361,3.59,1362,3.59,1363,3.59,1364,3.59,1365,3.59,1366,3.59,1367,3.59,1368,3.59,1369,3.59,1370,5.293,1371,3.59,1372,3.59,1373,3.59,1374,3.59,1375,5.293,1376,3.59,1377,3.59,1378,3.59,1379,3.59,1380,3.59,1381,3.59,1382,5.293,1383,3.59,1384,3.59,1385,3.59,1386,3.59,1387,3.59,1388,3.59,1389,3.59]],["t/922",[57,2.664,87,1.285,172,1.944,229,2.435,521,5.441,546,2.084,607,2.284,677,5.075,890,2.489,1096,3.094,1108,2.603,1390,6.677,1391,6.677,1392,6.677,1393,6.677,1394,6.677,1395,6.677]],["t/924",[3,0.841,7,1.044,14,1.24,87,0.848,99,0.997,100,1.552,102,1.1,103,2.115,105,1.282,107,1.744,108,2.096,133,1.897,139,1.895,172,1.283,229,1.978,235,1.515,267,1.508,320,1.821,326,2.042,517,3.97,546,2.252,582,1.476,677,5.056,745,2.858,757,3.976,777,2.144,808,2.299,890,2.022,1038,1.829,1066,1.975,1083,1.752,1084,1.752,1107,2.446,1108,2.115,1197,2.506,1311,2.299,1396,5.91,1397,2.506,1398,2.506,1399,2.821,1400,2.821,1401,6.132,1402,2.821,1403,2.506,1404,2.506,1405,2.821,1406,2.506,1407,2.506,1408,3.916,1409,2.506,1410,2.506]],["t/926",[3,0.843,7,1.012,14,1.183,87,0.817,94,1.445,95,1.877,99,1.036,100,1.473,101,1.453,102,1.049,103,2.051,105,1.243,107,1.691,108,2.049,109,2.09,132,2.13,133,1.79,134,1.041,172,1.236,229,1.918,235,1.444,267,1.452,279,1.744,320,1.774,326,1.968,517,3.881,523,5.299,546,2.158,677,4.942,745,2.753,890,1.961,1066,1.931,1083,1.671,1084,1.671,1107,2.595,1108,2.051,1311,2.192,1396,5.777,1397,2.39,1398,2.39,1403,2.39,1404,2.39,1406,2.39,1407,2.39,1408,3.772,1409,2.39,1410,2.39,1411,2.69]],["t/928",[1412,7.546,1413,7.546,1414,7.546]],["t/930",[3,0.855,7,0.531,87,0.531,94,0.758,95,0.984,99,0.908,101,1.561,103,1.075,105,1.881,107,0.887,113,1.579,114,2.885,115,2.534,172,0.803,237,1.857,248,2.252,251,1.435,267,0.943,273,2.585,278,1.127,294,1.586,310,2.185,318,0.465,320,1.286,328,1.713,342,2.597,352,1.789,372,0.984,409,1.391,477,1.531,492,1.713,499,1.481,612,1.531,616,0.964,638,1.245,751,2.69,846,1.713,850,1.481,854,4.36,877,1.586,906,2.122,907,1.789,913,1.713,914,2.87,915,0.869,922,2.585,923,1.789,930,2.733,932,1.278,953,2.49,954,2.585,1116,1.481,1117,2.007,1239,1.789,1241,1.789,1242,1.789,1246,1.789,1248,1.789,1249,1.789,1250,1.789,1251,1.789,1253,2.808,1254,2.808,1255,2.808,1256,1.789,1257,1.789,1259,2.808,1260,1.789,1261,1.789,1263,1.789,1289,1.875,1290,1.875,1291,1.875,1292,2.096,1293,2.248,1294,2.248,1295,2.451,1296,2.451,1297,2.451]]],"invertedIndex":[["",{"_index":3,"t":{"622":{"position":[[20,1],[195,1],[269,1]]},"628":{"position":[[160,2],[215,2],[271,1],[355,3],[359,2],[383,1],[409,1],[443,1],[471,1],[490,1],[496,2],[521,2],[597,2],[677,1],[691,1],[711,1],[713,2],[765,1],[783,1],[817,1],[845,1],[847,1],[859,1],[861,3],[878,2],[903,1],[917,1],[937,1],[939,2],[970,1],[991,2],[1047,1],[1125,3],[1129,2],[1175,1],[1203,1],[1222,1],[1261,1],[1285,2],[1361,2],[1441,1],[1443,2],[1446,2],[1520,1],[1548,1],[1550,1],[1562,1],[1564,3],[1606,1],[1630,1],[1632,2]]},"630":{"position":[[235,1],[837,1],[839,2],[895,1],[979,3],[983,2],[1078,1],[1114,1],[1142,1],[1144,1],[1156,1],[1158,3],[1181,2],[1206,2],[1282,2],[1362,1],[1376,1],[1396,1],[1410,1],[1431,2],[1487,1],[1565,3],[1569,2],[1668,1],[1696,1],[1698,1],[1710,1],[1712,3],[1768,1],[1792,2],[1868,2],[1948,1],[1950,2]]},"632":{"position":[[292,1],[476,2],[586,1],[718,2],[765,1],[817,2],[888,1],[962,3],[978,1],[999,2],[1109,1],[1241,2],[1288,1],[1340,2],[1411,1],[1485,3],[1735,1],[1737,2],[1804,1],[1855,2],[1868,1],[1921,1],[1933,1],[1947,1],[1967,1],[1969,2],[2086,1],[2088,2],[2101,1],[2154,1],[2166,3],[2307,2],[2364,1],[2394,2],[2442,3],[2446,4],[2451,2],[2537,2],[2623,1],[2625,2],[2667,3],[2671,4],[2676,2],[2762,3]]},"634":{"position":[[143,1],[145,2],[201,1],[285,3],[289,2],[340,1],[376,1],[404,1],[406,1],[418,1],[420,3],[438,2],[441,1],[568,2],[623,2],[722,2],[800,1],[903,3],[907,2],[958,1],[994,1],[1022,1],[1024,1],[1036,1],[1038,3],[1056,2],[1233,1],[1235,2],[1265,1],[1337,3],[1341,2],[1410,1],[1428,2],[1482,1],[1521,1],[1659,1],[1680,2],[1709,1],[1787,3],[1849,2],[1852,1],[1873,2],[1905,2]]},"636":{"position":[[145,1],[452,1],[555,3],[570,1],[667,3],[705,1],[731,1],[809,3],[835,2],[943,2],[977,1],[991,1],[1011,1],[1025,1],[1084,2],[1119,1],[1143,2],[1251,2],[1285,1],[1287,2]]},"638":{"position":[[9,1],[96,1],[304,1]]},"646":{"position":[[632,1]]},"650":{"position":[[122,1],[132,1],[191,1],[246,2],[249,2],[252,2]]},"652":{"position":[[49,1],[61,1],[123,2],[170,2]]},"654":{"position":[[7,1],[13,1],[68,1]]},"656":{"position":[[7,1],[27,1],[216,2],[385,2]]},"664":{"position":[[254,1],[278,1]]},"670":{"position":[[837,1],[941,1],[968,2],[980,2],[983,1],[1014,1],[1051,2],[1054,1],[1071,1],[1109,2],[1173,2],[1189,2],[1192,1],[1194,2],[1259,3],[1263,2],[1266,2],[1269,2],[1272,3],[1687,1],[1806,2],[1832,2],[1839,1],[1856,3],[1876,1],[1898,2],[1901,1],[1918,1],[1946,2],[1993,2],[2085,3],[2089,1],[2096,1],[2108,1],[2175,2],[2188,1],[2205,1],[2207,2],[2210,3]]},"672":{"position":[[523,1],[674,1],[676,2],[689,3],[727,2],[740,2],[743,1],[780,1],[836,2],[839,2],[867,2],[880,2],[883,1],[920,1],[976,2],[979,2],[1007,2],[1020,2],[1023,1],[1060,1],[1116,2],[1119,2],[1122,2],[1125,3]]},"675":{"position":[[60,1],[62,1],[64,1],[66,1],[100,2],[103,1],[105,2],[114,1],[116,1],[129,1],[131,1],[133,2],[157,1],[159,1],[161,1],[163,1],[243,3],[247,2],[287,1],[289,1],[291,1],[293,1],[359,1],[361,1],[363,1],[365,1]]},"677":{"position":[[165,1],[167,1],[169,1],[199,2],[202,1],[204,2],[266,3],[295,2],[395,1],[407,2],[423,2],[489,2],[492,1],[494,2],[498,1],[500,1],[502,1],[513,1],[515,1],[517,3],[521,2],[573,2],[683,3]]},"679":{"position":[[22,1]]},"681":{"position":[[63,1],[81,1],[96,1],[114,1],[155,1],[187,1],[230,1],[250,1]]},"683":{"position":[[105,1],[140,1],[201,1],[211,1],[256,2],[259,1],[333,1],[343,1],[388,2],[391,1],[466,1],[476,1],[528,1],[538,1],[583,2],[586,1],[620,1],[622,2],[625,1],[627,2],[630,1],[632,2]]},"688":{"position":[[69,1]]},"692":{"position":[[107,2],[255,2],[497,1]]},"697":{"position":[[162,1],[462,1],[500,1],[512,1],[525,2],[540,2],[543,1],[545,2],[578,1],[580,1],[582,1],[621,2],[639,1],[641,1],[648,1],[650,1],[652,3],[686,1],[698,1],[705,2],[720,2],[723,1],[725,2],[735,1],[737,1],[739,1],[767,3],[799,1],[811,1],[818,2],[833,2],[836,1],[838,2],[856,1],[865,3],[869,2],[973,1],[975,1],[977,1],[1006,2],[1009,1],[1011,2],[1029,1],[1038,3]]},"699":{"position":[[14,1],[16,1],[68,2],[112,2],[115,1],[117,2],[170,2],[241,2],[244,4],[249,2],[252,3]]},"701":{"position":[[453,2],[562,1],[590,2],[593,2],[619,1],[693,1],[727,1],[776,1],[798,2],[801,2],[816,2],[898,1],[927,1],[965,1],[1052,2],[1055,1],[1057,2],[1096,1],[1149,1],[1238,3],[1242,3],[1246,2],[1249,1],[1285,2],[1288,3],[1379,2]]},"703":{"position":[[10,1],[40,1],[73,1],[111,1],[226,2],[255,3],[592,1],[635,1],[668,1],[759,1],[777,1],[800,1],[834,2],[837,1],[869,1],[871,2],[895,2],[898,3]]},"708":{"position":[[233,1],[266,1]]},"710":{"position":[[14,1],[34,1],[83,1],[85,1],[119,2],[133,1]]},"712":{"position":[[14,1],[28,1],[71,1],[73,1],[107,2],[121,1]]},"714":{"position":[[37,1],[67,2],[70,1],[72,3],[76,1],[85,1],[87,1],[97,1],[99,1],[101,2],[104,3],[131,1],[161,2],[164,1],[166,3],[170,1],[179,1],[181,1],[191,1],[193,1],[195,2],[198,3]]},"717":{"position":[[68,1],[84,1],[112,1],[171,3],[175,2],[223,1],[253,2],[256,1],[277,3],[281,1],[290,1],[292,1],[302,1],[304,1],[306,2],[309,3],[313,2],[390,2],[393,1],[414,3],[418,1],[427,1],[429,1],[454,1],[456,1],[458,2],[461,3],[513,1],[529,1],[557,1],[635,3],[639,2],[688,1],[703,1],[731,2],[734,1],[755,3],[759,1],[768,1],[770,1],[777,1],[779,1],[781,2],[784,1],[786,2],[789,2],[866,2],[869,1],[890,3],[894,1],[903,1],[905,1],[914,1],[916,1],[918,2],[921,3]]},"719":{"position":[[85,1],[101,1],[129,1],[214,3],[228,1],[230,1],[241,1],[263,1],[276,2],[327,2],[330,1],[351,3],[355,1],[364,1],[366,1],[368,1],[378,1],[380,2],[383,1],[385,1],[395,1],[397,1],[399,1],[401,2],[404,3]]},"721":{"position":[[322,1],[340,1],[368,1],[427,3],[441,1],[443,1],[452,1],[457,2],[508,2],[511,1],[534,3],[538,1],[565,1],[618,3],[672,1],[674,2],[677,3]]},"723":{"position":[[173,1],[191,1],[219,1],[304,3],[318,1],[320,1],[329,1],[341,1],[346,2],[400,2],[403,1],[427,3],[431,1],[443,1],[461,1],[514,3],[569,2],[588,1],[641,3],[695,1],[697,1],[699,2],[702,3]]},"725":{"position":[[281,1],[320,1],[348,1],[407,3],[411,3],[431,2],[486,3],[506,2],[566,1],[578,1],[587,3],[591,3],[615,2],[628,1],[721,2],[724,1],[747,3],[751,1],[778,1],[831,3],[885,1],[887,2],[890,3],[1066,3],[1107,2]]},"733":{"position":[[0,2],[18,2],[33,1],[62,2],[136,2],[191,2],[194,2],[210,2],[271,2],[312,1],[356,2],[483,2],[486,1],[498,1],[563,2],[581,2],[584,1],[617,2],[633,2],[636,1],[656,2],[714,3]]},"735":{"position":[[26,1],[40,1],[80,1],[128,3],[153,1],[182,3],[222,1],[250,1],[264,1],[304,1],[340,3],[344,2],[480,3],[534,1]]},"737":{"position":[[12,1],[42,1],[72,2],[75,1],[85,1],[164,3],[179,1],[287,1],[299,4],[319,3]]},"743":{"position":[[35,1],[71,1],[113,1],[157,2],[217,2],[350,2],[355,1],[377,3],[430,2],[433,1],[461,2],[464,2]]},"747":{"position":[[103,1],[122,1],[198,2],[201,1],[215,1],[235,1],[249,1],[287,1],[357,2],[398,2],[401,1],[421,3]]},"749":{"position":[[107,1],[126,1],[210,2],[225,2],[238,3],[242,3],[246,1],[260,1],[280,1],[294,1],[332,1],[410,2],[425,2],[438,3],[442,3],[484,2],[487,1],[507,3]]},"751":{"position":[[107,1],[126,1],[159,2],[162,3],[243,2],[246,3],[250,1],[264,1],[284,1],[298,1],[336,1],[363,2],[366,3],[448,3],[490,2],[493,1],[513,3]]},"753":{"position":[[125,1],[144,1],[177,2],[180,3],[189,1],[191,2],[242,2],[338,2],[341,3],[345,1],[359,1],[379,1],[393,1],[431,1],[458,2],[461,3],[470,1],[472,2],[523,2],[619,2],[622,3],[664,2],[667,1],[687,3]]},"755":{"position":[[294,1],[313,1],[346,2],[349,3],[420,3],[424,1],[438,1],[458,1],[472,1],[486,1],[589,1],[603,1],[623,1],[637,1],[675,1],[702,2],[705,3],[776,3],[818,2],[821,1],[841,3],[924,1],[970,1],[998,1],[1018,3]]},"757":{"position":[[13,1],[77,1],[129,1]]},"759":{"position":[[66,1],[109,1],[148,1],[183,3],[204,1],[251,3],[293,2],[296,1],[316,3],[332,1],[375,1],[414,1],[468,2],[471,1],[513,3],[517,2],[520,3],[562,2],[565,1],[585,3],[666,2],[669,1],[697,1],[725,1],[754,3],[825,2],[828,1],[856,1],[884,1],[913,3],[984,2],[987,1],[1015,1],[1043,1],[1072,3]]},"766":{"position":[[105,1],[125,1],[228,2],[259,7],[284,1],[331,2],[334,3],[371,1],[385,1],[405,1],[419,1],[458,1],[561,2],[592,7],[665,1],[693,1],[721,1],[723,2],[726,3],[763,3]]},"768":{"position":[[103,1],[123,1],[180,1],[233,2],[248,2],[261,3],[265,3],[269,2],[300,7],[325,1],[372,2],[375,3],[412,1],[426,1],[446,1],[460,1],[499,1],[556,1],[609,2],[624,2],[637,3],[641,3],[645,2],[676,7],[749,1],[777,1],[805,1],[807,2],[810,3],[847,3]]},"770":{"position":[[103,1],[123,1],[180,1],[182,2],[185,3],[266,2],[269,3],[273,2],[304,7],[329,1],[376,2],[379,3],[416,1],[430,1],[450,1],[464,1],[503,1],[560,1],[562,2],[565,3],[647,3],[651,2],[682,7],[755,1],[783,1],[811,1],[813,2],[816,3],[853,3]]},"772":{"position":[[121,1],[141,1],[198,1],[200,2],[203,3],[212,1],[214,2],[265,2],[361,2],[364,3],[368,2],[399,7],[424,1],[471,2],[474,3],[511,1],[525,1],[545,1],[559,1],[598,1],[655,1],[657,2],[660,3],[669,1],[671,2],[722,2],[818,2],[821,3],[825,2],[856,7],[929,1],[957,1],[985,1],[987,2],[990,3],[1027,3]]},"774":{"position":[[290,1],[310,1],[367,1],[369,2],[372,3],[443,3],[447,2],[478,7],[503,1],[550,2],[553,3],[590,1],[604,1],[624,1],[638,1],[652,1],[756,1],[770,1],[790,1],[804,1],[843,1],[900,1],[902,2],[905,3],[976,3],[980,2],[1011,7],[1084,1],[1112,1],[1140,1],[1142,2],[1145,3],[1182,3],[1265,1],[1312,1],[1340,1],[1360,3]]},"776":{"position":[[13,1],[77,1],[129,1]]},"778":{"position":[[62,1],[105,1],[144,1],[179,3],[201,1],[258,1],[280,3],[284,2],[315,7],[343,1],[385,1],[428,1],[468,1],[525,1],[554,2],[557,1],[599,3],[603,2],[606,3],[610,2],[641,7],[669,1],[779,2],[782,1],[810,1],[838,1],[867,3],[941,2],[944,1],[972,1],[1000,1],[1029,3],[1103,2],[1106,1],[1134,1],[1162,1],[1191,3]]},"783":{"position":[[105,1],[140,1]]},"786":{"position":[[63,1],[75,1],[111,1],[113,1],[138,1],[173,1],[256,1],[270,1],[290,1],[302,1],[338,1],[340,1],[365,1],[431,2],[434,1],[462,1],[490,1],[534,3]]},"788":{"position":[[58,1],[70,1],[106,1],[108,1],[133,1],[168,1],[210,2],[213,3],[231,3],[277,1],[291,1],[311,1],[323,1],[359,1],[361,1],[386,1],[418,1],[433,2],[436,3],[454,2],[479,2],[482,1],[510,1],[538,1],[582,1],[584,2]]},"790":{"position":[[73,1],[85,1],[121,1],[123,1],[148,1],[183,1],[211,1],[218,2],[221,3],[239,2],[249,2],[294,1],[308,1],[328,1],[340,1],[376,1],[378,1],[403,1],[435,1],[442,2],[445,3],[463,2],[496,2],[499,1],[527,1],[555,1],[599,1],[601,2]]},"799":{"position":[[97,1],[110,1],[192,1],[222,2],[225,3],[262,1],[276,1],[296,1],[310,1],[342,1],[453,1],[481,1],[509,1],[511,2],[514,3],[551,3]]},"801":{"position":[[95,1],[108,1],[180,2],[195,2],[208,3],[212,3],[233,1],[263,2],[266,3],[303,1],[317,1],[337,1],[351,1],[383,1],[455,2],[470,2],[483,3],[487,3],[537,1],[565,1],[593,1],[595,2],[598,3],[635,3]]},"803":{"position":[[95,1],[108,1],[129,2],[132,3],[213,2],[216,3],[237,1],[267,2],[270,3],[307,1],[321,1],[341,1],[355,1],[387,1],[408,2],[411,3],[493,3],[543,1],[571,1],[599,1],[601,2],[604,3],[641,3]]},"805":{"position":[[113,1],[126,1],[147,2],[150,3],[159,1],[161,2],[212,2],[308,2],[311,3],[332,1],[362,2],[365,3],[402,1],[416,1],[436,1],[450,1],[482,1],[503,2],[506,3],[515,1],[517,2],[568,2],[664,2],[667,3],[717,1],[745,1],[773,1],[775,2],[778,3],[815,3]]},"807":{"position":[[282,1],[295,1],[316,2],[319,3],[390,3],[411,1],[441,2],[444,3],[481,1],[495,1],[515,1],[529,1],[543,1],[640,1],[654,1],[674,1],[688,1],[720,1],[741,2],[744,3],[815,3],[865,1],[893,1],[921,1],[923,2],[926,3],[963,3],[1046,1],[1086,1],[1114,1],[1134,3]]},"809":{"position":[[13,1],[77,1],[129,1]]},"811":{"position":[[54,1],[97,1],[136,1],[171,3],[186,1],[227,3],[243,1],[286,1],[319,1],[367,2],[370,1],[412,3],[416,2],[419,3],[494,2],[497,1],[525,1],[553,1],[582,3],[647,2],[650,1],[678,1],[706,1],[735,3],[800,2],[803,1],[831,1],[859,1],[888,3]]},"817":{"position":[[63,1],[75,1],[120,3],[124,3],[128,7],[149,1],[200,1],[283,1],[297,1],[317,1],[329,1],[374,3],[378,3],[382,7],[403,1],[485,2],[488,1],[516,1],[544,1],[588,3]]},"819":{"position":[[58,1],[70,1],[115,3],[119,3],[123,7],[144,1],[195,1],[237,2],[240,3],[258,3],[304,1],[318,1],[338,1],[350,1],[395,3],[399,3],[403,7],[424,1],[472,1],[487,2],[490,3],[508,2],[533,2],[536,1],[564,1],[592,1],[636,1],[638,2]]},"821":{"position":[[73,1],[85,1],[130,3],[134,3],[138,7],[159,1],[210,1],[238,1],[245,2],[248,3],[266,2],[276,2],[321,1],[335,1],[355,1],[367,1],[412,3],[416,3],[420,7],[441,1],[489,1],[496,2],[499,3],[517,2],[550,2],[553,1],[581,1],[609,1],[653,1],[655,2]]},"828":{"position":[[63,1],[114,1],[124,1],[238,3],[290,1],[348,1],[371,1],[413,1],[425,1],[464,1],[647,1],[759,2],[762,2],[878,2],[889,1],[953,1],[1055,3],[1155,1],[1267,2],[1270,2],[1323,1],[1379,1],[1397,2],[1400,1],[1423,2],[1439,2],[1442,1],[1483,3],[1513,1],[1551,1],[1581,2],[1584,1],[1594,1],[1678,3],[1693,1],[1801,1],[1813,4],[1833,2],[1851,2],[1854,1],[1877,2],[1902,1],[1933,3],[1937,1],[1983,1],[1985,1],[2050,3],[2085,1],[2130,2],[2141,2],[2154,3],[2192,1],[2216,1],[2218,1]]},"831":{"position":[[63,1],[75,1],[103,1],[105,1],[120,1],[122,1],[147,1],[186,1],[269,1],[283,1],[303,1],[315,1],[343,1],[345,1],[360,1],[362,1],[387,1],[457,2],[460,1],[488,1],[516,1],[560,3]]},"833":{"position":[[58,1],[70,1],[98,1],[100,1],[115,1],[117,1],[142,1],[181,1],[223,2],[226,3],[244,3],[290,1],[304,1],[324,1],[336,1],[364,1],[366,1],[381,1],[383,1],[408,1],[444,1],[459,2],[462,3],[480,2],[505,2],[508,1],[536,1],[564,1],[608,1],[610,2]]},"835":{"position":[[73,1],[85,1],[113,1],[115,1],[130,1],[132,1],[157,1],[196,1],[224,1],[231,2],[234,3],[252,2],[262,2],[307,1],[321,1],[341,1],[353,1],[381,1],[383,1],[398,1],[400,1],[425,1],[461,1],[468,2],[471,3],[489,2],[522,2],[525,1],[553,1],[581,1],[625,1],[627,2]]},"842":{"position":[[45,1]]},"846":{"position":[[46,1],[58,1],[94,1],[136,1],[209,1],[223,1],[243,1],[255,1],[291,1],[354,2],[357,1],[385,1],[413,1],[457,3]]},"848":{"position":[[56,1],[68,1],[104,1],[146,1],[178,2],[181,3],[199,3],[245,1],[259,1],[279,1],[291,1],[327,1],[364,1],[371,2],[374,3],[392,2],[417,2],[420,1],[448,1],[476,1],[520,1],[522,2]]},"857":{"position":[[46,1],[58,1],[68,1],[96,1],[115,1],[143,1],[214,1],[228,1],[248,1],[260,1],[270,1],[298,1],[317,1],[366,2],[369,1],[397,1],[425,1],[467,3]]},"859":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[185,2],[188,3],[206,3],[250,1],[264,1],[284,1],[296,1],[306,1],[334,1],[353,1],[378,1],[385,2],[388,3],[406,2],[429,2],[432,1],[460,1],[488,1],[530,1],[532,2]]},"861":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[204,2],[207,3],[225,3],[269,1],[283,1],[303,1],[315,1],[325,1],[353,1],[372,1],[397,1],[423,2],[426,3],[444,2],[467,2],[470,1],[498,1],[526,1],[568,1],[570,2]]},"868":{"position":[[46,1],[58,1],[155,1],[228,1],[242,1],[262,1],[274,1],[392,2],[395,1],[423,1],[451,1],[495,3]]},"870":{"position":[[56,1],[68,1],[165,1],[197,2],[200,3],[218,3],[264,1],[278,1],[298,1],[310,1],[402,1],[409,2],[412,3],[430,2],[455,2],[458,1],[486,1],[514,1],[558,1],[560,2]]},"877":{"position":[[35,1],[74,1],[132,1],[208,2],[211,1],[395,1],[419,3],[461,2],[464,1],[526,3],[543,1],[652,3],[679,2],[682,1],[756,1],[758,2],[807,2],[881,1],[883,2],[939,1],[963,1],[1076,1],[1083,1],[1085,2],[1147,1],[1216,1],[1218,3],[1222,3],[1267,3]]},"879":{"position":[[34,1],[136,3],[155,2],[158,1],[171,1],[178,1],[188,1],[221,2],[224,1],[253,2],[313,3],[317,1],[319,2],[344,2],[347,1],[360,1],[367,1],[377,1],[408,2],[411,1],[470,2],[473,1],[516,3],[520,3],[524,1],[526,2]]},"882":{"position":[[63,1],[75,1],[85,1],[113,1],[115,1],[127,1],[129,3],[146,1],[183,1],[264,1],[278,1],[298,1],[310,1],[320,1],[348,1],[350,1],[362,1],[364,3],[381,1],[449,2],[452,1],[480,1],[508,1],[550,3]]},"884":{"position":[[58,1],[70,1],[80,1],[108,1],[110,1],[122,1],[124,3],[141,1],[178,1],[220,2],[223,3],[241,3],[285,1],[299,1],[319,1],[331,1],[341,1],[369,1],[371,1],[383,1],[385,3],[402,1],[438,1],[453,2],[456,3],[474,2],[497,2],[500,1],[528,1],[556,1],[598,1],[600,2]]},"886":{"position":[[73,1],[85,1],[95,1],[123,1],[125,1],[137,1],[139,3],[156,1],[193,1],[221,1],[228,2],[231,3],[249,2],[259,2],[302,1],[316,1],[336,1],[348,1],[358,1],[386,1],[388,1],[400,1],[402,3],[419,1],[455,1],[462,2],[465,3],[483,2],[514,2],[517,1],[545,1],[573,1],[615,1],[617,2]]},"891":{"position":[[35,1],[68,1],[124,1],[194,1],[233,1],[277,1],[373,2],[389,1],[401,1],[408,1],[410,2],[464,1],[509,3],[513,1],[515,1],[530,1],[606,2],[609,1],[611,2],[643,2],[693,3],[697,2],[783,2],[856,2],[886,2],[976,3],[1018,2],[1021,1],[1083,3],[1112,2],[1115,1],[1137,1],[1324,2],[1327,3],[1356,4],[1361,3],[1365,10],[1376,7],[1393,4],[1424,7],[1432,4],[1437,8],[1446,6],[1453,11],[1496,3],[1500,3]]},"895":{"position":[[46,1],[58,1],[86,1],[104,1],[146,1],[219,1],[233,1],[253,1],[265,1],[293,1],[311,1],[374,2],[377,1],[405,1],[433,1],[477,3]]},"897":{"position":[[56,1],[68,1],[96,1],[114,1],[156,1],[188,2],[191,3],[209,3],[255,1],[269,1],[289,1],[301,1],[329,1],[347,1],[384,1],[391,2],[394,3],[412,2],[437,2],[440,1],[468,1],[496,1],[540,1],[542,2]]},"904":{"position":[[15,3],[19,1],[66,2],[76,1],[90,1],[122,1],[130,1],[185,1],[213,1],[241,1],[243,1],[251,3],[261,3],[275,3],[289,3],[293,2],[303,2],[306,2],[309,1],[323,1],[344,3],[389,2],[450,3],[484,2],[606,2],[609,3],[634,2],[654,1],[723,4],[728,4],[733,6],[775,2],[827,3],[845,2],[862,1],[895,1],[932,2],[962,2],[965,1],[991,3],[1012,2],[1058,3],[1092,5],[1098,3],[1109,1],[1111,1],[1125,1],[1139,1],[1147,1],[1161,1],[1175,1],[1183,1],[1196,1],[1210,1],[1218,1],[1231,1],[1245,1],[1253,1],[1267,2],[1270,3],[1274,1],[1321,2],[1331,1],[1396,1],[1440,1],[1534,1],[1553,1],[1578,1],[1610,1],[1612,3],[1683,2],[1713,1],[1742,1],[1774,1],[1776,3],[1804,2],[1823,1],[1907,1],[1909,3],[1965,2],[1991,1],[2077,1],[2079,3],[2112,2],[2133,1],[2217,1],[2219,3],[2297,2],[2319,1],[2405,1],[2407,3],[2435,2],[2456,1],[2542,1],[2544,3],[2600,2],[2628,1],[2716,1],[2718,3],[2751,2],[2774,1],[2860,1],[2862,3],[2940,2],[2964,1],[3052,1],[3054,3],[3085,2],[3105,1],[3125,1],[3127,1]]},"906":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[409,2],[423,1],[463,3],[508,2],[579,3],[613,2],[745,2],[748,3],[773,2],[793,1],[872,4],[877,4],[882,6],[924,2],[976,3],[994,2],[1011,1],[1047,1],[1084,2],[1108,2],[1111,1],[1137,3],[1158,2],[1204,3],[1226,5],[1232,3],[1243,1],[1245,1],[1259,1],[1273,1],[1281,1],[1295,1],[1309,1],[1317,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1401,2]]},"908":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[446,2],[460,1],[500,3],[545,2],[616,3],[650,2],[782,2],[785,3],[810,2],[830,1],[909,4],[914,4],[919,6],[961,2],[1013,3],[1031,2],[1048,1],[1084,1],[1121,2],[1145,2],[1148,1],[1174,3],[1195,2],[1239,3],[1261,5],[1267,3],[1278,1],[1280,1],[1294,1],[1308,1],[1316,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1400,1],[1414,1],[1422,1],[1436,2]]},"910":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[435,2],[449,1],[489,3],[534,2],[605,3],[639,2],[771,2],[774,3],[799,2],[819,1],[898,4],[903,4],[908,6],[950,2],[1002,3],[1020,2],[1036,1],[1066,1],[1076,1],[1130,1],[1194,2],[1197,2],[1221,2],[1224,1],[1247,2],[1250,1],[1276,3],[1297,2],[1343,3],[1347,3],[1369,5],[1375,3],[1386,1],[1388,1],[1402,1],[1416,1],[1424,1],[1438,1],[1452,1],[1460,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1544,2]]},"912":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[329,1],[355,1],[398,2],[401,1],[413,2],[428,3],[467,1],[469,1],[569,2],[596,2],[613,2],[623,2],[626,2],[629,1],[663,1],[665,1],[673,3],[683,3],[697,3],[711,3],[715,2],[729,1],[769,3],[814,2],[885,3],[919,2],[1051,2],[1054,3],[1079,2],[1099,1],[1178,4],[1183,4],[1188,6],[1230,2],[1282,3],[1334,2],[1409,3],[1451,2],[1531,1],[1567,3],[1571,3],[1589,2],[1616,1],[1716,2],[1719,1],[1721,3],[1823,2],[1856,1],[1887,3],[1942,1],[1949,1],[1972,2],[1975,1],[2006,3],[2027,2],[2073,3],[2077,1],[2079,3],[2101,5],[2107,3],[2118,1],[2120,1],[2134,1],[2153,1],[2161,1],[2175,1],[2194,1],[2202,1],[2215,1],[2234,1],[2242,1],[2255,1],[2274,1],[2282,1],[2296,1],[2315,1],[2334,2]]},"914":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[303,3],[310,2],[324,3],[333,2],[347,1],[373,1],[416,2],[419,1],[431,2],[446,3],[485,1],[487,1],[587,2],[614,2],[631,2],[641,2],[644,2],[647,1],[681,1],[683,1],[691,3],[701,3],[715,3],[729,3],[752,2],[766,1],[806,3],[851,2],[922,3],[956,2],[1088,2],[1091,3],[1116,2],[1136,1],[1215,4],[1220,4],[1225,6],[1267,2],[1319,3],[1371,2],[1446,3],[1488,2],[1568,1],[1604,3],[1608,3],[1626,2],[1653,1],[1753,2],[1756,1],[1758,3],[1860,2],[1893,1],[1924,3],[1979,1],[1986,1],[2009,2],[2012,1],[2043,3],[2064,2],[2108,3],[2112,1],[2114,3],[2136,5],[2142,3],[2153,1],[2155,1],[2169,1],[2188,1],[2196,1],[2210,1],[2229,1],[2237,1],[2250,1],[2269,1],[2277,1],[2290,1],[2309,1],[2317,1],[2331,1],[2350,1],[2369,2]]},"918":{"position":[[17,1],[354,1],[531,1]]},"924":{"position":[[166,1],[198,1],[231,3],[241,3],[255,3],[259,3],[301,2],[304,1],[332,1],[379,1],[381,3],[508,1],[540,1],[567,3],[577,3],[591,3],[595,3],[636,2],[639,1],[667,1],[724,1],[726,3],[860,1],[899,1],[953,1],[961,3],[971,3],[985,3],[989,3],[1046,2],[1049,1],[1077,1],[1141,1],[1143,3],[1280,1],[1298,2],[1301,1],[1329,1],[1375,1],[1396,3],[1613,1],[1631,2],[1634,1],[1662,1],[1706,1],[1727,3]]},"926":{"position":[[184,1],[203,1],[242,3],[252,3],[266,3],[270,3],[274,1],[288,1],[316,1],[336,1],[338,1],[489,1],[516,3],[526,3],[540,3],[544,3],[552,1],[571,1],[601,1],[615,1],[643,1],[663,1],[665,1],[830,1],[884,1],[892,3],[902,3],[916,3],[920,3],[928,1],[972,1],[986,1],[1014,1],[1061,1],[1063,1],[1165,1],[1180,1],[1216,1],[1242,1],[1256,1],[1284,1],[1322,1],[1324,1],[1508,1],[1523,1],[1557,1],[1583,1],[1597,1],[1625,1],[1661,1],[1663,1]]},"930":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[472,2],[486,1],[526,3],[571,2],[642,3],[676,2],[808,2],[811,3],[836,2],[856,1],[935,4],[940,4],[945,6],[987,2],[1039,3],[1057,2],[1073,1],[1103,1],[1113,1],[1167,1],[1231,2],[1234,2],[1258,2],[1261,1],[1284,2],[1287,1],[1313,3],[1334,2],[1378,3],[1382,3],[1404,5],[1410,3],[1421,1],[1423,1],[1437,1],[1451,1],[1459,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1543,1],[1557,1],[1565,1],[1579,2]]}}}],["0",{"_index":251,"t":{"632":{"position":[[910,2],[959,2],[1433,2],[1482,2]]},"652":{"position":[[257,2]]},"681":{"position":[[121,2]]},"721":{"position":[[579,2],[596,2],[609,2],[654,2],[670,1]]},"723":{"position":[[475,2],[492,2],[505,2],[551,2],[567,1],[602,2],[619,2],[632,2],[677,2],[693,1]]},"725":{"position":[[792,2],[809,2],[822,2],[867,2],[883,1]]},"743":{"position":[[291,2]]},"879":{"position":[[173,2],[362,2]]},"891":{"position":[[1308,2],[1321,2]]},"908":{"position":[[292,2]]},"912":{"position":[[2332,1]]},"914":{"position":[[313,2],[2367,1]]},"930":{"position":[[292,2]]}}}],["0deprec",{"_index":949,"t":{"727":{"position":[[0,11]]},"920":{"position":[[101,11]]}}}],["0xffffff",{"_index":1166,"t":{"877":{"position":[[386,8]]},"891":{"position":[[876,9]]}}}],["1",{"_index":320,"t":{"634":{"position":[[1516,4],[1822,3]]},"636":{"position":[[209,1],[765,1],[1040,1]]},"652":{"position":[[260,2]]},"675":{"position":[[58,1],[155,1],[285,1],[357,1]]},"681":{"position":[[135,1]]},"683":{"position":[[189,3],[222,3],[321,3],[454,3],[516,3]]},"697":{"position":[[517,2],[703,1],[760,3],[764,2],[816,1],[854,1],[858,1],[986,3],[990,3],[1027,1],[1031,1]]},"714":{"position":[[35,1],[39,1],[129,1],[133,1]]},"717":{"position":[[221,1],[225,1],[686,1],[690,1]]},"719":{"position":[[239,1],[243,1]]},"721":{"position":[[449,2],[454,2]]},"723":{"position":[[326,2],[331,2]]},"725":{"position":[[563,2],[568,2]]},"743":{"position":[[347,2],[353,1]]},"759":{"position":[[448,2]]},"778":{"position":[[534,2]]},"786":{"position":[[121,3],[348,3]]},"788":{"position":[[116,3],[369,3]]},"790":{"position":[[131,3],[386,3]]},"811":{"position":[[347,2]]},"828":{"position":[[2138,2]]},"831":{"position":[[130,3],[370,3]]},"833":{"position":[[125,3],[391,3]]},"835":{"position":[[140,3],[408,3]]},"846":{"position":[[109,3],[306,3]]},"848":{"position":[[119,3],[342,3]]},"895":{"position":[[119,3],[326,3]]},"897":{"position":[[129,3],[362,3]]},"904":{"position":[[1216,1]]},"906":{"position":[[1350,1]]},"908":{"position":[[315,2],[1385,1]]},"910":{"position":[[1493,1]]},"912":{"position":[[2240,1]]},"914":{"position":[[336,2],[2275,1]]},"924":{"position":[[1278,1],[1282,3],[1611,1],[1615,3]]},"926":{"position":[[1214,1],[1218,4],[1555,1],[1559,4]]},"930":{"position":[[315,2],[1528,1]]}}}],["1+1",{"_index":875,"t":{"703":{"position":[[284,3]]}}}],["1+:toadd",{"_index":990,"t":{"737":{"position":[[269,8]]},"828":{"position":[[1783,8]]}}}],["1,2",{"_index":836,"t":{"697":{"position":[[608,5]]}}}],["1.0.0",{"_index":503,"t":{"650":{"position":[[202,8]]},"828":{"position":[[2026,8]]}}}],["1.1",{"_index":515,"t":{"652":{"position":[[263,4]]}}}],["1.1earli",{"_index":1362,"t":{"920":{"position":[[756,8]]}}}],["1.2",{"_index":516,"t":{"652":{"position":[[268,4]]}}}],["1.2releas",{"_index":1366,"t":{"920":{"position":[[848,10]]}}}],["10",{"_index":239,"t":{"632":{"position":[[701,3],[714,3],[1224,3],[1237,3]]},"703":{"position":[[237,2]]},"723":{"position":[[532,3]]},"737":{"position":[[296,2]]},"828":{"position":[[1810,2]]},"877":{"position":[[280,3]]},"891":{"position":[[754,3]]}}}],["1000",{"_index":1196,"t":{"879":{"position":[[322,6],[529,6]]}}}],["1045",{"_index":1214,"t":{"891":{"position":[[504,4]]}}}],["1080",{"_index":889,"t":{"703":{"position":[[864,4]]}}}],["12",{"_index":715,"t":{"675":{"position":[[126,2]]}}}],["120",{"_index":1028,"t":{"743":{"position":[[335,4]]}}}],["123",{"_index":1020,"t":{"743":{"position":[[152,4]]},"891":{"position":[[689,3]]}}}],["1234",{"_index":1164,"t":{"877":{"position":[[330,5]]},"891":{"position":[[817,5]]}}}],["137",{"_index":189,"t":{"630":{"position":[[1171,5],[1725,5]]}}}],["14",{"_index":297,"t":{"634":{"position":[[434,3],[1052,3]]}}}],["16000",{"_index":756,"t":{"679":{"position":[[86,5]]}}}],["18.x",{"_index":416,"t":{"644":{"position":[[60,5]]}}}],["19",{"_index":1118,"t":{"817":{"position":[[160,3],[414,3]]},"819":{"position":[[155,3],[435,3]]},"821":{"position":[[170,3],[452,3]]},"868":{"position":[[112,4],[328,4]]},"870":{"position":[[122,4],[364,4]]}}}],["1998",{"_index":1413,"t":{"928":{"position":[[12,5]]}}}],["1experiment",{"_index":547,"t":{"658":{"position":[[144,13]]},"920":{"position":[[642,13]]}}}],["2",{"_index":342,"t":{"636":{"position":[[221,1],[777,1],[1052,1]]},"652":{"position":[[273,1]]},"677":{"position":[[293,1],[464,3]]},"697":{"position":[[523,1]]},"714":{"position":[[95,1],[189,1]]},"717":{"position":[[300,1],[701,1],[705,1],[772,2]]},"719":{"position":[[261,1],[265,1],[376,1]]},"721":{"position":[[636,2]]},"723":{"position":[[338,2],[343,2],[659,2]]},"725":{"position":[[575,2],[580,2],[849,2]]},"735":{"position":[[195,3],[199,4]]},"877":{"position":[[349,2]]},"891":{"position":[[836,2]]},"904":{"position":[[1181,1]]},"906":{"position":[[1315,1]]},"908":{"position":[[1350,1]]},"910":{"position":[[1117,4],[1171,1],[1180,4],[1458,1]]},"912":{"position":[[2200,1]]},"914":{"position":[[2235,1]]},"930":{"position":[[1154,4],[1208,1],[1217,4],[1493,1]]}}}],["2+3",{"_index":1133,"t":{"828":{"position":[[785,3],[1292,3]]}}}],["2.0",{"_index":847,"t":{"701":{"position":[[238,3]]}}}],["2.rds.amazonaws.com",{"_index":1059,"t":{"755":{"position":[[379,21],[735,21]]},"774":{"position":[[402,21],[935,21]]},"807":{"position":[[349,21],[774,21]]}}}],["20",{"_index":1153,"t":{"831":{"position":[[149,4],[389,4]]},"833":{"position":[[144,4],[410,4]]},"835":{"position":[[159,4],[427,4]]},"895":{"position":[[88,2],[295,2]]},"897":{"position":[[98,2],[331,2]]}}}],["2113931265",{"_index":1220,"t":{"891":{"position":[[907,11]]}}}],["2119",{"_index":1069,"t":{"757":{"position":[[71,5]]},"776":{"position":[[71,5]]},"809":{"position":[[71,5]]}}}],["2130",{"_index":1067,"t":{"757":{"position":[[7,5]]},"776":{"position":[[7,5]]},"809":{"position":[[7,5]]}}}],["2131",{"_index":1072,"t":{"757":{"position":[[123,5]]},"776":{"position":[[123,5]]},"809":{"position":[[123,5]]}}}],["2181036031",{"_index":1221,"t":{"891":{"position":[[936,11]]}}}],["2282",{"_index":1414,"t":{"928":{"position":[[18,5]]}}}],["253",{"_index":1234,"t":{"891":{"position":[[1296,4]]}}}],["2stabl",{"_index":517,"t":{"652":{"position":[[290,7],[298,7]]},"717":{"position":[[0,7]]},"719":{"position":[[0,7]]},"721":{"position":[[0,7]]},"723":{"position":[[0,7]]},"725":{"position":[[0,7]]},"920":{"position":[[1114,7]]},"924":{"position":[[17,7],[396,7],[748,7],[1155,7],[1492,7]]},"926":{"position":[[17,7],[351,7],[685,7],[1073,7],[1418,7]]}}}],["3",{"_index":409,"t":{"642":{"position":[[39,2]]},"652":{"position":[[279,2]]},"672":{"position":[[292,3]]},"677":{"position":[[511,1]]},"683":{"position":[[232,3],[354,3],[364,3],[549,3],[559,3]]},"697":{"position":[[646,1]]},"735":{"position":[[388,1]]},"904":{"position":[[1251,1]]},"906":{"position":[[1385,1]]},"908":{"position":[[1420,1]]},"910":{"position":[[1528,1]]},"912":{"position":[[2280,1]]},"914":{"position":[[2315,1]]},"930":{"position":[[1563,1]]}}}],["33",{"_index":1230,"t":{"891":{"position":[[1261,3]]}}}],["3306",{"_index":888,"t":{"703":{"position":[[829,4]]},"749":{"position":[[219,5],[419,5]]},"759":{"position":[[178,4],[508,4]]},"768":{"position":[[242,5],[618,5]]},"778":{"position":[[174,4],[594,4]]},"801":{"position":[[189,5],[464,5]]},"811":{"position":[[166,4],[407,4]]},"828":{"position":[[163,5],[980,5],[1633,5]]}}}],["384",{"_index":1232,"t":{"891":{"position":[[1279,4]]}}}],["3legaci",{"_index":1378,"t":{"920":{"position":[[1181,7]]}}}],["4",{"_index":922,"t":{"717":{"position":[[775,1]]},"719":{"position":[[393,1]]},"904":{"position":[[1123,1],[1145,1]]},"906":{"position":[[1257,1],[1279,1]]},"908":{"position":[[1292,1],[1314,1]]},"910":{"position":[[1400,1],[1422,1]]},"912":{"position":[[2132,1],[2159,1]]},"914":{"position":[[2167,1],[2194,1]]},"930":{"position":[[1435,1],[1457,1]]}}}],["4.5.2",{"_index":901,"t":{"706":{"position":[[224,8]]}}}],["45",{"_index":118,"t":{"628":{"position":[[492,3],[874,3],[1224,4],[1577,4]]},"817":{"position":[[172,4],[426,4]]},"819":{"position":[[167,4],[447,4]]},"821":{"position":[[182,4],[464,4]]},"857":{"position":[[117,4],[319,4]]},"859":{"position":[[127,4],[355,4]]},"861":{"position":[[127,4],[374,4]]},"868":{"position":[[126,5],[342,5]]},"870":{"position":[[136,5],[378,5]]},"882":{"position":[[157,4],[392,4]]},"884":{"position":[[152,4],[413,4]]},"886":{"position":[[167,4],[430,4]]}}}],["5",{"_index":713,"t":{"675":{"position":[[80,3]]},"879":{"position":[[180,2],[369,2]]}}}],["5.6.10",{"_index":1219,"t":{"891":{"position":[[773,9]]}}}],["53",{"_index":190,"t":{"630":{"position":[[1177,3],[1731,4]]}}}],["6",{"_index":714,"t":{"675":{"position":[[84,3]]}}}],["6.9.0",{"_index":1152,"t":{"828":{"position":[[2207,8]]}}}],["60000",{"_index":247,"t":{"632":{"position":[[810,6],[890,7],[1333,6],[1413,7]]}}}],["8",{"_index":1165,"t":{"877":{"position":[[366,2]]},"891":{"position":[[853,2]]}}}],["8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":1041,"t":{"751":{"position":[[193,43]]},"770":{"position":[[216,43]]},"803":{"position":[[163,43]]}}}],["_err",{"_index":911,"t":{"714":{"position":[[54,6],[148,6]]},"717":{"position":[[240,6],[377,6],[718,6],[853,6]]},"719":{"position":[[314,6]]},"721":{"position":[[493,6]]},"723":{"position":[[384,6]]},"725":{"position":[[706,6]]}}}],["a,b,c,d",{"_index":839,"t":{"699":{"position":[[31,7]]}}}],["a.j",{"_index":1073,"t":{"759":{"position":[[44,4]]},"778":{"position":[[40,4]]},"811":{"position":[[32,4]]}}}],["aberta",{"_index":214,"t":{"632":{"position":[[142,7]]}}}],["abov",{"_index":972,"t":{"733":{"position":[[708,5]]}}}],["accept",{"_index":891,"t":{"703":{"position":[[976,6]]}}}],["access",{"_index":850,"t":{"701":{"position":[[357,6]]},"710":{"position":[[57,7]]},"712":{"position":[[51,7]]},"739":{"position":[[78,6]]},"904":{"position":[[221,7]]},"906":{"position":[[331,7]]},"908":{"position":[[349,7]]},"910":{"position":[[331,7]]},"912":{"position":[[637,7]]},"914":{"position":[[655,7]]},"916":{"position":[[146,6]]},"930":{"position":[[349,7]]}}}],["accord",{"_index":679,"t":{"670":{"position":[[2435,9]]}}}],["accordingli",{"_index":633,"t":{"670":{"position":[[760,12]]}}}],["acima",{"_index":266,"t":{"632":{"position":[[1777,5],[2009,5],[2347,5],[2577,5]]}}}],["ack",{"_index":746,"t":{"677":{"position":[[641,3]]}}}],["acompanhamento",{"_index":394,"t":{"638":{"position":[[524,14]]}}}],["action",{"_index":544,"t":{"658":{"position":[[101,7],[238,7],[335,7],[530,7]]}}}],["activ",{"_index":1380,"t":{"920":{"position":[[1289,6]]}}}],["ad",{"_index":1399,"t":{"924":{"position":[[122,6]]}}}],["add(group",{"_index":1081,"t":{"766":{"position":[[0,10]]},"768":{"position":[[0,10]]},"770":{"position":[[0,10]]},"772":{"position":[[0,10]]},"774":{"position":[[0,10]]},"778":{"position":[[0,10]]}}}],["addit",{"_index":568,"t":{"660":{"position":[[228,10]]},"670":{"position":[[599,10]]},"672":{"position":[[245,10],[296,10]]},"694":{"position":[[251,8]]},"701":{"position":[[3,8]]},"703":{"position":[[905,8]]},"731":{"position":[[3,8]]}}}],["address",{"_index":1389,"t":{"920":{"position":[[1520,10]]}}}],["adicionai",{"_index":127,"t":{"628":{"position":[[626,10],[1390,10]]},"630":{"position":[[1311,10],[1897,10]]},"918":{"position":[[496,11]]}}}],["adicionalment",{"_index":288,"t":{"632":{"position":[[2766,15]]}}}],["adquirir",{"_index":275,"t":{"632":{"position":[[2221,8]]}}}],["advanc",{"_index":951,"t":{"729":{"position":[[80,8]]}}}],["affect",{"_index":1310,"t":{"912":{"position":[[2317,8]]},"914":{"position":[[2352,8]]}}}],["affectedrow",{"_index":795,"t":{"692":{"position":[[222,13]]},"721":{"position":[[242,12],[582,13]]},"723":{"position":[[478,13],[605,13]]},"725":{"position":[[795,13]]},"912":{"position":[[485,15]]},"914":{"position":[[503,15]]}}}],["ag",{"_index":117,"t":{"628":{"position":[[484,5],[853,5],[1216,5],[1556,5]]},"630":{"position":[[1150,5],[1704,5]]},"634":{"position":[[412,5],[1030,5]]},"817":{"position":[[106,6],[360,6]]},"819":{"position":[[101,6],[381,6]]},"821":{"position":[[116,6],[398,6]]},"831":{"position":[[97,5],[337,5]]},"833":{"position":[[92,5],[358,5]]},"835":{"position":[[107,5],[375,5]]},"857":{"position":[[109,5],[311,5]]},"859":{"position":[[119,5],[347,5]]},"861":{"position":[[119,5],[366,5]]},"868":{"position":[[89,6],[305,6]]},"870":{"position":[[99,6],[341,6]]},"882":{"position":[[121,5],[356,5]]},"884":{"position":[[116,5],[377,5]]},"886":{"position":[[131,5],[394,5]]},"895":{"position":[[80,5],[287,5]]},"897":{"position":[[90,5],[323,5]]}}}],["again",{"_index":699,"t":{"672":{"position":[[396,6]]},"783":{"position":[[246,6]]}}}],["aim",{"_index":559,"t":{"660":{"position":[[7,4]]}}}],["ajuda",{"_index":206,"t":{"632":{"position":[[31,5]]},"636":{"position":[[1298,5],[1315,6]]}}}],["algo",{"_index":281,"t":{"632":{"position":[[2403,4],[2634,4]]},"640":{"position":[[14,4]]}}}],["algorithm",{"_index":684,"t":{"670":{"position":[[2592,9]]}}}],["algoritm",{"_index":700,"t":{"672":{"position":[[502,9]]}}}],["allow",{"_index":484,"t":{"648":{"position":[[181,6]]}}}],["alongsid",{"_index":500,"t":{"650":{"position":[[90,9]]}}}],["alterada",{"_index":1321,"t":{"918":{"position":[[140,8]]}}}],["alternativament",{"_index":272,"t":{"632":{"position":[[2170,17]]}}}],["alway",{"_index":581,"t":{"664":{"position":[[192,6]]},"670":{"position":[[1488,6],[2239,6]]},"912":{"position":[[1793,6]]},"914":{"position":[[1830,6]]}}}],["além",{"_index":176,"t":{"630":{"position":[[472,4]]}}}],["amazon",{"_index":1052,"t":{"755":{"position":[[56,6],[113,6],[406,7],[762,7]]},"757":{"position":[[36,6],[138,6]]},"774":{"position":[[52,6],[109,6],[429,7],[962,7]]},"776":{"position":[[36,6],[138,6]]},"807":{"position":[[44,6],[101,6],[376,7],[801,7]]},"809":{"position":[[36,6],[138,6]]}}}],["analisador",{"_index":1316,"t":{"918":{"position":[[64,10]]}}}],["anoth",{"_index":618,"t":{"670":{"position":[[372,7]]}}}],["answer",{"_index":1311,"t":{"916":{"position":[[22,7]]},"924":{"position":[[84,7]]},"926":{"position":[[84,7]]}}}],["anterior",{"_index":212,"t":{"632":{"position":[[119,8]]}}}],["ao",{"_index":215,"t":{"632":{"position":[[150,2]]},"636":{"position":[[890,2],[1198,2]]},"918":{"position":[[167,2]]}}}],["apena",{"_index":349,"t":{"636":{"position":[[370,6]]}}}],["api",{"_index":28,"t":{"622":{"position":[[247,3]]},"634":{"position":[[32,4]]},"638":{"position":[[45,3]]},"660":{"position":[[76,3]]},"670":{"position":[[1303,3]]},"731":{"position":[[79,3]]},"918":{"position":[[132,3],[390,3]]}}}],["aplica",{"_index":347,"t":{"636":{"position":[[297,7],[359,7]]}}}],["aplicada",{"_index":380,"t":{"638":{"position":[[267,9]]}}}],["approach",{"_index":1363,"t":{"920":{"position":[[817,11]]}}}],["aqui",{"_index":84,"t":{"626":{"position":[[270,5]]}}}],["arg",{"_index":1179,"t":{"877":{"position":[[772,5]]}}}],["argument",{"_index":781,"t":{"688":{"position":[[89,9]]}}}],["argumento",{"_index":381,"t":{"638":{"position":[[279,10]]}}}],["arguments[1",{"_index":1181,"t":{"877":{"position":[[941,13],[1149,13]]}}}],["arguments[2",{"_index":1182,"t":{"877":{"position":[[965,13]]}}}],["arquivo",{"_index":402,"t":{"640":{"position":[[41,7]]}}}],["array",{"_index":335,"t":{"636":{"position":[[89,6],[874,5],[883,6],[905,5],[1182,5],[1191,6],[1213,5]]},"677":{"position":[[230,5],[318,5]]},"692":{"position":[[536,5]]},"697":{"position":[[398,5],[942,5]]},"699":{"position":[[139,5],[148,6]]},"717":{"position":[[11,5]]},"861":{"position":[[614,5]]},"877":{"position":[[824,7],[840,7]]}}}],["array.isarray(arguments[1",{"_index":1180,"t":{"877":{"position":[[851,29]]}}}],["asc",{"_index":1259,"t":{"904":{"position":[[926,5]]},"906":{"position":[[1078,5]]},"908":{"position":[[1115,5]]},"910":{"position":[[1107,3],[1161,3]]},"912":{"position":[[1558,4]]},"914":{"position":[[1595,4]]},"930":{"position":[[1144,3],[1198,3]]}}}],["ascertain",{"_index":1371,"t":{"920":{"position":[[1045,9]]}}}],["ask",{"_index":604,"t":{"670":{"position":[[43,3]]},"916":{"position":[[42,5]]}}}],["associada",{"_index":226,"t":{"632":{"position":[[282,9]]}}}],["assur",{"_index":1343,"t":{"920":{"position":[[162,6]]}}}],["async",{"_index":294,"t":{"634":{"position":[[72,5],[121,5],[1211,5]]},"735":{"position":[[0,5],[224,5]]},"828":{"position":[[92,5],[1962,5]]},"904":{"position":[[296,6]]},"906":{"position":[[310,6]]},"908":{"position":[[328,6]]},"910":{"position":[[310,6]]},"912":{"position":[[616,6]]},"914":{"position":[[634,6]]},"930":{"position":[[328,6]]}}}],["asynchron",{"_index":631,"t":{"670":{"position":[[703,14]]}}}],["ataqu",{"_index":167,"t":{"630":{"position":[[344,7]]}}}],["atenção",{"_index":1089,"t":{"766":{"position":[[767,7]]},"768":{"position":[[851,7]]},"770":{"position":[[857,7]]},"772":{"position":[[1046,7]]},"774":{"position":[[1364,7]]},"799":{"position":[[555,7]]},"801":{"position":[[639,7]]},"803":{"position":[[645,7]]},"805":{"position":[[834,7]]},"807":{"position":[[1138,7]]}}}],["atingido",{"_index":261,"t":{"632":{"position":[[1605,9]]}}}],["atravé",{"_index":393,"t":{"638":{"position":[[513,7]]}}}],["attach",{"_index":821,"t":{"694":{"position":[[499,6]]}}}],["atualização",{"_index":22,"t":{"622":{"position":[[179,11]]}}}],["auth",{"_index":606,"t":{"670":{"position":[[83,4],[801,4],[952,6],[1869,6]]},"672":{"position":[[702,5],[842,5],[982,5]]},"891":{"position":[[119,4]]}}}],["auth.doublesha1('pass123",{"_index":1205,"t":{"891":{"position":[[235,27]]}}}],["auth.verifytoken",{"_index":1207,"t":{"891":{"position":[[279,17]]}}}],["authcallback",{"_index":1222,"t":{"891":{"position":[[948,13]]}}}],["authent",{"_index":570,"t":{"660":{"position":[[285,14]]},"670":{"position":[[211,14],[610,14]]},"672":{"position":[[34,14],[159,14],[256,14],[412,14]]},"891":{"position":[[962,13]]},"918":{"position":[[737,14]]}}}],["authenticate(param",{"_index":1202,"t":{"891":{"position":[[169,20]]}}}],["authentication::native41",{"_index":680,"t":{"670":{"position":[[2448,24]]}}}],["authnextfactor",{"_index":691,"t":{"672":{"position":[[90,14]]}}}],["author",{"_index":1148,"t":{"828":{"position":[[2144,9]]}}}],["authplugin",{"_index":608,"t":{"670":{"position":[[103,11],[928,12],[2480,11]]},"672":{"position":[[661,12]]}}}],["authswitchhandl",{"_index":653,"t":{"670":{"position":[[1318,17],[1778,18],[2508,17]]}}}],["authswitchrequest",{"_index":669,"t":{"670":{"position":[[2130,17]]}}}],["auto",{"_index":463,"t":{"646":{"position":[[709,4]]}}}],["auto_incr",{"_index":1249,"t":{"904":{"position":[[548,15]]},"906":{"position":[[687,15]]},"908":{"position":[[724,15]]},"910":{"position":[[713,15]]},"912":{"position":[[993,15]]},"914":{"position":[[1030,15]]},"930":{"position":[[750,15]]}}}],["automat",{"_index":1193,"t":{"879":{"position":[[270,13]]}}}],["automaticament",{"_index":269,"t":{"632":{"position":[[1870,15],[2103,15]]}}}],["auxiliar",{"_index":171,"t":{"630":{"position":[[393,8]]}}}],["avail",{"_index":514,"t":{"652":{"position":[[239,9]]},"703":{"position":[[1080,10]]},"786":{"position":[[704,9]]},"788":{"position":[[753,9]]},"790":{"position":[[770,9]]},"817":{"position":[[758,9]]},"819":{"position":[[807,9]]},"821":{"position":[[824,9]]},"831":{"position":[[730,9]]},"833":{"position":[[779,9]]},"835":{"position":[[796,9]]},"846":{"position":[[627,9]]},"848":{"position":[[691,9]]},"857":{"position":[[556,9]]},"859":{"position":[[620,9]]},"861":{"position":[[667,9]]},"868":{"position":[[665,9]]},"870":{"position":[[729,9]]},"882":{"position":[[639,9]]},"884":{"position":[[688,9]]},"886":{"position":[[705,9]]},"895":{"position":[[647,9]]},"897":{"position":[[711,9]]},"920":{"position":[[1330,10]]}}}],["avg",{"_index":379,"t":{"638":{"position":[[254,5]]}}}],["await",{"_index":101,"t":{"628":{"position":[[273,5],[411,5],[785,5]]},"630":{"position":[[897,5],[1080,5]]},"632":{"position":[[1806,5],[2366,5],[2422,5]]},"634":{"position":[[78,6],[203,5],[342,5],[802,5],[960,5],[1484,5]]},"636":{"position":[[454,5],[733,5]]},"735":{"position":[[82,5],[155,5],[204,5],[398,5],[516,5]]},"737":{"position":[[356,5]]},"747":{"position":[[124,5]]},"749":{"position":[[128,5]]},"751":{"position":[[128,5]]},"753":{"position":[[146,5]]},"755":{"position":[[315,5],[488,5],[547,5]]},"766":{"position":[[286,5]]},"768":{"position":[[327,5]]},"770":{"position":[[331,5]]},"772":{"position":[[426,5]]},"774":{"position":[[505,5],[654,5],[713,5]]},"786":{"position":[[175,5]]},"788":{"position":[[170,5]]},"790":{"position":[[185,5]]},"799":{"position":[[194,5]]},"801":{"position":[[235,5]]},"803":{"position":[[239,5]]},"805":{"position":[[334,5]]},"807":{"position":[[413,5],[545,5],[604,5]]},"817":{"position":[[202,5]]},"819":{"position":[[197,5]]},"821":{"position":[[212,5]]},"828":{"position":[[126,5],[292,5],[373,5],[675,5],[930,5],[1183,5],[1364,5],[2007,7]]},"831":{"position":[[188,5]]},"833":{"position":[[183,5]]},"835":{"position":[[198,5]]},"846":{"position":[[138,5]]},"848":{"position":[[148,5]]},"857":{"position":[[145,5]]},"859":{"position":[[155,5]]},"861":{"position":[[155,5]]},"868":{"position":[[157,5]]},"870":{"position":[[167,5]]},"882":{"position":[[185,5]]},"884":{"position":[[180,5]]},"886":{"position":[[195,5]]},"895":{"position":[[148,5]]},"897":{"position":[[158,5]]},"904":{"position":[[392,5],[487,5],[656,5],[864,5],[1062,5]]},"906":{"position":[[425,5],[511,5],[616,5],[795,5],[1013,5],[1208,5]]},"908":{"position":[[462,5],[548,5],[653,5],[832,5],[1050,5],[1243,5]]},"910":{"position":[[451,5],[537,5],[642,5],[821,5],[1038,5],[1351,5]]},"912":{"position":[[731,5],[817,5],[922,5],[1101,5],[1337,5],[1454,5],[1618,5],[2083,5]]},"914":{"position":[[768,5],[854,5],[959,5],[1138,5],[1374,5],[1491,5],[1655,5],[2118,5]]},"926":{"position":[[205,5],[573,5],[930,5],[1182,5],[1525,5]]},"930":{"position":[[488,5],[574,5],[679,5],[858,5],[1075,5],[1386,5]]}}}],["await.j",{"_index":1119,"t":{"828":{"position":[[0,8],[2062,11]]}}}],["b",{"_index":459,"t":{"646":{"position":[[622,1]]},"699":{"position":[[197,1]]}}}],["b.j",{"_index":1074,"t":{"759":{"position":[[49,4]]},"778":{"position":[[45,4]]},"811":{"position":[[37,4]]}}}],["babel",{"_index":1151,"t":{"828":{"position":[[2194,6]]}}}],["babelrc",{"_index":1121,"t":{"828":{"position":[[15,8]]}}}],["back",{"_index":629,"t":{"670":{"position":[[659,4]]}}}],["backend",{"_index":1006,"t":{"741":{"position":[[118,8],[166,8]]}}}],["backward",{"_index":1344,"t":{"920":{"position":[[169,8],[281,8]]}}}],["badg",{"_index":508,"t":{"652":{"position":[[18,6]]},"920":{"position":[[14,6]]}}}],["banco",{"_index":97,"t":{"628":{"position":[[239,5],[1015,5]]},"630":{"position":[[863,5],[1455,5]]},"634":{"position":[[169,5],[304,5],[922,5]]}}}],["bar",{"_index":885,"t":{"703":{"position":[[730,6]]},"733":{"position":[[241,6],[528,6]]}}}],["base",{"_index":959,"t":{"731":{"position":[[73,5]]},"920":{"position":[[983,5]]}}}],["baseado",{"_index":24,"t":{"622":{"position":[[197,7]]}}}],["basic",{"_index":956,"t":{"729":{"position":[[608,5]]}}}],["befor",{"_index":557,"t":{"658":{"position":[[474,6]]},"904":{"position":[[1651,6]]}}}],["begin",{"_index":945,"t":{"725":{"position":[[553,5]]},"912":{"position":[[1518,5]]},"914":{"position":[[1555,5]]}}}],["behavior",{"_index":817,"t":{"694":{"position":[[363,8]]}}}],["below",{"_index":1154,"t":{"844":{"position":[[13,5]]},"855":{"position":[[13,5]]},"866":{"position":[[13,5]]},"893":{"position":[[13,5]]}}}],["bem",{"_index":292,"t":{"634":{"position":[[58,3]]}}}],["benchmark",{"_index":601,"t":{"668":{"position":[[63,10],[85,10],[115,10]]}}}],["beta",{"_index":1228,"t":{"891":{"position":[[1222,7],[1239,7]]}}}],["better",{"_index":565,"t":{"660":{"position":[[170,6]]},"675":{"position":[[449,6]]},"783":{"position":[[336,6]]}}}],["between",{"_index":688,"t":{"670":{"position":[[2648,7]]},"706":{"position":[[107,7]]}}}],["biblioteca",{"_index":340,"t":{"636":{"position":[[166,10]]}}}],["bin.000007",{"_index":1026,"t":{"743":{"position":[[311,12]]}}}],["binari",{"_index":52,"t":{"624":{"position":[[153,7]]},"660":{"position":[[364,6]]},"692":{"position":[[584,6]]},"918":{"position":[[622,6]]}}}],["bind",{"_index":593,"t":{"666":{"position":[[99,8],[173,8]]},"681":{"position":[[4,4]]}}}],["binlog",{"_index":599,"t":{"666":{"position":[[249,6]]}}}],["binlogpo",{"_index":1027,"t":{"743":{"position":[[324,10]]}}}],["binlogstream",{"_index":1017,"t":{"743":{"position":[[100,12]]}}}],["binlogstream.pip",{"_index":1030,"t":{"743":{"position":[[381,18]]}}}],["binário",{"_index":51,"t":{"624":{"position":[[145,7]]},"918":{"position":[[601,7]]}}}],["blob",{"_index":662,"t":{"670":{"position":[[1607,4]]}}}],["block",{"_index":523,"t":{"654":{"position":[[178,6]]},"743":{"position":[[362,8]]},"926":{"position":[[137,6],[435,6],[769,6],[1154,6],[1497,6]]}}}],["bluebird",{"_index":307,"t":{"634":{"position":[[677,11],[696,8],[710,11],[757,10],[893,9]]}}}],["boolean",{"_index":762,"t":{"681":{"position":[[105,7]]},"694":{"position":[[146,7]]}}}],["both",{"_index":1408,"t":{"924":{"position":[[1417,4],[1748,4]]},"926":{"position":[[1343,4],[1682,4]]}}}],["bound",{"_index":1346,"t":{"920":{"position":[[230,5]]}}}],["branch",{"_index":426,"t":{"646":{"position":[[154,6]]}}}],["browser",{"_index":441,"t":{"646":{"position":[[399,7]]}}}],["buffer",{"_index":627,"t":{"670":{"position":[[630,8],[1667,8]]},"681":{"position":[[222,6]]}}}],["buffer.from",{"_index":1040,"t":{"751":{"position":[[180,12]]},"770":{"position":[[203,12]]},"803":{"position":[[150,12]]}}}],["buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":1043,"t":{"751":{"position":[[384,55]]},"770":{"position":[[583,55]]},"803":{"position":[[429,55]]}}}],["bug",{"_index":1388,"t":{"920":{"position":[[1488,4]]}}}],["build",{"_index":551,"t":{"658":{"position":[[266,5],[306,5]]}}}],["built",{"_index":407,"t":{"642":{"position":[[16,5]]}}}],["bun",{"_index":1071,"t":{"757":{"position":[[119,3]]},"776":{"position":[[119,3]]},"809":{"position":[[119,3]]}}}],["byte",{"_index":813,"t":{"694":{"position":[[242,5]]}}}],["bytes/sec",{"_index":873,"t":{"703":{"position":[[240,9]]}}}],["c",{"_index":188,"t":{"630":{"position":[[1169,1],[1723,1]]},"699":{"position":[[214,1]]},"737":{"position":[[83,1]]},"828":{"position":[[122,1],[1592,1]]}}}],["c.end",{"_index":992,"t":{"737":{"position":[[310,8]]},"828":{"position":[[936,8],[1824,8]]}}}],["c.execute('select",{"_index":989,"t":{"737":{"position":[[251,17]]},"828":{"position":[[484,17],[569,17],[695,17],[727,17],[1765,17]]}}}],["c.query('show",{"_index":987,"t":{"737":{"position":[[187,13]]},"828":{"position":[[298,13],[1701,13]]}}}],["c.query('som",{"_index":1125,"t":{"828":{"position":[[379,13]]}}}],["ca",{"_index":1049,"t":{"753":{"position":[[294,3],[575,3]]},"755":{"position":[[202,2],[214,2]]},"757":{"position":[[153,2]]},"772":{"position":[[317,3],[774,3]]},"774":{"position":[[198,2],[210,2]]},"776":{"position":[[153,2]]},"805":{"position":[[264,3],[620,3]]},"807":{"position":[[190,2],[202,2]]},"809":{"position":[[153,2]]}}}],["cach",{"_index":199,"t":{"630":{"position":[[2042,6]]},"675":{"position":[[215,6],[256,6],[322,5],[416,5],[480,5]]},"677":{"position":[[52,5]]},"679":{"position":[[36,6],[63,6],[173,5]]},"783":{"position":[[282,5]]}}}],["call",{"_index":624,"t":{"670":{"position":[[520,4],[560,4],[1549,5],[2556,6]]},"675":{"position":[[209,5]]},"725":{"position":[[90,4],[630,5],[1034,5]]}}}],["callback",{"_index":92,"t":{"628":{"position":[[151,8]]},"630":{"position":[[788,8]]},"632":{"position":[[431,8],[1722,8],[2298,8]]},"636":{"position":[[432,8],[692,8]]},"670":{"position":[[1443,9]]},"677":{"position":[[598,8]]},"692":{"position":[[453,9]]}}}],["callback'",{"_index":1401,"t":{"924":{"position":[[470,10],[822,10],[1226,10],[1561,10]]}}}],["callback(nul",{"_index":664,"t":{"670":{"position":[[1646,14]]}}}],["callback.j",{"_index":1036,"t":{"747":{"position":[[51,11]]},"749":{"position":[[55,11]]},"751":{"position":[[55,11]]},"753":{"position":[[55,11]]},"755":{"position":[[242,11]]},"766":{"position":[[53,11]]},"768":{"position":[[51,11]]},"770":{"position":[[51,11]]},"772":{"position":[[51,11]]},"774":{"position":[[238,11]]},"786":{"position":[[47,11]]},"788":{"position":[[42,11]]},"790":{"position":[[57,11]]},"799":{"position":[[45,11]]},"801":{"position":[[43,11]]},"803":{"position":[[43,11]]},"805":{"position":[[43,11]]},"807":{"position":[[230,11]]},"817":{"position":[[47,11]]},"819":{"position":[[42,11]]},"821":{"position":[[57,11]]},"831":{"position":[[47,11]]},"833":{"position":[[42,11]]},"835":{"position":[[57,11]]},"846":{"position":[[30,11]]},"848":{"position":[[40,11]]},"857":{"position":[[30,11]]},"859":{"position":[[40,11]]},"861":{"position":[[40,11]]},"868":{"position":[[30,11]]},"870":{"position":[[40,11]]},"882":{"position":[[47,11]]},"884":{"position":[[42,11]]},"886":{"position":[[57,11]]},"895":{"position":[[30,11]]},"897":{"position":[[40,11]]}}}],["candid",{"_index":1367,"t":{"920":{"position":[[859,9]]}}}],["capabilityflag",{"_index":790,"t":{"692":{"position":[[91,15]]},"877":{"position":[[369,16]]},"891":{"position":[[859,16],[889,16],[919,16]]}}}],["case",{"_index":655,"t":{"670":{"position":[[1461,5]]},"703":{"position":[[352,4]]},"755":{"position":[[148,4]]},"774":{"position":[[144,4]]},"807":{"position":[[136,4]]}}}],["catalog",{"_index":1224,"t":{"891":{"position":[[1139,8]]}}}],["catch",{"_index":132,"t":{"628":{"position":[[679,5],[905,5]]},"630":{"position":[[1364,5]]},"632":{"position":[[1935,5]]},"636":{"position":[[979,5]]},"747":{"position":[[203,5]]},"749":{"position":[[248,5]]},"751":{"position":[[252,5]]},"753":{"position":[[347,5]]},"755":{"position":[[426,5],[591,5]]},"766":{"position":[[373,5]]},"768":{"position":[[414,5]]},"770":{"position":[[418,5]]},"772":{"position":[[513,5]]},"774":{"position":[[592,5],[758,5]]},"786":{"position":[[258,5]]},"788":{"position":[[279,5]]},"790":{"position":[[296,5]]},"799":{"position":[[264,5]]},"801":{"position":[[305,5]]},"803":{"position":[[309,5]]},"805":{"position":[[404,5]]},"807":{"position":[[483,5],[642,5]]},"817":{"position":[[285,5]]},"819":{"position":[[306,5]]},"821":{"position":[[323,5]]},"828":{"position":[[415,5]]},"831":{"position":[[271,5]]},"833":{"position":[[292,5]]},"835":{"position":[[309,5]]},"846":{"position":[[211,5]]},"848":{"position":[[247,5]]},"857":{"position":[[216,5]]},"859":{"position":[[252,5]]},"861":{"position":[[271,5]]},"868":{"position":[[230,5]]},"870":{"position":[[266,5]]},"882":{"position":[[266,5]]},"884":{"position":[[287,5]]},"886":{"position":[[304,5]]},"895":{"position":[[221,5]]},"897":{"position":[[257,5]]},"926":{"position":[[131,5],[276,5],[429,5],[603,5],[763,5],[974,5],[1148,5],[1244,5],[1491,5],[1585,5]]}}}],["catch((err",{"_index":647,"t":{"670":{"position":[[1176,12]]},"733":{"position":[[620,12]]},"828":{"position":[[1426,12]]}}}],["catch(console.log",{"_index":327,"t":{"634":{"position":[[1876,19]]}}}],["catch(funct",{"_index":1144,"t":{"828":{"position":[[1880,15]]}}}],["caus",{"_index":1383,"t":{"920":{"position":[[1407,5]]}}}],["caution",{"_index":470,"t":{"646":{"position":[[816,7]]},"920":{"position":[[387,7]]}}}],["cb",{"_index":665,"t":{"670":{"position":[[1835,3]]},"703":{"position":[[754,4]]},"891":{"position":[[190,3]]}}}],["cb(err",{"_index":671,"t":{"670":{"position":[[2196,8]]}}}],["cb(null",{"_index":667,"t":{"670":{"position":[[2065,8]]},"703":{"position":[[874,8]]},"891":{"position":[[391,9],[455,8]]}}}],["cd",{"_index":430,"t":{"646":{"position":[[189,2],[643,2]]}}}],["cert",{"_index":1048,"t":{"753":{"position":[[245,5],[526,5]]},"755":{"position":[[217,4]]},"757":{"position":[[26,5],[156,4]]},"772":{"position":[[268,5],[725,5]]},"774":{"position":[[213,4]]},"776":{"position":[[26,5],[156,4]]},"805":{"position":[[215,5],[571,5]]},"807":{"position":[[205,4]]},"809":{"position":[[26,5],[156,4]]}}}],["cert.pem",{"_index":1045,"t":{"753":{"position":[[76,8],[283,10],[326,11],[564,10],[607,11]]},"755":{"position":[[205,8]]},"772":{"position":[[72,8],[306,10],[349,11],[763,10],[806,11]]},"774":{"position":[[201,8]]},"805":{"position":[[64,8],[253,10],[296,11],[609,10],[652,11]]},"807":{"position":[[193,8]]}}}],["certs/ca",{"_index":1044,"t":{"753":{"position":[[67,8]]},"772":{"position":[[63,8]]},"805":{"position":[[55,8]]}}}],["chamar",{"_index":184,"t":{"630":{"position":[[1000,6],[1586,6]]}}}],["chang",{"_index":442,"t":{"646":{"position":[[420,7]]},"650":{"position":[[39,7],[106,8],[211,8],[227,6],[305,7],[345,7],[365,6]]},"721":{"position":[[24,7]]},"723":{"position":[[24,7]]},"725":{"position":[[24,7]]},"920":{"position":[[301,7],[471,7],[747,8],[930,7]]}}}],["changedrow",{"_index":929,"t":{"721":{"position":[[148,11],[657,12]]},"723":{"position":[[554,12],[680,12]]},"725":{"position":[[870,12]]},"912":{"position":[[554,14]]},"914":{"position":[[572,14]]}}}],["changeus",{"_index":748,"t":{"677":{"position":[[749,13]]},"703":{"position":[[963,12]]}}}],["characterset",{"_index":789,"t":{"692":{"position":[[77,13]]},"877":{"position":[[352,13]]},"891":{"position":[[839,13],[1247,13]]}}}],["check",{"_index":537,"t":{"658":{"position":[[13,5],[119,5],[158,6]]},"662":{"position":[[7,5]]},"664":{"position":[[57,5]]},"714":{"position":[[374,5]]},"729":{"position":[[13,5],[372,8],[477,8]]}}}],["checkout",{"_index":458,"t":{"646":{"position":[[612,8]]}}}],["ci",{"_index":432,"t":{"646":{"position":[[240,2],[679,2]]}}}],["class",{"_index":16,"t":{"622":{"position":[[113,6]]},"729":{"position":[[628,5]]},"904":{"position":[[1428,5],[1669,5]]}}}],["classif",{"_index":1374,"t":{"920":{"position":[[1098,15]]}}}],["classifi",{"_index":1357,"t":{"920":{"position":[[618,10],[1354,10]]}}}],["clear",{"_index":550,"t":{"658":{"position":[[256,5],[292,5]]}}}],["cli",{"_index":453,"t":{"646":{"position":[[541,3]]},"828":{"position":[[2201,5]]}}}],["client",{"_index":34,"t":{"622":{"position":[[300,7]]},"624":{"position":[[0,7]]},"628":{"position":[[171,7],[950,7]]},"634":{"position":[[579,7]]},"660":{"position":[[384,6]]},"666":{"position":[[68,6],[143,7],[220,6]]},"670":{"position":[[51,6],[1577,6],[2656,6]]},"672":{"position":[[68,6]]},"692":{"position":[[276,6],[383,7]]},"694":{"position":[[318,7]]},"697":{"position":[[171,6]]},"741":{"position":[[237,6],[281,6]]}}}],["clientflag",{"_index":1157,"t":{"877":{"position":[[62,11]]}}}],["clientflags.compress",{"_index":1167,"t":{"877":{"position":[[397,21]]}}}],["clientplugindata(password1",{"_index":707,"t":{"672":{"position":[[789,27]]}}}],["clientplugindata(password2",{"_index":709,"t":{"672":{"position":[[929,27]]}}}],["clientplugindata(password3",{"_index":711,"t":{"672":{"position":[[1069,27]]}}}],["clone",{"_index":456,"t":{"646":{"position":[[557,5]]}}}],["close",{"_index":718,"t":{"675":{"position":[[250,5]]},"677":{"position":[[72,6],[635,5]]},"679":{"position":[[187,7]]},"694":{"position":[[405,5]]},"920":{"position":[[895,5]]}}}],["co",{"_index":983,"t":{"737":{"position":[[39,2],[353,2]]},"828":{"position":[[1548,2],[2004,2]]}}}],["co(funct",{"_index":985,"t":{"737":{"position":[[59,12]]},"828":{"position":[[1568,12]]}}}],["co.j",{"_index":1120,"t":{"828":{"position":[[9,5]]}}}],["code",{"_index":522,"t":{"654":{"position":[[173,4]]},"670":{"position":[[821,4]]},"694":{"position":[[230,4]]},"729":{"position":[[24,4]]},"757":{"position":[[98,4]]},"776":{"position":[[98,4]]},"809":{"position":[[98,4]]},"891":{"position":[[425,5],[498,5],[683,5]]}}}],["codificaçõ",{"_index":47,"t":{"624":{"position":[[105,12]]}}}],["collat",{"_index":1339,"t":{"918":{"position":[[694,9]]}}}],["column",{"_index":731,"t":{"677":{"position":[[239,6],[334,6],[480,8]]},"877":{"position":[[832,7],[955,7],[1029,9],[1066,9]]}}}],["columnlength",{"_index":1231,"t":{"891":{"position":[[1265,13]]}}}],["columntyp",{"_index":1233,"t":{"891":{"position":[[1284,11]]}}}],["coluna",{"_index":331,"t":{"636":{"position":[[19,7]]}}}],["com",{"_index":33,"t":{"622":{"position":[[294,3]]},"624":{"position":[[27,3]]},"628":{"position":[[233,3],[1009,3]]},"630":{"position":[[0,3],[857,3],[1449,3]]},"632":{"position":[[72,3],[2408,3],[2639,3]]},"634":{"position":[[62,3],[163,3]]},"636":{"position":[[27,3]]},"638":{"position":[[39,3],[476,3]]},"918":{"position":[[241,3],[384,3]]}}}],["come",{"_index":726,"t":{"677":{"position":[[37,5]]}}}],["começar",{"_index":405,"t":{"640":{"position":[[103,8]]}}}],["command",{"_index":556,"t":{"658":{"position":[[466,7]]},"692":{"position":[[203,8]]},"694":{"position":[[6,7],[162,7],[222,7],[291,8]]},"828":{"position":[[842,8]]},"920":{"position":[[547,7]]}}}],["commandcod",{"_index":811,"t":{"694":{"position":[[190,13]]}}}],["commit",{"_index":558,"t":{"658":{"position":[[495,7]]}}}],["commonli",{"_index":1312,"t":{"916":{"position":[[33,8]]}}}],["como",{"_index":163,"t":{"630":{"position":[[270,4]]},"632":{"position":[[1654,4]]},"634":{"position":[[768,4]]},"636":{"position":[[81,4]]},"638":{"position":[[139,4],[196,4],[596,4]]},"640":{"position":[[98,4]]}}}],["compartilhado",{"_index":1327,"t":{"918":{"position":[[293,13]]}}}],["compat",{"_index":524,"t":{"654":{"position":[[189,10]]},"757":{"position":[[103,10]]},"776":{"position":[[103,10]]},"809":{"position":[[103,10]]},"920":{"position":[[178,14],[290,10],[1122,13]]}}}],["compatívei",{"_index":32,"t":{"622":{"position":[[282,11]]}}}],["compatível",{"_index":367,"t":{"638":{"position":[[28,10]]},"918":{"position":[[373,10]]}}}],["compil",{"_index":481,"t":{"648":{"position":[[121,8]]},"741":{"position":[[101,9]]}}}],["complet",{"_index":448,"t":{"646":{"position":[[500,8]]},"648":{"position":[[52,8]]}}}],["complianc",{"_index":541,"t":{"658":{"position":[[49,10]]}}}],["compon",{"_index":475,"t":{"648":{"position":[[12,9],[165,11],[273,10]]},"650":{"position":[[12,9],[287,10]]},"652":{"position":[[205,10]]},"654":{"position":[[123,9],[231,10]]},"658":{"position":[[173,10]]}}}],["compress",{"_index":572,"t":{"660":{"position":[[352,11]]}}}],["compressão",{"_index":54,"t":{"624":{"position":[[176,11]]},"918":{"position":[[720,10]]}}}],["comprimida",{"_index":31,"t":{"622":{"position":[[271,10]]}}}],["concept",{"_index":952,"t":{"729":{"position":[[89,9]]}}}],["conexão",{"_index":29,"t":{"622":{"position":[[254,7]]},"628":{"position":[[225,7],[1001,7]]},"630":{"position":[[849,7],[1441,7]]},"632":{"position":[[64,7],[111,7],[314,8],[486,7],[1009,7],[1666,7],[1860,7],[2093,7],[2246,7],[2414,7],[2482,7],[2645,7],[2707,7],[2802,7]]},"634":{"position":[[155,7],[732,8],[1690,7]]},"636":{"position":[[289,7]]}}}],["conexõ",{"_index":205,"t":{"632":{"position":[[14,8],[366,8],[731,8],[837,8],[1254,8],[1360,8],[1525,8],[1591,8]]},"634":{"position":[[1597,8]]},"918":{"position":[[794,8]]}}}],["config",{"_index":585,"t":{"664":{"position":[[239,6]]},"670":{"position":[[126,6],[345,6],[1347,6]]},"672":{"position":[[354,6]]},"697":{"position":[[75,6]]},"768":{"position":[[19,7]]},"770":{"position":[[19,7]]},"772":{"position":[[19,7]]},"774":{"position":[[19,7]]},"778":{"position":[[19,7]]}}}],["configuração",{"_index":344,"t":{"636":{"position":[[258,12]]}}}],["confirm",{"_index":1397,"t":{"924":{"position":[[59,9]]},"926":{"position":[[59,9]]}}}],["conflito",{"_index":338,"t":{"636":{"position":[[129,10]]}}}],["conhecida",{"_index":369,"t":{"638":{"position":[[86,9]]}}}],["conjunto",{"_index":204,"t":{"632":{"position":[[2,8],[354,8]]},"918":{"position":[[232,8],[782,8]]}}}],["conn",{"_index":278,"t":{"632":{"position":[[2359,4],[2617,5]]},"634":{"position":[[1704,4],[1791,4]]},"636":{"position":[[447,4],[565,4]]},"670":{"position":[[832,4],[1682,4]]},"672":{"position":[[518,4]]},"710":{"position":[[128,4]]},"712":{"position":[[116,4]]},"717":{"position":[[107,4],[552,4]]},"719":{"position":[[124,4]]},"721":{"position":[[363,4]]},"723":{"position":[[214,4]]},"725":{"position":[[343,4]]},"735":{"position":[[75,4]]},"877":{"position":[[201,6]]},"891":{"position":[[599,6]]},"904":{"position":[[1450,5]]},"906":{"position":[[418,4]]},"908":{"position":[[455,4]]},"910":{"position":[[444,4]]},"912":{"position":[[724,4]]},"914":{"position":[[761,4]]},"930":{"position":[[481,4]]}}}],["conn.clos",{"_index":1218,"t":{"891":{"position":[[700,13],[1482,13]]}}}],["conn.end",{"_index":328,"t":{"634":{"position":[[1908,12]]},"735":{"position":[[210,11]]},"906":{"position":[[1214,11]]},"908":{"position":[[1249,11]]},"910":{"position":[[1357,11]]},"912":{"position":[[2089,11]]},"914":{"position":[[2124,11]]},"930":{"position":[[1392,11]]}}}],["conn.execute('select",{"_index":912,"t":{"714":{"position":[[108,20]]},"735":{"position":[[161,20]]}}}],["conn.execute>(sql",{"_index":946,"t":{"725":{"position":[[652,53]]}}}],["conn.query>('cal",{"_index":1303,"t":{"912":{"position":[[1624,45]]},"914":{"position":[[1661,45]]}}}],["conn.query('drop",{"_index":1289,"t":{"906":{"position":[[517,33]]},"908":{"position":[[554,33]]},"910":{"position":[[543,33]]},"912":{"position":[[823,33],[1343,33]]},"914":{"position":[[860,33],[1380,33]]},"930":{"position":[[580,33]]}}}],["conn.query(sql",{"_index":934,"t":{"721":{"position":[[460,32]]}}}],["conn.query(sql",{"_index":939,"t":{"723":{"position":[[349,34]]}}}],["conn.query('select",{"_index":917,"t":{"717":{"position":[[185,35]]}}}],["conn.query('show",{"_index":919,"t":{"717":{"position":[[321,33],[797,33]]}}}],["conn.query(sql",{"_index":924,"t":{"719":{"position":[[279,34]]}}}],["conn.query dica You can also utilize React components in the changes option. Example History Version Changes v1.0.0 Some change message.","s":"History","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#history","p":627},{"i":638,"t":"See the Stability Badges for more detais. import { Stability } from '@site/src/components/Stability'; dica You can also utilize React components in the message option. Available levels: 0, 1, 1.1, 1.2, 2 and 3. Example 2Stable 2Stable Some message.","s":"Stability","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#stability","p":627},{"i":640,"t":"import { FAQ } from '@site/src/components/FAQ'; > Some markdown (**MDX**) content. dica The FAQ component can be utilized in any section or page. Code blocks are compatible and can be used within the FAQ component. Example Title Some markdown (MDX) content.","s":"FAQ","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#faq","p":627},{"i":642,"t":"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; Example","s":"ExternalCodeEmbed","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#externalcodeembed","p":627},{"i":644,"t":"npm run test Check Prettier and ESLint rules for compliance npm run lintcheck Included in the GitHub Actions workflow. Check for typings errors 1Experimental Checks for MDX components are missing. npm run typecheck Included in the GitHub Actions workflow. Clear and build the website npm run clear npm run build Included in the GitHub Actions workflow. Fix issues from Prettier and ESLint rules npm run lint To prevent lint issues, it is recommended to execute this command before creating your commit. Not included in the GitHub Actions workflow.","s":"Running Tests","u":"/node-mysql2/pt-BR/docs/contributing/website","h":"#running-tests","p":627},{"i":646,"t":"MySQL2 aims to be a drop in replacement for Node MySQL. nota If you see any API incompatibilities with Node MySQL, please report via github issue. Not only MySQL2 offers better performance over Node MySQL, we also support these additional features: Prepared Statements Promise Wrapper Authentication Switch More Features MySQL Server Pooling SSL MySQL Compression Binary Log Protocol Client","s":"Documentation","u":"/node-mysql2/pt-BR/docs/documentation","h":"","p":645},{"i":648,"t":"Please check these examples for MySQL2.","s":"Examples","u":"/node-mysql2/pt-BR/docs/documentation","h":"#examples","p":645},{"i":650,"t":"zeroFill flag is ignored in type conversion. You need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you. DECIMAL and NEWDECIMAL types always returned as string unless you pass this config option: { decimalNumbers: true, } nota This option could lose precision on the number as Javascript Number is a Float!","s":"Known incompatibilities with Node MySQL","u":"/node-mysql2/pt-BR/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":645},{"i":652,"t":"Wire protocol documentation Node MySQL - Most popular node.js mysql client library node-mariasql - Bindings to libmariasql. One of the fastest clients node-libmysqlclient - Bindings to libmysqlclient go-mysql - MySQL Go client (prepared statements, binlog protocol, server)","s":"Other Resources","u":"/node-mysql2/pt-BR/docs/documentation","h":"#other-resources","p":645},{"i":654,"t":"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b npm run benchmarks node-mysql-benchmarks try to run example benchmarks on your system","s":"Benchmarks","u":"/node-mysql2/pt-BR/docs/documentation","h":"#benchmarks","p":645},{"i":656,"t":"Cliente MySQL para Node.js com foco em performance. Suporta instruções preparadas (prepared statements), Codificações non-utf8, protocolo de log binário (binary log protocol), compressão, SSL e muito mais.","s":"MySQL2","u":"/node-mysql2/pt-BR/docs","h":"","p":655},{"i":658,"t":"O MySQL2 não tem restrições nativas e pode ser instalado no Linux, Mac OS ou Windows sem qualquer problema. JavaScript TypeScript npm install --save mysql2 npm install --save mysql2 npm install --save-dev @types/node Para documentação e exemplos usando TypeScript, veja aqui.","s":"Instalação","u":"/node-mysql2/pt-BR/docs","h":"#instalação","p":655},{"i":660,"t":"Para explorar mais exemplos de consulta (queries), visite a seção de exemplos Consultas Simples e Instruções Preparadas (Prepared Statements). Promise Callback // Obtém o cliente import mysql from 'mysql2/promise'; // Cria a conexão com o Banco de Dados const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // Consulta simples try { const [results, fields] = await connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45' ); console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } catch (err) { console.log(err); } // Utilizando espaços reservados (placeholders) try { const [results] = await connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45] ); console.log(results); } catch (err) { console.log(err); } // Obtém o cliente const mysql = require('mysql2'); // Cria a conexão com o Banco de Dados const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // Consulta simples connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45', function (err, results, fields) { console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } ); // Utilizando espaços reservados (placeholders) connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45], function (err, results) { console.log(results); } );","s":"Primeira Consulta (Query)","u":"/node-mysql2/pt-BR/docs","h":"#primeira-consulta-query","p":655},{"i":662,"t":"Com o MySQL2 você também pode obter Instruções Preparadas (Prepared Statements). Dessa forma o MySQL não precisa preparar um plano para a mesma consulta todas as vezes, resultando em um melhor desempenho. Se você não sabe por que isso é importante, veja essa discussão: Como as instruções preparadas (prepared statements) podem proteger contra ataques de injeção SQL O MySQL2 fornece o método auxiliar execute que irá preparar e consultar as declarações (statements) SQL. Além disso, você também pode usar os métodos prepare e unprepare para preparar ou desfazer a preparação de declarações (statements) manualmente, se necessário. Para explorar mais exemplos de Instruções Preparadas (Prepared Statements), visite a seção de exemplos Instruções Preparadas (Prepared Statements). Promise Callback import mysql from 'mysql2/promise'; try { // Cria a conexão com o Banco de Dados const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // \"execute\" irá chamar internamente a preparação e a consulta (query) const [results, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53] ); console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } catch (err) { console.log(err); } const mysql = require('mysql2'); // Cria a conexão com o Banco de Dados const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // \"execute\" irá chamar internamente a preparação e a consulta (query) connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53], function (err, results, fields) { console.log(results); // \"results\" contêm as linhas retornadas pelo servidor console.log(fields); // \"fields\" contêm metadados adicionais sobre os resultados, quando disponíveis } ); dica Se você executar a mesma declaração novamente, ela será selecionada a partir do LRU Cache, o que economizará tempo de preparação da consulta e proporcionará melhor desempenho.","s":"Usando Instruções Preparadas (Prepared Statements)","u":"/node-mysql2/pt-BR/docs","h":"#usando-instruções-preparadas-prepared-statements","p":655},{"i":664,"t":"O conjunto de conexões (pools) ajuda a reduzir o tempo gasto na conexão com o servidor MySQL, reutilizando uma conexão anterior e deixando-as abertas ao invés de fechá-las quando você termina de usá-las. Isto melhora a latência das consultas (queries), pois evita toda a sobrecarga associada à criação de uma nova conexão. Para explorar mais exemplos de Conjunto de Conexões (pools), visite a seção de exemplos createPool. Promise Callback import mysql from 'mysql2/promise'; // Cria a conexão (pool). As definições específicadas do \"createPool\" são as predefinições padrões const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // Máximo de conexões inativas; o valor padrão é o mesmo que \"connectionLimit\" idleTimeout: 60000, // Tempo limite das conexões inativas em milissegundos; o valor padrão é \"60000\" queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); const mysql = require('mysql2'); // Cria a conexão (pool). As definições específicadas do \"createPool\" são as predefinições padrões const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // Máximo de conexões inativas; o valor padrão é o mesmo que \"connectionLimit\" idleTimeout: 60000, // Tempo limite das conexões inativas em milissegundos; o valor padrão é \"60000\" queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); nota O pool não estabelece todas as conexões previamente, mas as cria sob demanda até que o limite de conexões seja atingido. Você pode usar o pool da mesma maneira como em uma conexão (usando pool.query() e pool.execute()): Promise Callback try { // Para a inicialização do \"pool\", veja acima const [rows, fields] = await pool.query('SELECT `field` FROM `table`'); // A conexão é automaticamente liberada quando a consulta (query) é resolvida } catch (err) { console.log(err); } // Para a inicialização do \"pool\", veja acima pool.query('SELECT `field` FROM `table`', function (err, rows, fields) { // A conexão é automaticamente liberada quando a consulta (query) é resolvida }); Alternativamente, também existe a possibilidade de adquirir manualmente uma conexão do pool e liberá-la posteriormente: Promise Callback // Para a inicialização do \"pool\", veja acima const conn = await pool.getConnection(); // Fazer algo com a conexão await conn.query(/* ... */); // Não se esqueça de liberar a conexão quando terminar! pool.releaseConnection(conn); // Para a inicialização do \"pool\", veja acima pool.getConnection(function (err, conn) { // Fazer algo com a conexão conn.query(/* ... */); // Não se esqueça de liberar a conexão quando terminar! pool.releaseConnection(conn); }); Adicionalmente, você pode liberar a conexão usando o objeto connection: conn.release();","s":"Usando Conjunto de Conexões (pools)","u":"/node-mysql2/pt-BR/docs","h":"#using-connection-pools","p":655},{"i":666,"t":"O MySQL2 também suporta Promise API. O que funciona muito bem com o ES7 async await. import mysql from 'mysql2/promise'; async function main() { // Cria a conexão com o Banco de Dados const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // Consulta no Banco de Dados const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); } O MySQL2 usa o objeto Promise padrão disponível no escopo. Mas você pode escolher qual implementação de Promise deseja usar. // Obtém o cliente import mysql from 'mysql2/promise'; // Obtém a implementação de \"Promise\" (nós usaremos o \"bluebird\") import bluebird from 'bluebird'; // Cria a conexão, especificando o \"bluebird\" como \"Promise\" const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', Promise: bluebird, }); // Consulta no Banco de Dados const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); MySQL2 also exposes a .promise() function on Pools, so you can create a promise/non-promise connections from the same pool. import mysql from 'mysql2'; async function main() { // create the pool const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', }); // now get a Promise wrapped instance of that pool const promisePool = pool.promise(); // query database using promises const [rows, fields] = await promisePool.query('SELECT 1'); } O MySQL2 também expõe o método .promise() em Pools, então você pode criar conexões \"promise/non-promise\" para o mesmo pool. const mysql = require('mysql2'); // Cria a conexão const conn = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); conn .promise() .query('SELECT 1') .then(([rows, fields]) => { console.log(rows); }) .catch(console.log) .then(() => conn.end());","s":"Usando o Promise Wrapper","u":"/node-mysql2/pt-BR/docs","h":"#usando-o-promise-wrapper","p":655},{"i":668,"t":"Se você tiver duas colunas com o mesmo nome, pode preferir receber os resultados como um array, em vez de um objeto, para evitar conflitos. Isso é uma divergência da biblioteca Node MySQL. Por exemplo: SELECT 1 AS `foo`, 2 AS `foo`. Você pode habilitar essa configuração tanto no nível de conexão (aplica-se a todas as consultas), quanto no nível de consulta (aplica-se apenas a essa consulta específica). Connection Level​ Promise Callback const conn = await mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); const conn = mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); Query Level​ Promise Callback try { const [results, fields] = await conn.query({ sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }); console.log(results); // nessa consulta, \"results\" contêm um array de arrays ao invés de um array de objetos console.log(fields); // \"fields\" mantêm-se inalterados } catch (err) { console.log(err); } conn.query( { sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }, function (err, results, fields) { console.log(results); // nessa consulta, \"results\" contêm um array de arrays ao invés de um array de objetos console.log(fields); // \"fields\" mantêm-se inalterados } ); Obtendo Ajuda Precisa de ajuda? Faça sua pergunta no Stack Overflow ou GitHub. Se você encontrou um erro, registre-o no GitHub.","s":"Resultados em Array","u":"/node-mysql2/pt-BR/docs","h":"#resultados-em-array","p":655},{"i":670,"t":"During the connection phase the server may ask the client to switch to a different auth method. If the authPlugins connection config option is set, it must be an object where each key is the name of a potential authentication plugin requested by the server, and the corresponding value must be a function that optionally receives the connection config options and returns another function, which in turn, optionally receives the switch request data. The plugin is loaded with a ({user,password,...}) signature, and each call has a (pluginData) signature. Each call should make the plugin return any additional authentication data (Buffer) that should be sent back to the server, either synchronously or asynchronously using a Promise, or should yield an error accordingly. Example: (imaginary ssh-key-auth plugin) pseudo code const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authPlugins: { 'ssh-key-auth': function ({ password }) { return function (pluginData) { return getPrivate(key) .then((key) => { const response = encrypt(key, password, pluginData); // continue handshake by sending response data return response; }) .catch((err) => { // throw error to propagate error to connect/changeUser handlers }); }; }, }, }); There is also a deprecated API where if a authSwitchHandler connection config option is set it must be a function that receives switch request data and responds via a callback. In this case, the first invocation always has a ({pluginName, pluginData}) signature, following calls - ({pluginData}). The client replies with an opaque blob matching the requested plugin via callback(null, data: Buffer). const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authSwitchHandler: function ({ pluginName, pluginData }, cb) { if (pluginName === 'ssh-key-auth') { getPrivateKey((key) => { const response = encrypt(key, pluginData); // continue handshake by sending response data // respond with error to propagate error to connect/changeUser handlers cb(null, response); }); } else { const err = new Error( `Unknown AuthSwitchRequest plugin name ${pluginName}` ); err.fatal = true; cb(err); } }, }); The initial handshake is always performed using mysql_native_password plugin. This will be possible to override in future versions. Note that if the mysql_native_password method is requested it will be handled internally according to Authentication::Native41 and no authPlugins function or the authSwitchHandler will be invoked. These MAY be called multiple times if the plugin algorithm requires multiple roundtrips of data exchange between client and server.","s":"Authentication Switch Request","u":"/node-mysql2/pt-BR/docs/documentation/authentication-switch","h":"","p":669},{"i":672,"t":"If the user requires multi-factor authentication in the server, the client will receive a AuthNextFactor request, which is similar in structure to the regular authentication switch request and contains the name and possible initial data for the additional authentication factor plugin (up to 3). Additional passwords can be provided using the connection config options - password2 and password3. Again, for each authentication factor, multiple roundtrips of data exchange can be required by the plugin algoritm. const conn = mysql.createConnection({ user: 'test_user', password: 'secret1', password2: 'secret2', password3: 'secret3', database: 'test_database', authPlugins: { // password1 === password 'auth-plugin1': function ({ password1 }) { return function (serverPluginData) { return clientPluginData(password1, serverPluginData); }; }, 'auth-plugin2': function ({ password2 }) { return function (serverPluginData) { return clientPluginData(password2, serverPluginData); }; }, 'auth-plugin3': function ({ password3 }) { return function (serverPluginData) { return clientPluginData(password3, serverPluginData); }; }, }, });","s":"Multi-factor authentication","u":"/node-mysql2/pt-BR/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":669},{"i":675,"t":"You can use named placeholders for parameters by setting namedPlaceholders config value or query/execute time option. Named placeholders are converted to unnamed ? on the client (mysql protocol does not support named parameters). If you reference parameter multiple times under the same name it is sent to server multiple times. Unnamed placeholders can still be used by providing the values as an array instead of an object. connection.config.namedPlaceholders = true; connection.execute('select :x + :y as z', { x: 1, y: 2 }, (err, rows) => { // statement prepared as \"select ? + ? as z\" and executed with [1,2] values // rows returned: [ { z: 3 } ] }); connection.execute('select :x + :x as z', { x: 1 }, (err, rows) => { // select ? + ? as z, execute with [1, 1] }); connection.query('select :x + :x as z', { x: 1 }, (err, rows) => { // query select 1 + 1 as z }); // unnamed placeholders are still valid if the values are provided in an array connection.query('select ? + ? as z', [1, 1], (err, rows) => { // query select 1 + 1 as z });","s":"Named placeholders","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#named-placeholders","p":673},{"i":677,"t":"const options = { sql: 'select A,B,C,D from foo', rowsAsArray: true }; connection.query(options, (err, results) => { /* results will be an array of arrays like this now: [[ 'field A value', 'field B value', 'field C value', 'field D value', ], ...] */ });","s":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":673},{"i":679,"t":"In addition to sending local fs files you can send any stream using infileStreamFactory query option. If set, it has to be a function that return a readable stream. It gets file path from query as a parameter. Note: starting from version 2.0 infileStreamFactory is required parameter for LOAD DATA LOCAL INFILE. Response from server indicates that it wants access to a local file and no infileStreamFactory option is provided the query ends with error. // local file connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)', onInserted1 ); // local stream const sql = 'LOAD DATA LOCAL INFILE \"mystream\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)'; connection.query( { sql: sql, infileStreamFactory: function (path) { return getStream(); }, }, onInserted2 ); The infileStreamFactory option may also be set at a connection-level: const fs = require('fs'); const mysql = require('mysql2'); const connection = mysql.createConnection({ user: 'test', database: 'test', infileStreamFactory: (path) => { // Validate file path const validPaths = ['/tmp/data.csv']; if (!validPaths.includes(path)) { throw new Error( `invalid file path: ${path}: expected to be one of ${validPaths.join( ',' )}` ); } return fs.createReadStream(path); }, }); connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test', onInserted );","s":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":673},{"i":681,"t":"const net = require('net'); const mysql = require('mysql2'); const shape = require('shaper'); const connection = mysql.createConnection({ user: 'test', database: 'test', stream: net.connect('/tmp/mysql.sock').pipe(shape(10)), // emulate 10 bytes/sec link }); connection.query('SELECT 1+1 as test1', console.log); stream also can be a function. In that case function result has to be duplex stream, and it is used for connection transport. This is required if you connect pool using custom transport as new pooled connection needs new stream. Example connecting over socks5 proxy: const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ database: 'test', user: 'foo', password: 'bar', stream: function (cb) { const newStream = new SocksConnection( { host: 'remote.host', port: 3306 }, { host: 'localhost', port: 1080 } ); cb(null, newStream); }, }); In addition to password createConnection(), createPool() and changeUser() accept passwordSha1 option. This is useful when implementing proxies as plaintext password might be not available.","s":"Connecting using custom stream:","u":"/node-mysql2/pt-BR/docs/documentation/extras","h":"#connecting-using-custom-stream","p":673},{"i":684,"t":"createServer() - creates server instance Server.listen - listen port / unix socket (same arguments as net.Server.listen)","s":"Server","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#server","p":682},{"i":686,"t":"connect new incoming connection.","s":"Events","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#events","p":682},{"i":688,"t":"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags }) send server handshake initialisation packet, wait handshake response and start listening for commands writeOk({ affectedRows: num, insertId: num }) send OK packet to client writeEof(warnings, statusFlags) send EOF packet writeTextResult(rows, fields) write query result to client. Rows and fields are in the same format as in connection.query callback. writeColumns(fields) write fields + EOF packets. writeTextRow(row) write array (not hash!) of values as result row TODO: binary protocol","s":"Connection","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#connection","p":682},{"i":690,"t":"Every command packet received by the server will be emitted as a packet event with the parameters: packet: Packet The packet itself knownCommand: boolean is this command known to the server *commandCode: number the parsed command code (first byte) In addition special events are emitted for commands received from the client. If no listener is present a fallback behavior will be invoked. quit() Default: close the connection init_db(schemaName: string) Default: return OK query(sql: string) Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR field_list(table: string, fields: string) Default: return ER_WARN_DEPRECATED_SYNTAX ping() - Default: return OK","s":"Events","u":"/node-mysql2/pt-BR/docs/documentation/mysql-server","h":"#events-1","p":682},{"i":692,"t":"In addition to errback interface there is thin wrapper to expose Promise-based api","s":"Promise Wrappers","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"","p":691},{"i":694,"t":"/* eslint-env es6 */ const mysql = require('mysql2/promise'); // or require('mysql2').createConnectionPromise mysql .createConnection({ /* same parameters as for non-promise createConnection */ }) .then((conn) => conn.query('select foo from bar')) .then(([rows, fields]) => console.log(rows[0].foo)); const pool = require('mysql2/promise').createPool({}); // or require('mysql2').createPoolPromise({}) or require('mysql2').createPool({}).promise() pool .getConnection() .then((conn) => { const res = conn.query('select foo from bar'); conn.release(); return res; }) .then((result) => { console.log(result[0][0].foo); }) .catch((err) => { console.log(err); // any of connection time or query time errors from above });","s":"Basic Promise","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#basic-promise","p":691},{"i":696,"t":"async function example1() { const mysql = require('mysql2/promise'); const conn = await mysql.createConnection({ database: test }); const [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]); await conn.end(); } async function example2() { const mysql = require('mysql2/promise'); const pool = mysql.createPool({ database: test }); // execute in parallel, next console.log in 3 seconds await Promise.all([ pool.query('select sleep(2)'), pool.query('select sleep(3)'), ]); console.log('3 seconds after'); await pool.end(); }","s":"ES7 Async Await","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#es7-async-await","p":691},{"i":698,"t":"const mysql = require('mysql2'); const co = require('co'); co(function* () { const c = yield mysql.createConnectionPromise({ user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }); Examples in /examples/promise-co-await","s":"With CO","u":"/node-mysql2/pt-BR/docs/documentation/promise-wrapper","h":"#with-co","p":691},{"i":701,"t":"Similar to connection.query(). connection.execute('select 1 + ? + ? as result', [5, 6], (err, rows) => { // rows: [ { result: 12 } ] // internally 'select 1 + ? + ? as result' is prepared first. On subsequent calls cached statement is re-used }); // close cached statement for 'select 1 + ? + ? as result'. noop if not in cache connection.unprepare('select 1 + ? + ? as result'); Note that connection.execute() will cache the prepared statement for better performance, remove the cache with connection.unprepare() when you're done.","s":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":699},{"i":703,"t":"Manually prepared statements doesn't comes with LRU cache and SHOULD be closed using statement.close() instead of connection.unprepare(). connection.prepare('select ? + ? as tests', (err, statement) => { // statement.parameters - array of column definitions, length === number of params, here 2 // statement.columns - array of result column definitions. Can be empty if result schema is dynamic / not known // statement.id // statement.query statement.execute([1, 2], (err, rows, columns) => { // -> [ { tests: 3 } ] }); // don't use connection.unprepare(), it won't work! // note that there is no callback here. There is no statement close ack at protocol level. statement.close(); }); Note that you should not use statement after connection reset (changeUser() or disconnect). Statement scope is connection, you need to prepare statement for each new connection in order to use it.","s":"Manual prepare / execute","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":699},{"i":705,"t":"maxPreparedStatements : We keep the cached statements in a lru-cache. Default size is 16000 but you can use this option to override it. Any statements that are dropped from cache will be closed.","s":"Configuration","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#configuration","p":699},{"i":707,"t":"The bind parameter values passed to execute are serialized JS -> MySQL as: null -> NULL number -> DOUBLE boolean -> TINY (0 for false, 1 for true) object -> depending on prototype: Date -> DATETIME JSON like object - JSON Buffer -> VAR_STRING Other -> VAR_STRING Passing in undefined or a function will result in an error.","s":"Serialization of bind parameters","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":699},{"i":709,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [1, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.unprepare('select ?+1 as qqq, ? as rrr, ? as yyy'); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); } ); } ); } );","s":"Prepared Statements Helper","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":699},{"i":711,"t":"For Prepared Statements examples, please see here.","s":"Examples","u":"/node-mysql2/pt-BR/docs/documentation/prepared-statements","h":"#examples","p":699},{"i":714,"t":"npm install --save mysql2 npm install --save-dev @types/node The @types/node ensure the proper interaction between TypeScript and the Node.js modules used by MySQL2 (net, events, stream, tls, etc.). info Requires TypeScript >=4.5.2.","s":"Installation","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#installation","p":712},{"i":716,"t":"You can import MySQL2 in two ways: By setting the esModuleInterop option to true in tsconfig.json import mysql from 'mysql2'; import mysql from 'mysql2/promise'; By setting the esModuleInterop option to false in tsconfig.json import * as mysql from 'mysql2'; import * as mysql from 'mysql2/promise';","s":"Usage","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#usage","p":712},{"i":718,"t":"import mysql, { ConnectionOptions } from 'mysql2'; const access: ConnectionOptions = { user: 'test', database: 'test', }; const conn = mysql.createConnection(access);","s":"Connection","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#connection","p":712},{"i":720,"t":"import mysql, { PoolOptions } from 'mysql2'; const access: PoolOptions = { user: 'test', database: 'test', }; const conn = mysql.createPool(access);","s":"Pool Connection","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#pool-connection","p":712},{"i":722,"t":"A simple query​ conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); conn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); The rows output will be these possible types: RowDataPacket[] RowDataPacket[][] ResultSetHeader ResultSetHeader[] ProcedureCallPacket In this example, you need to manually check the output types","s":"Query and Execute","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#query-and-execute","p":712},{"i":725,"t":"2Stable An array with the returned rows, for example: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); // SELECT conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { test: 2 } ] */ }); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { Tables_in_test: 'test' } ] */ }); Using rowsAsArray option as true: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', rowsAsArray: true, }); // SELECT conn.query( 'SELECT 1 + 1 AS test, 2 + 2 AS test;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 2, 4 ] ] */ } ); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 'test' ] ] */ });","s":"RowDataPacket[]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#rowdatapacket","p":712},{"i":727,"t":"2Stable Using multipleStatements option as true with multiple queries: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SELECT 1 + 1 AS test; SELECT 2 + 2 AS test; `; conn.query(sql, (_err, rows) => { console.log(rows); /** * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ] */ });","s":"RowDataPacket[][]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":712},{"i":729,"t":"2Stable History Version Changes v3.5.1 OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead. changedRows option is deprecated and might be removed in the future major release. Please use affectedRows instead. For INSERT, UPDATE, DELETE, TRUNCATE, etc.: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); const sql = ` SET @1 = 1; `; conn.query(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ });","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#resultsetheader","p":712},{"i":731,"t":"2Stable History Version Changes v3.5.1 Introduce ResultSetHeader[] For multiples INSERT, UPDATE, DELETE, TRUNCATE, etc. when using multipleStatements as true: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SET @1 = 1; SET @2 = 2; `; conn.query(sql, (_err, results) => { console.log(results); /** * @results: [ ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 10, warningStatus: 0, changedRows: 0 }, ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } ] */ });","s":"ResultSetHeader[]","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":712},{"i":733,"t":"2Stable History Version Changes v3.5.1 Introduce ProcedureCallPacket dica By performing a Call Procedure using INSERT, UPDATE, etc., the return will be a ProcedureCallPacket (even if you perform multiples queries and set multipleStatements to true): import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); /** ResultSetHeader */ conn.query('DROP PROCEDURE IF EXISTS myProcedure'); /** ResultSetHeader */ conn.query(` CREATE PROCEDURE myProcedure() BEGIN SET @1 = 1; SET @2 = 2; END `); /** ProcedureCallPacket */ const sql = 'CALL myProcedure()'; conn.query>(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ }); For CREATE PROCEDURE and DROP PROCEDURE, these returns will be the default ResultSetHeader. By using SELECT and SHOW queries in a Procedure Call, it groups the results as: /** ProcedureCallPacket */ [RowDataPacket[], ResultSetHeader] For ProcedureCallPacket, please see the following examples.","s":"ProcedureCallPacket","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":712},{"i":735,"t":"0Deprecated OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead.","s":"OkPacket","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#okpacket","p":712},{"i":737,"t":"You can also check some code examples using MySQL2 and TypeScript to understand advanced concepts: Extending and using Interfaces with RowDataPacket Extending and using Interfaces with RowDataPacket and rowAsArray Extending and using Interfaces with RowDataPacket and multipleStatements Extending and using Interfaces with RowDataPacket, rowAsArray and multipleStatements Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket from ProcedureCallPacket Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket and rowAsArray from ProcedureCallPacket Creating a basic custom MySQL2 Class","s":"Examples","u":"/node-mysql2/pt-BR/docs/documentation/typescript-examples","h":"#examples","p":712},{"i":739,"t":"dica To explore the examples, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Examples","u":"/node-mysql2/pt-BR/docs/examples","h":"","p":738},{"i":741,"t":"MySQL-pg-proxy - MySQL to Postgres proxy server. MySQLite.js - MySQL server with JS-only (emscripten compiled) sqlite backend. SQL-engine - MySQL server with LevelDB backend. MySQL-osquery-proxy - Connect to facebook osquery using MySQL client PlyQL - Connect to Druid using MySQL client","s":"Examples using MySQL server API","u":"/node-mysql2/pt-BR/docs/examples","h":"#examples-using-mysql-server-api","p":738},{"i":743,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPool","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"","p":742},{"i":745,"t":"createPool(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":742},{"i":747,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig","p":742},{"i":749,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":742},{"i":751,"t":"createPool(config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":742},{"i":753,"t":"createPool(config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await pool.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { pool.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); atenção Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":742},{"i":755,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#related-links","p":742},{"i":757,"t":"createPool(config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const pool = mysql.createPool({ stream: socksProxy, }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); Testing pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createPool(config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":742},{"i":760,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/create-pool","h":"#pooloptions","p":742},{"i":762,"t":"index.js 'use strict'; const mysql = require('mysql2'); const through2 = require('through2'); const binlogStream = mysql.createBinlogStream({ serverId: 123, // slave ID, first field in \"show slave hosts\" sql response // you can also specify slave host, username, password and port masterId: 0, filename: 'mysql-bin.000007', binlogPos: 120, flags: 1, // 1 = \"non-blocking mode\" }); binlogStream.pipe( through2.obj((obj, enc, next) => { console.log(obj); next(); }) );","s":"Binlog Watcher","u":"/node-mysql2/pt-BR/docs/examples/binlog-watcher","h":"","p":761},{"i":764,"t":"await.js co.js .babelrc package.json 'use strict'; const mysql = require('mysql2/promise'); async function test() { const c = await mysql.createConnection({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log('connected!'); const [rows, fields] = await c.query('show databases'); console.log(rows); try { const [rows, fields] = await c.query('some invalid sql here'); } catch (e) { console.log('caught exception!', e); } console.log(await c.execute('select sleep(0.5)')); console.log('after first sleep'); console.log(await c.execute('select sleep(0.5)')); console.log('after second sleep'); let start = +new Date(); console.log( await Promise.all([ c.execute('select sleep(2.5)'), c.execute('select sleep(2.5)'), ]) ); console.log( 'after 2+3 parallel sleep which is in fact not parallel because commands are queued per connection' ); let end = +new Date(); console.log(end - start); await c.end(); const p = mysql.createPool({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log(await p.execute('select sleep(0.5)')); console.log('after first pool sleep'); start = +new Date(); console.log( await Promise.all([ p.execute('select sleep(2.5)'), p.execute('select sleep(2.5)'), ]) ); console.log('after 2+3 parallel pool sleep'); end = +new Date(); console.log(end - start); await p.end(); } test() .then(() => { console.log('done'); }) .catch((err) => { console.log('error!', err); throw err; }); 'use strict'; const mysql = require('mysql2/promise'); const co = require('co'); co(function* () { const c = yield mysql.createConnection({ port: 3306, user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }) .then(function () { console.log('done'); }) .catch(function (err) { console.log(err); throw err; }); { \"plugins\": [\"transform-async-to-generator\"] } { \"name\": \"promise-co-await\", \"version\": \"1.0.0\", \"description\": \"\", \"main\": \"await.js\", \"scripts\": { \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\" }, \"author\": \"\", \"license\": \"ISC\", \"dependencies\": { \"babel-cli\": \"^6.9.0\" } }","s":"await — co","u":"/node-mysql2/pt-BR/docs/examples/promise-wrapper/co-await","h":"","p":763},{"i":766,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. See detailed documentaion in Prepared Statements. dica If you execute same statement again, it will be picked form a LRU cache which will save query preparation time and give better performance. Usage examples: INSERT SELECT UPDATE DELETE","s":"Prepared Statements","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements","h":"","p":765},{"i":768,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createConnection","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"","p":767},{"i":770,"t":"createConnection(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":767},{"i":772,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config)","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":767},{"i":774,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":767},{"i":776,"t":"createConnection(config: ConnectionOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); connection.addListener('error', (err) => { console.log(err); }); See ssl/certs.","s":"createConnection(config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":767},{"i":778,"t":"createConnection(config: ConnectionOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await connection.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); connection.addListener('error', (err) => { console.log(err); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { connection.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); });","s":"createConnection(config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":767},{"i":780,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#related-links","p":767},{"i":782,"t":"createConnection(config: ConnectionOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const connection = mysql.createConnection({ stream: socksProxy, }); connection.addListener('error', (err) => { console.log(err); }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const connection = mysql.createConnection({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); connection.addListener('error', (err) => { console.log(err); }); Testing connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createConnection(config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":767},{"i":785,"t":"ConnectionOptions Specification","s":"ConnectionOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/create-connection","h":"#connectionoptions","p":767},{"i":788,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":786},{"i":790,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":786},{"i":792,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":786},{"i":795,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":786},{"i":797,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":786},{"i":800,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute(sql, values); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute(sql, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":798},{"i":802,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute({ sql, values, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, values, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":798},{"i":804,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, // ... other options }, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":798},{"i":807,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":798},{"i":810,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":808},{"i":812,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":808},{"i":814,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":808},{"i":817,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":808},{"i":819,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":808},{"i":821,"t":"info For Prepared Statements or Placeholders / Parameters examples, please see here. Usage examples: INSERT SELECT UPDATE DELETE","s":"Simple Queries","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries","h":"","p":820},{"i":823,"t":"The examples below also work for the execute method.","s":"DELETE","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"","p":822},{"i":825,"t":"query(sql: string) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#querysql","p":822},{"i":827,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":822},{"i":830,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":822},{"i":832,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":822},{"i":835,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":833},{"i":837,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":833},{"i":839,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":833},{"i":842,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":833},{"i":844,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":833},{"i":846,"t":"The examples below also work for the execute method.","s":"INSERT","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"","p":845},{"i":848,"t":"query(sql: string) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#querysql","p":845},{"i":850,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":845},{"i":853,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":845},{"i":855,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":845},{"i":857,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPoolCluster","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"","p":856},{"i":859,"t":"add(group: string, connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, connectionUri)","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":856},{"i":861,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config)","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":856},{"i":863,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SHA1","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":856},{"i":865,"t":"add(group: string, config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":856},{"i":867,"t":"add(group: string, config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await poolCluster.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { poolCluster.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); atenção Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — RDS SSL","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":856},{"i":869,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#related-links","p":856},{"i":871,"t":"add(group: string, config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { stream: socksProxy, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); Testing poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"add(group, config) — Socks","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":856},{"i":874,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/pt-BR/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":856},{"i":876,"t":"The examples below also work for the execute method.","s":"SELECT","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"","p":875},{"i":878,"t":"query(sql: string) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query(sql); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query(sql, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#querysql","p":875},{"i":880,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":875},{"i":882,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, rowsAsArray: true, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, rowsAsArray: true, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server as array fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options) — Row as Array","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":875},{"i":885,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":875},{"i":887,"t":"index.js 'use strict'; const pool = require('mysql2').createPool({ host: 'localhost', user: 'root', database: 'test', password: 'root', }); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.query((err, rows, fields) => { console.log(rows, fields); // Connection is automatically released once query resolves }); } }, 1000); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.getConnection((err, db) => { db.query('select sleep(0.5) as qqq', (err, rows, fields) => { console.log(rows, fields); db.release(); }); }); } }, 1000);","s":"Pool","u":"/node-mysql2/pt-BR/docs/examples/tests/pool","h":"","p":886},{"i":889,"t":"The examples below also work for the execute method.","s":"UPDATE","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"","p":888},{"i":891,"t":"query(sql: string) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#querysql","p":888},{"i":893,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":888},{"i":896,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":888},{"i":898,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/pt-BR/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":888},{"i":900,"t":"index.js 'use strict'; const mysql = require('mysql2'); const flags = require('mysql2/lib/constants/client.js'); const auth = require('mysql2/lib/auth_41.js'); function authenticate(params, cb) { console.log(params); const doubleSha = auth.doubleSha1('pass123'); const isValid = auth.verifyToken( params.authPluginData1, params.authPluginData2, params.authToken, doubleSha ); if (isValid) { cb(null); } else { // for list of codes lib/constants/errors.js cb(null, { message: 'wrong password dude', code: 1045 }); } } const server = mysql.createServer(); server.listen(3333); server.on('connection', (conn) => { // we can deny connection here: // conn.writeError({ message: 'secret', code: 123 }); // conn.close(); conn.serverHandshake({ protocolVersion: 10, serverVersion: '5.6.10', // 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, // capabilityFlags: 0xffffff, // capabilityFlags: -2113931265, capabilityFlags: 2181036031, authCallback: authenticate, }); conn.on('field_list', (table, fields) => { console.log('FIELD LIST:', table, fields); conn.writeEof(); }); conn.on('query', (query) => { conn.writeColumns([ { catalog: 'def', schema: 'test', table: 'test_table', orgTable: 'test_table', name: 'beta', orgName: 'beta', characterSet: 33, columnLength: 384, columnType: 253, flags: 0, decimals: 0, }, ]); conn.writeTextRow(['test тест テスト փորձարկում পরীক্ষা kiểm tra ']); conn.writeTextRow(['ტესტი પરીક્ષણ מבחן פּרובירן اختبار परीक्षण']); conn.writeEof(); conn.close(); }); });","s":"Server","u":"/node-mysql2/pt-BR/docs/examples/tests/server","h":"","p":899},{"i":902,"t":"index.js 'use strict'; const mysql = require('mysql2'); const ClientFlags = require('mysql2/lib/constants/client.js'); const server = mysql.createServer(); server.listen(3307); server.on('connection', (conn) => { console.log('connection'); conn.serverHandshake({ protocolVersion: 10, serverVersion: 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, capabilityFlags: 0xffffff ^ ClientFlags.COMPRESS, }); conn.on('field_list', (table, fields) => { console.log('field list:', table, fields); conn.writeEof(); }); const remote = mysql.createConnection({ user: 'root', database: 'dbname', host: 'server.example.com', password: 'secret', }); conn.on('query', (sql) => { console.log(`proxying query: ${sql}`); remote.query(sql, function (err) { // overloaded args, either (err, result :object) // or (err, rows :array, columns :array) if (Array.isArray(arguments[1])) { // response to a 'select', 'show' or similar const rows = arguments[1], columns = arguments[2]; console.log('rows', rows); console.log('columns', columns); conn.writeTextResult(rows, columns); } else { // response to an 'insert', 'update' or 'delete' const result = arguments[1]; console.log('result', result); conn.writeOk(result); } }); }); conn.on('end', remote.end.bind(remote)); });","s":"MySQL Proxy","u":"/node-mysql2/pt-BR/docs/examples/tests/mysql-proxy","h":"","p":901},{"i":904,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/procedure-call/row-as-array","h":"","p":903},{"i":906,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/index","h":"","p":905},{"i":908,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/multi-statements","h":"","p":907},{"i":910,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/row-as-array","h":"","p":909},{"i":912,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/pt-BR/docs/examples/typescript/row-data/row-as-array-multi-statements","h":"","p":911},{"i":914,"t":"This section provides answers to commonly asked questions about MySQL2. dica To explore the FAQs, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Frequently Asked Questions","u":"/node-mysql2/pt-BR/docs/faq","h":"","p":913},{"i":916,"t":"O projeto MySQL2 é uma continuação do MySQL-Native. O código do analisador de protocolo (protocol parser) foi reescrito do zero e a API foi alterada para corresponder ao popular mysqljs/mysql. A equipe do MySQL2 está trabalhando em conjunto com a equipe do mysqljs/mysql para fatorar o código compartilhado e movê-lo para a organização mysqljs. O MySQL2 é maioritariamente compatível com a API do mysqljs e suporta a maioria de suas funcionalidades. O MySQL2 também oferece essas funcionalidades adicionais: Desempenho mais rápido / melhor Instruções Preparadas (Prepared Statements) Protocolo de log binário MySQL (MySQL Binary Log Protocol) Servidor MySQL Estende o suporte para Encoding and Collation Promise Wrapper Compressão SSL e Authentication Switch Streams Personalizados Conjunto de Conexões (Pooling)","s":"História e Porque o MySQL2","u":"/node-mysql2/pt-BR/docs/history-and-why-mysq2","h":"","p":915},{"i":918,"t":"The Stability Badges are indications of a section's stability. The stability indices are as follows: 0Deprecated The feature might generate warnings and does not assure backward compatibility. Experimental: These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged. Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features. Experimental features are classified into stages: 1Experimental Experimental features at this stage are currently in development and prone to considerable changes. 1.1Early Development Experimental features at this stage are approaching minimum viability. 1.2Release Candidate Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification. 2Stable Compatibility with the MySQL ecosystem is a high priority. 3Legacy This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available. Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed.","s":"Stability Badges","u":"/node-mysql2/pt-BR/docs/stability-badges","h":"","p":917},{"i":920,"t":"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.","s":"How to handle errors?","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"","p":919},{"i":922,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors by adding an error event listener: const mysql = require('mysql2'); connection = mysql.createConnection({ host: '', user: '', database: '', }); connection.addListener('error', (err) => { if (err instanceof Error) { console.log(`createConnection error:`, err); } }); createPool 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const pool = mysql.createPool({ host: '', user: '', database: '', }); pool.getConnection((err, connection) => { if (err instanceof Error) { console.log('pool.getConnection error:', err); return; } }); createPoolCluster 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); poolCluster.getConnection('NodeI', (err, connection) => { if (err instanceof Error) { console.log('poolCluster.getConnection error:', err); return; } }); execute 2Stable This solution has been tested. Handling execute errors through callback's err parameter: connection.execute('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('execute error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through callback's err parameter: connection.query('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('query error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using callbacks","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":919},{"i":924,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: '', user: '', database: '', }); } catch (err) { if (err instanceof Error) { console.log(err); } } createPool 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const pool = mysql.createPool({ host: '', user: '', database: '', }); try { const connection = await pool.getConnection(); } catch (err) { if (err instanceof Error) { console.log(err); } } createPoolCluster 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); try { await poolCluster.getConnection('NodeI'); } catch (err) { if (err instanceof Error) { console.log('createConnection error:', err); } } execute 2Stable This solution has been tested. Handling execute errors through try-catch block: try { const [rows] = await connection.execute('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('execute error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through try-catch block: try { const [rows] = await connection.query('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('query error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using promises","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#using-promises","p":919},{"i":926,"t":"Discussions #1998 #2282","s":"Related Links","u":"/node-mysql2/pt-BR/docs/faq/how-to-handle-errors","h":"#related-links","p":919},{"i":928,"t":"index.ts db.ts /** * The types are explicity for learning purpose */ import { PoolOptions } from 'mysql2/promise'; import { MySQL } from './db.js'; interface User extends RowDataPacket { id: number; name: string; } const access: PoolOptions = { host: '', user: '', password: '', database: '', }; (async () => { const mysql = new MySQL(access); /** Deleting the `users` table, if it exists */ await mysql.queryResult('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await mysql.queryResult( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await mysql.executeResult( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await mysql.queryRows( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user: User) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await mysql.connection.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */ /** * The types are explicity for learning purpose */ import { createPool, PoolOptions, Pool, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; export class MySQL { private conn: Pool; private credentials: PoolOptions; constructor(credentials: PoolOptions) { this.credentials = credentials; this.conn = createPool(this.credentials); } /** A random method to simulate a step before to get the class methods */ private ensureConnection() { if (!this?.conn) this.conn = createPool(this.credentials); } /** For `SELECT` and `SHOW` */ get queryRows() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get queryRowsAsArray() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get queryResult() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get queryResults() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` */ get executeRows() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get executeRowsAsArray() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get executeResult() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get executeResults() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** Expose the Pool Connection */ get connection() { return this.conn; } }","s":"Basic Custom Class","u":"/node-mysql2/pt-BR/docs/examples/typescript/basic-custom-class","h":"","p":927},{"i":930,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user.id); console.log('name:', user.name); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet","u":"/node-mysql2/pt-BR/docs/examples/typescript/procedure-call/index","h":"","p":929}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/622",[0,4.11,1,1.805,2,0.63,3,4.019,4,4.019,5,3.726,6,2.933,7,4.636,8,1.376,9,4.745,10,7.149,11,4.523,12,3.438,13,3.24,14,4.019,15,2.933,16,3.686,17,5.546,18,6.243,19,4.859,20,1.614,21,4.523,22,4.523,23,4.523,24,5.087,25,4.523,26,3.438,27,3.438,28,4.523,29,4.019,30,2.7,31,4.523,32,3.438,33,4.523,34,4.523,35,4.523,36,4.019,37,4.523,38,2.601,39,4.019,40,4.523,41,3.726,42,4.523,43,3.438,44,4.019,45,4.523,46,1.484,47,3.438,48,3.24,49,4.523,50,4.019,51,4.523,52,3.438,53,4.523,54,4.019,55,4.523,56,4.523,57,3.075,58,4.019,59,4.523,60,4.523,61,4.523]],["t/624",[0,4.519,2,0.693,5,3.259,6,3.541,7,3.541,8,1.363,30,3.259,36,4.851,41,4.963,52,5.382,62,4.45,63,5.461,64,5.461,65,5.461,66,4.851,67,5.461,68,5.461,69,5.461,70,1.721,71,2.401,72,4.45,73,5.461,74,5.461,75,5.461,76,6.292,77,5.461,78,2.84,79,5.461,80,5.461,81,3.911,82,3.712,83,5.461,84,5.461,85,5.461,86,2.932,87,4.851,88,5.461]],["t/626",[0,3.96,1,2.748,19,4.682,38,3.96,89,6.888,90,6.888,91,6.12,92,6.888,93,6.888,94,6.888,95,4.933,96,6.888,97,5.613,98,6.888]],["t/628",[99,6.828,100,7.172,101,1.209,102,5.845,103,3.618,104,7.172,105,7.172,106,5.451]],["t/630",[107,5.223,108,7.293,109,5.543,110,6.479,111,4.957,112,7.293,113,7.293]],["t/632",[1,2.704,2,0.361,7,3.777,44,3.64,99,6.603,102,3.339,106,3.114,109,4.427,114,5.825,115,5.825,116,4.097,117,6.021,118,4.097,119,5.825,120,5.825,121,3.029,122,2.067,123,2.274,124,4.097,125,4.097,126,1.951,127,5.523,128,5.825,129,4.097,130,5.286,131,5.825,132,4.097,133,4.097,134,4.097,135,5.61,136,5.175,137,1.835,138,4.097,139,3.64,140,4.097,141,3.64,142,2.785,143,4.097,144,4.097,145,4.097,146,4.097,147,4.097,148,3.64,149,4.747,150,2.938,151,2.131,152,2.785,153,3.64,154,1.562,155,5.825,156,4.097,157,4.097,158,4.097,159,3.64,160,3.64,161,4.097,162,4.097,163,4.097,164,3.114,165,3.339,166,4.097,167,4.097,168,4.097,169,4.097,170,3.64,171,2.934,172,3.64,173,3.339]],["t/634",[101,1.009,102,4.879,122,3.02,148,5.319,149,4.879,164,4.55,165,4.879,174,2.446,175,5.877,176,5.987,177,3.323,178,5.319,179,7.29,180,4.879,181,5.319,182,5.319,183,6.12,184,5.987,185,5.987,186,6.672,187,5.987,188,5.987,189,5.987,190,5.319,191,5.987,192,3.719,193,5.987]],["t/636",[2,0.787,126,1.901,142,6.164,154,2.163,175,5.199,183,4.624,194,6.413,195,5.675,196,5.241,197,2.702,198,5.041,199,4.624,200,3.047,201,5.675,202,1.559,203,5.675,204,5.675,205,5.041,206,5.916,207,3.525,208,4.624,209,5.675]],["t/638",[2,0.753,103,2.959,126,1.965,151,3.051,154,2.236,175,4.201,183,4.78,202,1.612,206,6.625,207,3.643,208,4.78,210,7.588,211,5.211,212,5.211,213,5.866,214,5.866,215,7.414,216,5.866,217,2.287,218,4.458,219,3.051,220,1.742,221,5.866,222,5.866,223,2.515,224,4.425]],["t/640",[2,0.731,101,1.03,154,2.33,164,5.783,175,5.449,179,6.76,186,6.76,190,5.431,202,1.68,207,3.797,208,4.982,225,7.922,226,6.113,227,6.113,228,4.982,229,2.759,230,3.797,231,4.982,232,4.378,233,5.431]],["t/642",[2,0.786,154,2.525,202,1.821,234,8.584,235,6.626,236,6.626,237,6.626,238,6.626,239,6.626,240,6.626,241,6.626,242,6.626,243,6.626,244,6.626]],["t/644",[57,4.502,99,4.021,122,2.489,127,6.994,130,6.147,164,3.75,175,3.534,177,2.739,245,1.555,246,5.355,247,6.623,248,5.884,249,6.623,250,4.934,251,4.934,252,7.991,253,6.512,254,7.991,255,7.991,256,1.28,257,4.383,258,4.934,259,4.934,260,6.623,261,6.623,262,3.75,263,6.623,264,4.934,265,4.934,266,1.437,267,3.534,268,4.383,269,4.934]],["t/646",[1,2.849,6,3.586,7,5.127,8,1.665,54,4.913,57,3.759,71,2.432,78,2.876,86,2.969,137,1.743,150,2.79,151,2.876,180,5.819,212,4.913,253,4.507,270,5.53,271,4.507,272,5.53,273,4.507,274,5.53,275,4.913,276,5.53,277,4.507,278,3.435,279,3.961,280,4.913,281,3.586,282,2.634,283,2.563,284,3.07,285,4.507,286,3.961,287,4.203,288,5.53,289,4.203,290,4.507,291,3.586]],["t/648",[1,2.985,150,3.774,154,2.851,246,5.358]],["t/650",[2,0.651,16,4.748,20,2.634,81,5.287,107,4.173,126,2.473,177,4.098,200,3.963,202,1.601,246,4.173,273,4.748,292,7.383,293,5.827,294,5.827,295,4.748,296,5.827,297,5.177,298,4.173,299,5.827,300,4.428,301,1.403,302,5.827,303,5.177,304,3.477,305,5.827,306,2.499,307,5.827,308,5.827,309,5.177,310,5.827]],["t/652",[7,5.355,8,1.664,86,4.433,87,5.393,111,4.126,137,1.913,149,4.947,282,2.891,283,2.813,291,4.912,311,6.071,312,5.393,313,5.393,314,6.73,315,6.071,316,5.393,317,6.071,318,7.575,319,7.575,320,6.071]],["t/654",[7,4.539,8,1.347,110,6.218,127,6.731,130,5.013,154,2.668,321,6.999,322,8.786,323,1.851]],["t/656",[5,3.701,8,1.193,15,4.021,30,3.701,38,3.565,41,3.701,62,5.053,78,3.225,86,3.329,95,4.441,111,4.215,278,3.851,282,2.953,283,2.873,289,4.713,290,6.255,291,4.021,324,6.201,325,5.053,326,4.713,327,6.201,328,4.713,329,6.201,330,5.509,331,5.509,332,5.509,333,4.441]],["t/658",[0,3.263,1,3.194,13,4.064,30,4.332,38,3.263,43,4.313,50,5.041,109,6.084,130,5.733,141,5.041,309,5.041,334,4.624,335,5.675,336,5.675,337,5.675,338,4.064,339,5.041,340,5.675,341,5.675,342,5.675,343,4.624,344,5.675,345,5.675,346,5.916,347,6.523,348,5.041,349,5.041,350,5.675,351,4.064,352,5.041,353,5.675]],["t/660",[0,3.417,2,0.842,5,2.516,8,0.811,13,3.019,26,3.204,30,1.591,32,3.204,38,1.532,41,3.547,82,2.865,86,2.263,95,1.909,97,3.435,121,2.192,197,2.83,202,0.732,229,2.682,245,1.328,282,1.269,283,1.235,284,1.479,323,1.115,326,2.026,333,1.909,351,3.019,354,2.172,355,4.256,356,0.513,357,2.172,358,2.172,359,3.745,360,1.728,361,3.745,362,0.951,363,3.204,364,3.435,365,3.435,366,0.971,367,0.858,368,1.168,369,1.643,370,1.643,371,2.424,372,0.996,373,1.355,374,2.456,375,1.633,376,3.547,377,2.167,378,1.991,379,2.613,380,3.191,381,2.487,382,4.843,383,3.745,384,3.745,385,3.745,386,3.204,387,1.643,388,3.745,389,3.435,390,3.745,391,1.136,392,1.279,393,1.034,394,4.215,395,4.215,396,4.215,397,3.435,398,0.931,399,1.643]],["t/662",[0,3.82,1,1.432,2,0.801,5,2.727,8,0.879,12,3.473,13,3.272,15,1.416,19,1.484,24,1.779,26,2.728,27,1.659,30,3.49,32,2.728,38,2.627,41,3.965,43,1.659,47,3.473,48,3.79,52,1.659,70,1.131,82,2.439,95,3.79,97,2.925,121,1.866,197,1.709,202,0.6,207,1.356,245,1.131,266,1.33,282,2.785,283,2.913,284,1.212,323,0.577,326,4.022,333,1.564,334,2.925,338,2.57,339,1.94,343,1.779,351,2.57,354,1.779,355,3.79,356,0.691,357,1.779,358,1.779,360,1.416,362,0.779,363,2.728,364,2.925,365,2.925,366,0.793,367,0.73,368,0.802,369,1.399,370,1.399,371,2.063,372,0.848,373,1.154,374,1.888,375,1.454,377,1.309,378,1.202,379,1.578,381,1.502,382,4.313,383,3.188,384,3.188,385,3.188,386,2.728,387,1.399,388,3.188,389,2.925,390,3.188,391,0.589,392,0.772,393,0.536,398,0.763,399,0.851,400,2.728,401,2.183,402,2.183,403,2.183,404,1.94,405,4.569,406,3.188,407,2.183,408,3.188,409,1.779,410,2.183,411,2.183,412,3.188,413,3.188,414,2.183,415,2.183,416,1.779,417,2.183,418,2.183,419,2.183,420,2.183,421,2.183,422,2.183,423,2.183,424,3.188,425,2.183,426,4.569,427,2.183,428,3.589,429,2.183,430,2.183,431,1.779,432,1.779,433,2.183,434,5.292,435,1.94,436,2.183,437,3.589,438,3.589,439,1.927,440,3.589,441,2.728,442,3.589,443,3.589,444,2.183,445,2.183,446,2.183,447,2.183,448,2.183,449,2.183,450,1.659,451,1.564,452,2.183,453,1.94,454,2.183]],["t/664",[0,4.27,2,0.804,5,2.363,8,0.762,9,3.547,12,3.009,14,4.146,15,2.567,17,2.698,19,1.215,27,3.547,30,2.363,32,3.974,38,3.006,41,4.432,43,3.547,47,2.308,48,2.835,71,3.265,82,5.144,91,2.698,121,1.58,197,1.446,202,0.491,219,2.427,245,0.957,273,1.457,284,2.198,306,2.001,323,0.473,333,1.281,334,3.226,338,2.175,351,2.175,352,2.698,354,1.457,355,2.835,356,0.762,357,1.457,358,1.457,360,2.567,362,0.638,363,3.009,366,0.784,367,0.364,368,0.884,370,1.184,371,1.746,372,0.718,373,0.977,375,1.282,386,1.359,391,0.482,392,0.852,393,0.439,398,0.625,399,0.697,400,1.359,408,1.589,409,2.475,431,1.457,435,1.589,453,3.517,455,2.698,456,5.198,457,1.589,458,1.788,459,1.788,460,1.788,461,1.788,462,1.788,463,1.788,464,1.788,465,1.457,466,1.589,467,1.788,468,3.959,469,1.788,470,1.788,471,1.788,472,1.788,473,1.788,474,1.788,475,1.788,476,1.788,477,1.788,478,1.788,479,1.444,480,3.037,481,3.037,482,3.037,483,3.037,484,1.631,485,3.037,486,4.667,487,3.026,488,3.037,489,3.037,490,4.667,491,4.146,492,2.475,493,3.037,494,4.667,495,2.059,496,3.037,497,3.037,498,3.037,499,3.037,500,1.788,501,1.788,502,1.589,503,1.788,504,1.788,505,1.788,506,1.788,507,1.788,508,1.788,509,1.788,510,4.667,511,4.667,512,1.039,513,2.698,514,3.037,515,3.037,516,3.037,517,1.788,518,1.067,519,1.788,520,1.788,521,1.788,522,1.788,523,1.241,524,1.16,525,3.037,526,2.475,527,3.037,528,3.959,529,3.037,530,3.037,531,1.215,532,1.788,533,1.457,534,1.589]],["t/666",[0,4.552,1,2.431,2,0.826,5,2.283,6,1.531,8,1.067,12,1.795,15,1.531,19,1.605,38,1.358,41,3.636,48,2.74,58,2.098,71,3.02,82,3.278,86,1.268,101,0.398,121,2.884,122,1.93,197,1.822,202,1.524,220,1.136,245,1.747,284,4.468,325,1.924,332,2.098,338,2.74,355,2.74,356,0.454,361,3.399,362,1.365,363,3.665,364,3.93,365,3.93,366,1.108,367,0.982,368,1.457,369,1.88,370,2.162,371,3.188,372,1.31,373,1.959,375,1.524,377,1.395,378,1.282,379,1.682,398,0.825,399,1.88,400,2.908,424,2.098,431,1.924,439,2.054,456,1.924,484,1.268,491,2.098,492,1.924,502,2.098,512,1.65,523,1.563,533,1.924,535,2.361,536,2.361,537,2.361,538,2.773,539,3.399,540,3.826,541,3.826,542,2.361,543,2.361,544,2.361,545,2.361,546,2.361,547,3.826,548,2.361,549,2.361,550,6.093,551,2.361,552,1.924,553,3.826,554,1.605,555,2.098,556,2.361,557,1.691,558,2.361,559,2.361,560,2.361,561,2.361,562,2.361,563,2.361,564,2.361,565,2.098,566,1.094,567,2.361,568,1.467]],["t/668",[0,2.478,2,0.783,5,1.636,7,1.777,8,0.527,9,2.083,13,1.963,15,1.777,19,1.863,24,2.234,26,2.083,27,2.083,38,1.576,39,2.435,41,4.743,47,5.295,48,3.814,52,2.083,70,1.358,82,1.863,121,2.241,218,3.275,220,1.581,223,2.283,245,1.358,253,3.512,284,2.392,306,2.588,323,0.725,338,3.086,343,2.234,351,1.963,355,4.7,356,0.527,360,2.794,366,0.798,367,0.558,368,0.963,369,1.68,370,1.68,371,2.478,372,1.018,373,1.386,374,2.154,375,1.658,377,1.942,381,1.803,382,3.512,387,1.68,391,0.739,392,0.928,393,0.672,399,1.069,404,2.435,406,6.474,409,2.234,416,3.512,457,3.828,465,3.512,466,3.828,492,2.234,523,1.76,526,3.512,533,4.339,569,2.741,570,2.741,571,2.741,572,2.741,573,2.741,574,2.741,575,4.526,576,2.741,577,2.741,578,2.741,579,2.741,580,5.295,581,2.741,582,2.741,583,2.741,584,4.309,585,4.309,586,2.741,587,2.741,588,2.741,589,3.914,590,4.309,591,4.309,592,4.309,593,2.741,594,2.741,595,2.435,596,2.741,597,2.741,598,2.741,599,2.741,600,2.741,601,2.741]],["t/670",[2,0.815,6,1.456,86,2.501,101,0.619,123,1.246,126,1.988,137,1.696,154,0.856,171,1.608,196,1.395,230,1.395,245,1.157,256,1.653,275,3.262,278,1.395,281,1.456,284,1.246,286,2.63,287,3.541,295,1.83,300,2.791,301,1.429,304,2.781,306,0.963,360,1.456,366,0.89,367,1.095,369,1.432,372,0.868,373,1.181,378,1.23,392,0.483,399,2.622,523,1.5,602,2.245,603,2.245,604,1.995,605,2.245,606,4.386,607,1.256,608,4.139,609,1.972,610,0.94,611,3.797,612,2.988,613,2.245,614,5.717,615,4.25,616,0.784,617,3.797,618,2.245,619,2.245,620,2.506,621,1.995,622,2.245,623,4.659,624,4.386,625,6.724,626,1.707,627,3.262,628,1.995,629,2.245,630,2.245,631,2.245,632,1.83,633,2.245,634,2.245,635,4.659,636,2.245,637,3.262,638,2.429,639,3.262,640,2.245,641,2.245,642,4.563,643,3.672,644,3.672,645,4.139,646,2.993,647,1.83,648,1.83,649,3.672,650,3.672,651,3.672,652,1.707,653,4.659,654,3.672,655,1.608,656,1.608,657,2.245,658,5.382,659,1.83,660,2.245,661,2.245,662,2.245,663,2.245,664,2.245,665,1.83,666,2.245,667,1.83,668,1.83,669,2.245,670,2.245,671,2.245,672,1.995,673,3.672,674,1.83,675,1.995,676,1.707,677,1.707,678,1.995,679,2.245,680,2.245,681,1.995,682,2.381,683,1.707,684,2.245,685,1.608,686,1.995,687,1.995,688,1.995]],["t/672",[2,0.831,86,2.036,101,0.639,103,1.913,126,1.271,137,1.195,139,3.37,281,3.574,286,5.102,287,2.883,301,1.9,304,2.264,366,0.569,367,0.772,369,1.479,372,1.302,373,1.22,378,1.271,399,3.078,523,1.549,606,5.289,608,3.37,611,3.091,614,4.491,615,3.947,617,3.091,620,2.054,637,3.37,638,2.929,639,3.37,672,3.37,674,3.091,682,2.46,685,3.947,686,3.37,687,3.37,689,3.793,690,6.491,691,3.793,692,3.091,693,3.793,694,3.793,695,1.549,696,1.587,697,6.491,698,6.491,699,3.37,700,3.793,701,3.793,702,3.793,703,3.793,704,5.511,705,3.793,706,7.894,707,3.793,708,3.793,709,3.793,710,3.793,711,3.793]],["t/675",[2,0.849,8,0.633,86,1.767,101,0.836,103,1.66,126,1.102,137,1.037,220,2.519,223,1.411,266,1.444,280,2.924,282,1.567,283,1.525,291,2.134,297,2.924,301,0.792,304,1.964,306,1.411,356,0.955,377,2.424,378,2.227,392,1.431,397,5.417,512,2.44,554,2.237,575,3.081,609,1.767,610,1.377,616,2.322,628,2.924,682,3.217,683,4.538,696,2.076,712,3.872,713,2.682,714,3.291,715,5.971,716,3.291,717,2.924,718,4.407,719,2.357,720,3.291,721,4.043,722,8.009,723,4.961,724,8.195,725,3.291,726,4.407,727,2.924]],["t/677",[2,0.833,70,1.836,126,1.952,159,5.177,306,2.499,366,0.873,374,2.634,375,2.341,377,2.125,392,1.254,441,4.428,555,5.177,575,4.585,580,4.428,589,3.778,616,2.976,728,5.827,729,5.827,730,5.827]],["t/679",[2,0.821,8,0.621,70,1.86,101,0.544,117,7.075,123,1.793,126,1.977,135,2.455,137,1.018,160,6.613,165,6.066,171,2.313,196,2.006,197,2.811,218,2.455,233,4.345,245,2.229,256,1.269,281,2.094,301,1.421,316,2.869,356,1.136,366,1.061,367,0.995,369,1.259,372,0.763,373,1.038,375,1.344,376,3.523,398,1.128,399,1.907,609,2.626,620,2.454,621,5.85,642,2.313,646,3.986,648,2.632,685,2.313,696,1.351,712,3.172,727,2.869,731,4.891,732,3.828,733,7.444,734,3.23,735,2.006,736,3.23,737,6.584,738,2.869,739,1.734,740,2.313,741,5.903,742,4.891,743,2.919,744,3.23,745,3.23,746,3.23,747,3.23,748,3.23,749,3.23,750,3.23,751,2.869,752,2.869,753,3.23,754,3.23,755,3.23]],["t/681",[2,0.813,8,1.06,71,2.854,101,1.094,107,2.717,123,3.603,126,1.271,154,1.446,217,1.479,245,2.045,279,2.717,281,2.46,366,1.251,367,1.54,369,1.479,370,2.149,371,2.181,372,1.302,373,1.772,374,1.354,398,1.925,399,2.531,479,1.383,484,2.036,487,2.46,580,2.883,638,2.929,655,2.717,665,3.091,667,3.091,685,2.717,726,3.37,732,4.907,756,3.37,757,3.793,758,3.793,759,3.793,760,3.793,761,3.793,762,3.793,763,3.793,764,3.793,765,3.793,766,2.181,767,3.793,768,5.511,769,3.37,770,3.793,771,4.896,772,4.188,773,2.883,774,3.37,775,5.511,776,3.793,777,3.169,778,2.356,779,3.793,780,1.414,781,3.37,782,3.793,783,2.883,784,3.793,785,3.793]],["t/684",[2,0.612,122,3.503,137,2.188,554,4.719,557,4.973,777,3.992,786,6.943,787,6.943,788,5.277,789,6.943,790,6.943,791,6.943,792,6.943]],["t/686",[123,4.153,367,1.747,793,7.481]],["t/688",[2,0.663,86,3.583,135,3.793,137,1.573,198,4.434,267,3.574,289,3.793,291,3.236,356,0.96,360,3.236,374,2.382,375,2.066,376,2.978,512,2.283,554,3.392,575,3.1,616,1.743,642,3.574,645,5.929,646,6.128,788,3.793,794,4.991,795,4.067,796,4.067,797,4.067,798,5.439,799,4.067,800,4.067,801,4.991,802,7.133,803,4.991,804,4.991,805,3.392,806,6.674,807,3.392,808,4.434,809,4.991,810,6.674,811,4.991,812,7.52,813,4.991,814,4.991,815,4.991,816,4.991]],["t/690",[20,2.852,86,2.649,137,2.087,150,2.489,200,2.649,230,3.065,267,5.723,281,3.199,301,1.924,367,1.004,375,1.356,617,5.398,656,3.534,681,4.383,712,3.199,788,5.034,802,7.406,808,5.884,817,6.623,818,5.398,819,4.934,820,4.934,821,4.383,822,4.383,823,4.934,824,4.934,825,4.934,826,4.934,827,4.934,828,4.934,829,4.934,830,4.934,831,6.793,832,3.534,833,4.934,834,3.534,835,4.934,836,4.934,837,4.934,838,4.934,839,4.934]],["t/692",[6,4.651,281,4.651,284,3.981,285,5.845,552,5.845,840,7.172,841,4.281,842,7.172,843,6.372]],["t/694",[2,0.846,8,1.251,71,2.858,248,4.262,256,1.245,284,2.663,301,1.155,328,3.647,356,0.923,366,1.105,367,0.977,375,1.318,393,1.177,534,4.262,554,3.261,565,4.262,580,4.94,647,3.91,683,4.94,712,3.111,774,5.774,780,2.423,844,4.798,845,4.798,846,3.91,847,4.798,848,6.5,849,5.774,850,4.798,851,4.798,852,4.798,853,4.798,854,4.798,855,4.655,856,4.798,857,4.798,858,4.798]],["t/696",[2,0.827,8,1.279,29,4.408,71,2.182,103,2.503,223,2.851,245,2.095,266,1.445,366,1.252,368,1.866,369,1.935,373,2.138,375,1.363,399,2.592,484,2.664,512,1.697,513,5.907,523,2.027,538,3.823,568,3.082,766,2.853,846,5.418,859,4.962,860,4.408,861,4.962,862,4.408,863,4.408,864,5.907,865,4.408,866,4.962,867,4.962,868,4.962,869,4.408]],["t/698",[2,0.823,8,1.078,121,2.913,154,2.135,306,2.402,366,1.259,368,1.251,372,1.323,373,1.801,398,1.957,441,4.257,487,3.632,512,1.916,566,2.596,632,6.483,713,4.565,870,6.396,871,4.976,872,4.976,873,5.601,874,4.976,875,4.976,876,4.976,877,4.976,878,3.632,879,4.976,880,4.976,881,5.601]],["t/701",[2,0.851,101,0.791,171,3.362,220,2.325,277,3.825,278,2.916,282,3.05,283,3.377,374,2.924,376,2.802,377,2.335,392,1.01,439,2.52,451,5.869,512,2.19,624,3.825,656,3.362,678,4.17,692,3.825,721,3.825,832,3.362,855,3.362,882,4.17,883,4.694,884,4.694,885,4.694,886,4.694,887,4.17,888,3.568,889,4.17,890,4.694,891,4.694]],["t/703",[2,0.836,101,1.246,103,2.077,107,2.948,123,2.285,152,3.972,171,4.186,200,2.21,218,3.129,223,2.506,245,1.842,282,2.783,283,3.76,291,2.669,298,2.948,360,2.669,367,1.383,374,2.086,392,1.258,450,3.129,451,2.948,512,1.408,575,3.63,611,3.355,719,2.948,781,3.657,822,3.657,832,4.186,889,5.192,892,4.116,893,4.116,894,5.844,895,4.116,896,4.116,897,6.037,898,5.844,899,4.116,900,4.116,901,4.116,902,4.116,903,3.657,904,4.116,905,4.116,906,4.116,907,4.116,908,2.285,909,4.116,910,2.669,911,4.116,912,4.116,913,4.116,914,4.116,915,2.557]],["t/705",[2,0.593,101,1.134,126,2.254,271,5.483,283,3.738,450,5.114,451,6.188,675,5.978,831,5.483,832,4.819,916,6.728,917,6.728,918,6.728,919,6.728]],["t/707",[2,0.809,8,1.085,173,4.594,200,3.027,219,2.932,220,1.674,256,1.463,266,1.641,303,6.422,306,2.418,314,5.009,374,2.012,399,2.198,610,3.025,616,1.969,627,5.009,712,3.656,821,5.009,920,5.638,921,5.009,922,6.422,923,5.638,924,5.638,925,4.285,926,5.638,927,5.009,928,5.638,929,7.229,930,7.229,931,5.638]],["t/709",[1,1.75,2,0.839,103,4.035,220,2.375,266,1.277,282,3.349,283,2.832,298,3.142,356,0.844,375,2.276,377,2.565,392,1.514,393,1.725,432,4.98,439,3.776,512,2.833,607,1.5,696,1.835,878,4.933,887,3.897,922,6.248,932,3.897,933,7.607,934,7.607]],["t/711",[150,3.71,151,3.825,152,4.999,154,2.803,282,3.502,283,3.408]],["t/714",[1,3.063,46,2.035,101,1.045,109,5.834,111,4.215,130,5.497,346,6.255,347,6.255,348,5.509,349,6.819,685,4.441,688,5.509,732,4.021,756,5.509,818,5.053,935,6.201,936,6.201,937,6.201,938,6.201,939,4.713,940,4.441,941,6.201]],["t/716",[1,3.326,2,0.677,8,1.676,126,2.571,202,2.46,306,2.659,362,2.739,609,4.121,925,4.713,942,6.201,943,6.201,944,7.676,945,7.676]],["t/718",[1,2.624,2,0.816,8,1.265,202,1.807,245,2.507,366,1.193,372,1.554,373,2.114,523,2.686,739,3.53,946,3.898,947,4.264]],["t/720",[1,2.624,2,0.816,8,1.265,202,1.807,245,2.507,366,1.193,372,1.554,373,2.114,523,2.686,739,3.53,948,4.014,949,6.576]],["t/722",[2,0.851,107,3.68,154,1.958,177,3.777,220,2.411,223,2.918,245,2.559,246,3.68,298,3.68,356,0.989,359,3.68,512,2.89,674,4.187,849,4.565,860,4.565,950,4.625,951,4.227,952,3.653,953,2.144,954,3.68]],["t/725",[1,2.086,2,0.86,8,1.006,101,0.595,126,1.183,154,1.346,197,2.49,202,1.437,220,2.044,223,2.952,224,2.108,245,2.749,301,0.85,306,2.242,366,0.784,369,2.039,372,1.235,373,1.681,377,2.271,512,2.857,523,2.136,566,3.19,575,2.193,589,3.391,950,4.679,952,2.807,955,3.531,956,3.391,957,5.229,958,3.531,959,3.531,960,2.108]],["t/727",[1,1.969,2,0.853,8,0.949,70,1.555,101,0.831,126,1.653,202,1.356,220,1.966,223,3.206,224,2.945,245,2.704,306,2.84,356,0.949,366,0.993,369,1.924,372,1.166,373,1.586,377,2.415,512,2.265,523,2.015,566,2.286,682,3.199,950,3.354,952,2.649,960,2.945,961,4.295,962,4.934]],["t/729",[1,1.777,2,0.827,8,0.857,46,1.462,70,1.403,101,1.041,126,1.492,142,3.027,150,3.116,194,3.385,196,2.766,202,1.224,219,4.183,220,1.834,223,1.91,224,2.658,245,1.946,366,0.926,369,1.736,372,1.052,373,1.432,374,2.204,381,1.864,523,1.819,609,2.391,652,4.694,676,4.694,719,4.424,805,4.198,807,3.027,888,4.694,940,3.19,950,3.027,953,2.234,963,3.629,964,3.957,965,5.033,966,3.116,967,4.424,968,2.01,969,2.182,970,2.064,971,3.957,972,4.454,973,3.19,974,3.19,975,3.19]],["t/731",[1,1.69,2,0.838,8,0.815,46,1.957,70,1.335,101,0.714,142,2.88,194,3.22,196,2.632,202,1.164,219,4.604,220,1.771,223,2.96,224,2.529,245,1.88,306,2.558,366,0.894,369,1.652,372,1.001,373,1.362,374,2.128,381,1.773,487,2.747,523,1.731,609,3.202,682,2.747,805,4.054,807,4.054,940,3.034,950,2.88,953,2.361,961,3.868,963,3.453,967,4.272,968,1.912,969,2.076,970,1.963,971,3.764,973,4.272,974,4.272,975,4.272,976,3.764,977,4.237]],["t/733",[1,1.456,2,0.83,8,0.702,46,1.198,70,1.15,101,0.903,122,2.703,142,2.481,150,1.841,151,1.898,154,1.391,194,2.774,196,2.267,202,1.003,207,2.267,219,3.875,220,1.591,223,2.722,224,2.178,245,1.688,271,2.974,278,3.328,301,1.29,306,1.565,356,1.031,366,0.803,369,1.423,372,0.862,373,1.174,374,2.265,377,1.331,381,1.527,518,2.178,523,1.491,526,2.974,609,3.408,624,5.174,659,2.974,682,2.367,740,2.614,805,2.481,807,2.481,831,2.974,940,2.614,950,2.481,952,1.96,953,2.454,954,4.547,956,2.367,961,2.367,963,2.974,967,2.614,968,1.647,969,1.788,973,2.614,974,2.614,975,2.614,976,3.243,978,6.347,979,3.65,980,3.65,981,3.65,982,6.348,983,2.974,984,3.65,985,3.65,986,5.358]],["t/735",[101,1.189,150,3.559,652,5.363,676,5.363,719,5.054,888,5.363,953,2.223,964,6.269,965,5.75,966,3.559,987,6.269]],["t/737",[1,2.803,72,4.395,101,1.51,122,2.721,154,2.056,230,3.35,246,5.595,346,4.395,769,4.791,841,5.252,952,4.724,953,2.214,954,5.031,961,4.555,988,5.393,989,5.393,990,5.393,991,5.059,992,6.941,993,5.393]],["t/739",[101,1.179,150,3.531,154,2.668,207,4.347,739,3.758,994,6.218,995,6.218,996,6.218,997,6.218,998,6.218,999,6.218,1000,6.218]],["t/741",[8,1.758,70,1.848,86,3.98,101,1.249,137,2.562,181,5.211,367,1.509,771,7.222,921,5.211,1001,5.866,1002,5.866,1003,5.866,1004,5.866,1005,5.866,1006,7.414,1007,5.866,1008,5.866,1009,7.414,1010,5.866,1011,5.866,1012,5.866]],["t/743",[46,2.354,150,3.618,151,3.73,154,2.734,282,3.416,283,3.324,356,1.612,359,5.137]],["t/745",[2,0.836,8,1.289,20,1.791,71,2.946,101,0.846,202,1.379,256,1.303,301,1.208,323,1.328,356,1.289,362,1.791,366,1.206,367,1.535,368,1.121,391,1.353,392,1.623,393,1.643,398,1.753,524,3.255,531,3.412,908,2.786,966,2.532,1013,5.019,1014,1.52,1015,1.52,1016,6.7,1017,4.336,1018,1.49,1019,2.886,1020,2.886,1021,2.886,1022,3.595]],["t/747",[2,0.842,8,1.172,71,2.678,101,0.735,121,3.167,202,1.199,245,1.919,256,1.133,301,1.051,323,1.154,356,1.172,362,1.557,366,1.138,367,1.428,368,0.975,370,2.374,371,3.501,372,1.439,373,1.958,391,1.176,392,1.51,393,1.494,398,1.525,484,3.269,524,2.83,531,2.966,638,2.748,777,3.501,778,3.782,908,2.423,948,2.202,966,2.202,1014,1.322,1015,1.322,1017,4.033,1018,1.296,1019,2.509,1020,2.509,1021,2.509,1022,3.126,1023,3.126]],["t/749",[2,0.845,8,1.223,71,2.795,101,0.783,202,1.276,256,1.205,301,1.118,323,1.228,356,1.223,362,1.657,366,1.168,367,1.475,368,1.038,391,1.252,392,1.56,393,1.559,398,1.622,484,3.413,524,3.011,531,3.157,783,4.832,908,2.578,948,2.343,966,2.343,1014,1.406,1015,1.406,1017,4.167,1018,1.379,1019,2.67,1020,2.67,1021,2.67,1022,3.326,1023,3.326,1024,3.785,1025,3.785,1026,5.18,1027,3.785]],["t/751",[2,0.847,8,1.125,71,2.57,78,3.039,101,0.694,151,2.141,202,1.131,256,1.068,301,0.991,323,1.089,356,1.125,362,1.469,366,1.109,367,1.383,368,0.92,391,1.11,392,1.463,393,1.433,398,1.438,484,3.138,524,2.669,531,2.798,612,3.244,908,2.285,948,2.077,966,2.077,1014,1.246,1015,1.246,1017,3.907,1018,1.222,1019,2.367,1020,2.367,1021,2.367,1022,2.948,1023,2.948,1028,3.355,1029,5.31,1030,6.028,1031,4.763,1032,3.488,1033,3.488,1034,4.763,1035,3.355]],["t/753",[2,0.836,8,1.181,20,1.23,71,2.259,78,3.784,101,1.035,202,0.947,245,1.619,256,1.333,279,2.469,301,1.236,323,1.359,356,0.988,362,1.23,366,1.091,367,1.385,368,1.372,370,2.003,391,1.385,392,1.642,393,1.669,398,1.204,399,1.344,484,2.758,524,2.235,531,2.343,616,1.204,655,2.469,855,3.679,869,4.563,908,1.914,948,1.739,966,1.739,1014,1.044,1015,1.044,1017,3.53,1018,1.525,1019,1.982,1020,1.982,1021,1.982,1022,2.469,1023,2.469,1029,2.343,1032,2.057,1033,3.066,1036,4.624,1037,4.624,1038,2.809,1039,2.809,1040,2.809,1041,4.186,1042,4.186,1043,4.186,1044,2.809,1045,4.186,1046,4.186,1047,4.186,1048,2.809]],["t/755",[2,0.738,57,4.245,78,3.248,230,3.879,232,4.473,262,4.747,557,4.473,615,4.473,626,4.747,939,4.747,969,3.777,1032,4.601,1033,3.727,1036,5.24,1037,5.24,1049,5.089,1050,5.089,1051,5.089,1052,5.089,1053,5.089,1054,5.089]],["t/757",[2,0.843,8,1.092,71,2.495,123,3.149,220,1.172,245,1.244,256,1.723,301,1.747,366,1.236,375,2.199,392,1.723,393,1.628,398,1.982,399,1.539,484,3.046,512,2.271,566,3.077,732,3.678,772,5.516,773,4.311,777,3.262,778,3.523,878,3.678,948,1.992,1018,1.971,1023,2.828,1055,3.217,1056,3.217,1057,4.623,1058,3.217,1059,6.639,1060,3.217,1061,3.217,1062,4.623]],["t/760",[126,2.423,946,4.124,948,4.247,991,4.158,1063,3.901]],["t/762",[2,0.82,8,1.294,70,1.591,81,3.616,101,0.851,219,2.626,220,1.997,231,4.114,328,3.837,366,1.134,370,2.622,375,1.387,398,1.764,638,2.278,642,3.616,656,3.616,743,3.013,777,2.903,863,5.975,956,3.274,1064,3.837,1065,3.616,1066,5.049,1067,5.049,1068,5.049,1069,5.049,1070,5.049,1071,4.485,1072,7.563,1073,4.485,1074,5.049,1075,5.049,1076,5.049,1077,5.049,1078,5.049,1079,5.049,1080,5.049,1081,5.049,1082,5.049,1083,5.049,1084,5.049]],["t/764",[2,0.838,8,0.739,30,2.293,70,0.748,71,1.69,101,0.648,106,1.804,121,1.235,123,3.088,135,4.228,152,1.614,153,2.109,172,2.109,173,1.935,178,2.109,182,2.109,196,1.475,205,2.109,220,0.705,245,1.753,256,0.616,267,1.7,284,1.318,306,2.076,323,0.628,366,1.11,367,0.483,368,1.601,369,1.498,372,1.144,373,1.236,375,1.056,378,0.795,391,0.64,392,1.197,393,0.582,399,0.926,441,2.921,484,1.275,487,1.54,512,1.656,538,2.209,539,2.109,566,1.781,614,1.935,632,3.945,638,1.734,647,1.935,648,3.131,656,2.752,713,3.945,740,2.752,751,2.109,766,2.783,777,2.783,778,3.007,846,3.131,862,4.3,864,2.109,865,3.414,870,3.414,871,2.109,872,2.109,874,3.414,875,2.109,876,5.428,877,2.109,878,1.54,879,2.109,880,3.414,927,4.942,1065,2.752,1073,2.109,1085,3.843,1086,2.374,1087,2.374,1088,3.843,1089,3.843,1090,2.109,1091,2.374,1092,2.374,1093,2.374,1094,4.841,1095,4.3,1096,5.563,1097,6.11,1098,5.563,1099,3.843,1100,2.374,1101,2.374,1102,2.374,1103,3.843,1104,2.374,1105,4.841,1106,2.374,1107,3.843,1108,2.374,1109,2.374,1110,2.374,1111,2.374,1112,2.374,1113,2.374,1114,2.374,1115,2.374,1116,2.374,1117,2.374,1118,2.374]],["t/766",[1,2.235,2,0.635,151,2.913,154,2.135,207,3.479,266,2.096,277,4.565,278,3.479,282,4.136,283,3.891,298,4.012,347,4.565,356,1.385,377,2.043,432,5.867,450,4.257,451,4.012,554,3.807,607,1.916,683,4.257,696,2.344,699,4.976,932,4.976,968,2.528,969,2.744,970,2.596,1119,2.596,1120,5.601,1121,5.601,1122,5.601,1123,5.601,1124,4.976]],["t/768",[46,2.354,150,3.618,151,3.73,154,2.734,282,3.416,283,3.324,356,1.612,359,5.137]],["t/770",[2,0.837,8,1.415,20,2.065,202,1.59,323,1.531,362,2.065,366,1.211,367,1.496,368,1.293,369,2.866,391,1.56,392,1.582,393,1.803,398,2.022,1014,1.753,1015,1.753,1125,5.788,1126,6.531,1127,3.753]],["t/772",[2,0.842,8,1.294,121,3.498,202,1.387,245,2.119,323,1.335,362,1.802,366,1.134,367,1.369,368,1.128,369,2.622,370,2.622,371,3.867,372,1.589,373,2.163,391,1.361,392,1.448,393,1.65,398,1.764,638,3.035,777,3.867,778,4.177,946,2.473,1014,1.529,1015,1.529,1127,3.274,1128,3.616]],["t/774",[2,0.846,8,1.357,202,1.491,323,1.435,362,1.936,366,1.175,367,1.436,368,1.212,369,2.75,391,1.463,392,1.518,393,1.73,398,1.896,783,5.361,946,2.658,1014,1.643,1015,1.643,1024,4.422,1025,4.422,1026,5.748,1027,4.422,1127,3.519,1128,3.887]],["t/776",[2,0.848,8,1.237,78,3.343,151,2.455,202,1.297,323,1.248,362,1.684,366,1.096,367,1.308,368,1.054,369,2.506,391,1.272,392,1.383,393,1.576,398,1.649,612,3.568,946,2.312,1014,1.429,1015,1.429,1028,3.846,1029,5.58,1030,6.395,1031,5.238,1032,3.836,1033,3.836,1034,5.238,1035,3.846,1127,3.06,1128,3.38]],["t/778",[2,0.835,8,1.262,20,1.378,78,3.963,101,0.941,202,1.061,245,1.759,256,1.002,279,2.765,301,0.929,323,1.476,362,1.378,366,1.077,367,1.334,368,1.465,369,2.176,370,2.176,391,1.505,392,1.64,393,1.762,398,1.349,399,1.505,616,1.349,655,2.765,855,3.998,946,1.891,1014,1.169,1015,1.169,1018,1.146,1029,2.624,1032,2.304,1033,3.331,1036,4.882,1037,4.882,1038,3.146,1039,3.146,1040,3.146,1041,4.549,1042,4.549,1043,4.549,1044,3.146,1045,4.549,1046,4.549,1047,4.549,1048,3.146,1127,2.503,1128,2.765,1129,5.582]],["t/780",[2,0.738,57,4.245,78,3.248,230,3.879,232,4.473,262,4.747,557,4.473,615,4.473,626,4.747,939,4.747,969,3.777,1032,4.601,1033,3.727,1036,5.24,1037,5.24,1049,5.089,1050,5.089,1051,5.089,1052,5.089,1053,5.089,1054,5.089]],["t/782",[2,0.847,8,1.05,123,3.03,220,1.112,245,1.18,256,1.672,301,1.704,366,1.216,367,1.111,369,2.128,375,2.159,392,1.79,393,1.846,398,1.907,399,1.46,512,2.204,566,2.985,721,5.25,732,3.54,772,5.381,773,4.149,777,3.139,778,3.391,878,3.54,946,1.834,1018,1.913,1055,3.051,1056,3.051,1057,4.449,1058,3.051,1060,3.051,1061,3.051,1062,4.449,1127,3.54,1128,2.682]],["t/785",[946,3.729,1063,3.527]],["t/788",[2,0.828,20,1.462,46,1.344,70,1.835,101,0.69,137,1.291,174,1.674,217,1.597,229,2.628,256,1.063,266,1.696,301,0.986,323,1.084,356,0.788,366,1.169,367,0.834,368,0.915,374,2.418,375,1.862,379,2.561,380,3.127,381,2.437,387,2.271,391,1.104,392,1.459,393,1.429,479,1.494,607,1.401,610,1.714,616,2.912,620,1.527,695,2.379,696,1.714,780,1.527,953,1.291,968,2.628,1014,1.241,1015,1.241,1018,1.216,1119,1.898,1130,3.114,1131,3.127,1132,2.699,1133,4.172,1134,4.427,1135,2.853,1136,1.714,1137,1.714,1138,1.635,1139,1.597]],["t/790",[2,0.841,46,1.278,70,2.273,101,0.656,126,1.882,137,1.227,174,1.591,217,1.519,229,2.535,256,1.011,266,1.636,301,0.938,323,1.03,356,0.75,366,1.146,367,0.793,368,0.87,374,2.351,375,1.81,379,2.47,380,3.016,381,2.351,387,2.19,391,1.05,392,1.418,393,1.378,439,3.016,479,1.42,607,1.332,610,1.63,616,2.783,620,1.452,695,2.295,696,1.63,780,1.452,953,1.227,968,2.535,1014,1.179,1015,1.179,1018,1.156,1119,1.805,1131,3.016,1132,2.603,1133,4.023,1135,2.752,1136,1.63,1137,1.63,1138,1.554,1139,1.519,1140,2.419,1141,1.63]],["t/792",[2,0.843,46,1.261,70,2.259,101,0.648,126,1.864,137,1.211,174,1.57,217,1.499,229,2.511,256,0.997,266,1.62,301,0.925,323,1.017,356,0.74,366,1.14,367,0.782,368,0.859,374,2.334,375,1.797,379,2.447,380,2.987,381,2.328,387,2.169,391,1.036,392,1.408,393,1.365,439,2.987,479,1.402,607,1.315,610,1.608,616,2.857,620,1.433,695,2.273,696,1.608,780,1.433,953,1.211,968,2.511,1014,1.164,1015,1.164,1018,1.141,1119,1.781,1131,2.987,1132,2.578,1133,3.985,1135,2.726,1136,1.608,1137,1.608,1138,1.533,1139,1.499,1140,2.387,1141,1.608]],["t/795",[953,2.399,1063,3.527]],["t/797",[1063,3.527,1141,3.185]],["t/800",[2,0.839,20,1.49,46,1.37,70,1.86,101,0.704,137,1.316,174,1.706,217,1.628,229,2.664,256,1.084,266,1.216,301,1.421,323,1.104,356,0.804,366,1.177,367,0.85,368,0.933,372,1.395,375,1.882,377,2.153,378,1.978,379,2.596,380,3.17,387,2.302,391,1.126,392,1.474,393,1.448,479,1.523,512,2.686,566,2.736,607,1.428,616,2.744,620,1.556,695,2.412,780,1.556,1014,1.264,1015,1.264,1018,1.24,1130,3.174,1134,4.487,1136,1.747,1137,1.747,1138,1.666,1139,1.628]],["t/802",[2,0.847,46,1.302,70,2.292,101,0.668,126,1.906,137,1.25,174,1.62,217,1.546,229,2.568,256,1.029,266,1.155,301,1.37,323,1.049,356,0.763,366,1.154,367,0.807,368,0.886,372,1.345,375,1.829,377,2.075,378,1.906,379,2.503,380,3.055,387,2.219,391,1.069,392,1.433,393,1.396,439,3.055,479,1.446,512,2.634,566,2.637,607,1.357,616,2.541,620,1.478,695,2.325,780,1.478,1014,1.201,1015,1.201,1018,1.178,1136,1.66,1137,1.66,1138,1.582,1139,1.546,1140,2.463,1141,1.66]],["t/804",[2,0.849,46,1.284,70,2.278,101,0.659,126,1.888,137,1.233,174,1.598,217,1.525,229,2.543,256,1.015,266,1.139,301,1.357,323,1.035,356,0.753,366,1.148,367,0.796,368,0.874,372,1.332,375,1.815,377,2.055,378,1.888,379,2.478,380,3.026,387,2.197,391,1.055,392,1.422,393,1.382,439,3.026,479,1.427,512,2.62,566,2.612,607,1.338,616,2.676,620,1.458,695,2.302,780,1.458,1014,1.185,1015,1.185,1018,1.162,1136,1.637,1137,1.637,1138,1.561,1139,1.525,1140,2.43,1141,1.637]],["t/807",[1063,3.527,1141,3.185]],["t/810",[2,0.831,20,1.435,46,1.32,70,1.811,101,0.678,137,1.267,174,1.643,217,1.568,220,1.707,256,1.044,266,1.673,301,0.968,323,1.064,356,0.774,366,1.161,367,0.818,368,0.898,372,1.358,374,2.394,375,1.843,378,1.925,379,2.527,381,2.405,387,2.241,391,1.084,392,1.444,393,1.41,479,1.466,495,2.989,607,1.375,609,3.086,610,1.683,616,2.704,620,1.499,695,2.348,696,1.683,780,1.499,953,1.267,969,2.816,1014,1.218,1015,1.218,1018,1.194,1119,1.863,1130,3.056,1132,2.663,1134,4.368,1135,2.816,1136,1.683,1137,1.683,1138,1.604,1139,1.568,1142,4.116]],["t/812",[2,0.842,46,1.256,70,2.254,101,0.645,126,1.858,137,1.206,174,1.563,217,1.492,220,1.647,256,0.993,266,1.615,301,0.921,323,1.012,356,0.736,366,1.138,367,0.779,368,0.855,372,1.31,374,2.328,375,1.792,378,1.858,379,2.439,381,2.321,387,2.162,391,1.032,392,1.404,393,1.36,439,2.978,479,1.395,495,2.884,607,1.309,609,2.978,610,1.601,616,2.499,620,1.426,695,2.265,696,1.601,780,1.426,953,1.206,969,2.717,1014,1.159,1015,1.159,1018,1.136,1119,1.773,1132,2.57,1135,2.717,1136,1.601,1137,1.601,1138,1.527,1139,1.492,1140,2.377,1141,1.601,1142,3.972]],["t/814",[2,0.844,46,1.239,70,2.24,101,0.636,126,1.84,137,1.19,174,1.543,217,1.472,220,1.631,256,0.98,266,1.599,301,0.909,323,0.999,356,0.727,366,1.132,367,0.769,368,0.844,372,1.298,374,2.31,375,1.779,378,1.84,379,2.416,381,2.299,387,2.142,391,1.018,392,1.394,393,1.347,439,2.949,479,1.377,495,2.857,607,1.292,609,2.949,610,1.58,616,2.639,620,1.408,695,2.244,696,1.58,780,1.408,953,1.19,969,2.691,1014,1.144,1015,1.144,1018,1.121,1119,1.75,1132,2.546,1135,2.691,1136,1.58,1137,1.58,1138,1.507,1139,1.472,1140,2.346,1141,1.58,1142,3.934]],["t/817",[953,2.399,1063,3.527]],["t/819",[1063,3.527,1141,3.185]],["t/821",[2,0.598,46,2.225,150,3.421,151,3.526,152,4.609,154,3.089,282,3.229,283,3.142,377,2.473,397,5.526,712,4.397,968,3.06,969,3.322,970,3.142,1124,6.024]],["t/823",[154,2.827,266,2.16,607,2.537,910,4.81,1143,5.637]],["t/825",[2,0.815,20,1.589,46,1.462,70,1.946,101,0.751,137,1.403,174,1.819,217,1.736,220,1.834,229,2.787,256,1.156,266,1.297,301,1.072,323,1.178,356,1.189,366,1.063,367,0.907,368,0.995,372,1.459,374,2.53,375,1.948,378,2.069,381,2.584,387,2.408,391,1.201,392,1.526,393,1.515,479,1.624,495,3.212,607,1.523,610,1.864,620,1.66,695,2.523,696,1.864,780,1.66,834,3.19,953,1.403,970,2.862,1014,1.349,1015,1.349,1018,1.322,1119,2.064,1135,3.026,1136,1.864,1137,1.864,1138,1.777,1139,1.736,1144,4.694]],["t/827",[2,0.835,46,1.377,70,2.351,101,0.707,126,1.984,137,1.322,174,1.714,217,1.636,220,1.759,229,2.673,256,1.089,266,1.222,301,1.01,323,1.11,356,1.14,366,1.029,367,0.854,368,0.937,372,1.4,374,2.45,375,1.887,376,3.535,378,1.984,381,2.479,387,2.31,391,1.131,392,1.478,393,1.453,479,1.53,495,3.081,607,1.435,610,1.756,620,1.564,695,2.42,696,1.756,780,1.564,953,1.322,970,2.745,1014,1.271,1015,1.271,1018,1.246,1119,1.944,1135,2.902,1136,1.756,1137,1.756,1138,1.674,1139,1.636,1141,1.756,1145,3.005]],["t/830",[953,2.399,1063,3.527]],["t/832",[1063,3.527,1141,3.185]],["t/835",[2,0.825,20,1.505,46,1.384,70,1.873,101,0.71,137,1.329,174,1.722,217,1.644,220,1.765,229,2.682,256,1.094,266,1.731,301,1.015,323,1.115,356,0.811,366,1.182,367,0.858,368,0.942,372,1.404,374,2.457,375,1.892,378,1.991,381,2.487,387,2.318,391,1.137,392,1.482,393,1.458,479,1.537,495,3.091,607,1.442,610,1.764,616,2.753,620,1.572,695,2.428,696,1.764,780,1.572,953,1.329,970,2.754,1014,1.277,1015,1.277,1018,1.252,1119,1.954,1130,3.204,1134,4.518,1135,2.912,1136,1.764,1137,1.764,1138,1.682,1139,1.644]],["t/837",[2,0.839,46,1.314,70,2.301,101,0.675,126,1.919,137,1.261,174,1.635,217,1.561,220,1.701,229,2.585,256,1.039,266,1.668,301,0.964,323,1.059,356,0.77,366,1.159,367,0.815,368,0.894,372,1.353,374,2.387,375,1.838,378,1.919,381,2.397,387,2.234,391,1.079,392,1.44,393,1.405,439,3.076,479,1.46,495,2.979,607,1.369,610,1.675,616,2.551,620,1.492,695,2.34,696,1.675,780,1.492,953,1.261,970,2.655,1014,1.212,1015,1.212,1018,1.188,1119,1.855,1135,2.806,1136,1.675,1137,1.675,1138,1.597,1139,1.561,1140,2.486,1141,1.675]],["t/839",[2,0.842,46,1.296,70,2.287,101,0.665,126,1.9,137,1.244,174,1.613,217,1.539,220,1.684,229,2.56,256,1.025,266,1.652,301,0.95,323,1.044,356,0.76,366,1.152,367,0.804,368,0.882,372,1.34,374,2.369,375,1.824,378,1.9,381,2.374,387,2.212,391,1.064,392,1.429,393,1.391,439,3.046,479,1.44,495,2.95,607,1.35,610,1.652,616,2.685,620,1.472,695,2.317,696,1.652,780,1.472,953,1.244,970,2.629,1014,1.196,1015,1.196,1018,1.172,1119,1.83,1135,2.779,1136,1.652,1137,1.652,1138,1.575,1139,1.539,1140,2.452,1141,1.652]],["t/842",[953,2.399,1063,3.527]],["t/844",[1063,3.527,1141,3.185]],["t/846",[154,2.827,266,2.16,607,2.537,910,4.81,1143,5.637]],["t/848",[2,0.802,20,1.573,46,1.447,70,1.933,101,0.743,137,1.389,174,1.801,217,1.719,229,2.767,256,1.144,266,1.284,301,1.061,323,1.166,356,1.18,366,1.057,367,0.897,368,0.985,374,2.517,375,1.938,379,2.697,380,3.293,381,2.566,387,2.391,391,1.188,392,1.518,393,1.504,479,1.608,607,1.508,610,1.845,616,2.142,620,1.643,695,2.505,696,1.845,780,1.643,834,3.157,953,1.389,968,2.767,1014,1.335,1015,1.335,1018,1.309,1119,2.043,1131,3.293,1132,2.842,1133,4.392,1135,3.004,1136,1.845,1137,1.845,1138,1.759,1139,1.719,1144,4.661]],["t/850",[2,0.829,46,1.364,70,2.341,101,0.7,126,1.971,137,1.31,174,1.698,217,1.62,229,2.655,256,1.079,266,1.21,301,1,323,1.099,356,1.132,366,1.024,367,0.846,368,0.928,374,2.437,375,1.877,376,3.512,379,2.587,380,3.159,381,2.462,387,2.294,391,1.12,392,1.47,393,1.443,479,1.515,607,1.421,610,1.739,616,2.055,620,1.549,695,2.403,696,1.739,780,1.549,953,1.31,968,2.655,1014,1.258,1015,1.258,1018,1.234,1119,1.926,1131,3.159,1132,2.726,1133,4.214,1135,2.882,1136,1.739,1137,1.739,1138,1.658,1139,1.62,1141,1.739,1145,2.976]],["t/853",[953,2.399,1063,3.527]],["t/855",[1063,3.527,1141,3.185]],["t/857",[46,2.354,150,3.618,151,3.73,154,2.734,282,3.416,283,3.324,356,1.612,359,5.137]],["t/859",[2,0.84,8,1.232,20,2.285,101,0.791,202,1.29,256,1.218,301,1.13,323,1.242,356,1.232,362,1.675,366,1.174,367,1.484,368,1.049,391,1.265,392,1.569,393,1.571,398,1.64,399,1.83,908,2.606,966,2.368,1014,1.421,1015,1.421,1017,4.191,1018,1.394,1019,2.699,1020,2.699,1021,2.699,1126,5.689,1146,3.191,1147,4.694,1148,3.977,1149,3.977,1150,4.353,1151,4.353,1152,4.586]],["t/861",[2,0.847,8,1.125,20,1.469,101,0.694,121,3.039,202,1.131,245,1.842,256,1.068,301,0.991,304,2.457,323,1.089,356,1.125,362,1.469,366,1.109,367,1.383,368,0.92,370,2.279,371,3.36,372,1.381,373,1.879,391,1.11,392,1.463,393,1.433,398,1.438,399,1.605,638,2.637,777,3.36,778,3.63,908,2.285,948,2.077,966,2.077,1014,1.246,1015,1.246,1017,3.907,1018,1.222,1019,2.367,1020,2.367,1021,2.367,1146,2.798,1148,3.63,1149,3.63,1150,3.972,1151,3.972,1152,4.186]],["t/863",[2,0.85,8,1.172,20,1.557,101,0.735,202,1.199,256,1.133,301,1.051,304,2.605,323,1.154,356,1.172,362,1.557,366,1.138,367,1.428,368,0.975,391,1.176,392,1.51,393,1.494,398,1.525,399,1.702,783,4.628,908,2.423,948,2.202,966,2.202,1014,1.322,1015,1.322,1017,4.033,1018,1.296,1019,2.509,1020,2.509,1021,2.509,1024,3.557,1025,3.557,1026,4.963,1027,3.557,1146,2.966,1148,3.782,1149,3.782,1150,4.139,1151,4.139,1152,4.362]],["t/865",[2,0.851,8,1.081,20,1.39,78,2.922,101,0.656,151,2.026,202,1.07,256,1.011,301,0.938,304,2.325,323,1.03,356,1.081,362,1.39,366,1.081,367,1.341,368,0.87,391,1.05,392,1.418,393,1.378,398,1.361,399,1.519,612,3.118,908,2.162,948,1.965,966,1.965,1014,1.179,1015,1.179,1017,3.788,1018,1.156,1019,2.24,1020,2.24,1021,2.24,1028,3.174,1029,5.198,1030,5.878,1031,4.578,1032,3.353,1033,3.353,1034,4.578,1035,3.174,1146,2.648,1148,3.489,1149,3.489,1150,3.818,1151,3.818,1152,4.023]],["t/867",[2,0.841,8,1.149,20,1.77,78,3.709,101,1.006,202,0.904,245,1.563,256,1.287,279,2.357,301,1.194,304,1.964,323,1.312,356,0.955,362,1.174,366,1.069,367,1.353,368,1.334,370,1.934,391,1.337,392,1.614,393,1.63,398,1.15,399,1.934,616,1.15,655,2.357,855,3.553,908,1.827,948,1.66,966,1.66,1014,0.996,1015,0.996,1017,3.433,1018,1.473,1019,1.892,1020,1.892,1021,1.892,1029,2.237,1032,1.964,1033,2.961,1036,4.518,1037,4.518,1038,2.682,1039,2.682,1040,2.682,1041,4.043,1042,4.043,1043,4.043,1044,2.682,1045,4.043,1046,4.043,1047,4.043,1048,2.682,1146,2.237,1148,3.081,1149,3.081,1150,3.372,1151,3.372,1152,3.553,1153,4.961]],["t/869",[2,0.738,57,4.245,78,3.248,230,3.879,232,4.473,262,4.747,557,4.473,615,4.473,626,4.747,939,4.747,969,3.777,1032,4.601,1033,3.727,1036,5.24,1037,5.24,1049,5.089,1050,5.089,1051,5.089,1052,5.089,1053,5.089,1054,5.089]],["t/871",[2,0.847,8,1.025,20,1.292,123,2.956,220,1.075,245,1.141,256,1.64,301,1.677,304,2.16,366,1.26,375,2.134,392,1.671,393,1.55,398,1.86,399,1.411,512,2.161,566,2.927,732,3.453,772,5.295,773,4.047,777,3.062,778,3.308,878,3.453,948,1.826,1018,1.876,1055,2.95,1056,2.95,1057,4.34,1058,2.95,1060,2.95,1061,2.95,1062,4.34,1146,2.46,1148,3.308,1149,3.308,1150,3.62,1151,3.62,1154,5.325,1155,5.325,1156,6.318]],["t/874",[126,2.423,946,4.124,948,4.247,991,4.158,1063,3.901]],["t/876",[154,2.827,266,2.16,607,2.537,910,4.81,1143,5.637]],["t/878",[2,0.83,20,1.589,46,1.462,70,1.946,101,0.751,137,1.403,174,1.819,217,1.736,229,2.787,256,1.156,301,1.487,323,1.178,356,1.189,366,1.063,367,0.907,368,0.995,372,1.459,375,1.948,377,2.252,378,2.069,379,2.716,380,3.316,387,2.408,391,1.201,392,1.526,393,1.515,479,1.624,512,2.751,566,2.862,607,1.523,620,1.66,695,2.523,780,1.66,834,3.19,1014,1.349,1015,1.349,1018,1.322,1136,1.864,1137,1.864,1138,1.777,1139,1.736,1144,4.694]],["t/880",[2,0.843,46,1.377,70,2.351,101,0.707,126,1.984,137,1.322,174,1.714,217,1.636,229,2.673,256,1.089,301,1.426,323,1.11,356,1.14,366,1.029,367,0.854,368,0.937,372,1.4,375,1.887,376,3.535,377,2.16,378,1.984,379,2.605,380,3.18,387,2.31,391,1.131,392,1.478,393,1.453,479,1.53,512,2.691,566,2.745,607,1.435,620,1.564,695,2.42,780,1.564,1014,1.271,1015,1.271,1018,1.246,1136,1.756,1137,1.756,1138,1.674,1139,1.636,1141,1.756,1145,3.005]],["t/882",[2,0.841,46,1.344,70,2.326,101,0.69,126,1.951,137,1.291,174,1.674,217,1.597,229,2.628,256,1.063,301,1.402,306,2.498,323,1.084,356,1.121,366,1.016,367,0.834,368,0.915,372,1.376,375,1.862,376,3.476,377,2.124,378,1.951,379,2.561,380,3.127,387,2.271,391,1.104,392,1.459,393,1.429,479,1.494,512,2.667,566,2.699,575,2.545,589,3.777,607,1.401,620,1.527,695,2.379,780,1.527,1014,1.241,1015,1.241,1018,1.216,1136,1.714,1137,1.714,1138,1.635,1139,1.597,1141,1.714,1145,2.934]],["t/885",[1063,3.527,1141,3.185]],["t/887",[2,0.852,71,2.098,101,0.804,121,3.368,219,3.368,245,1.504,356,0.918,366,0.715,367,0.971,370,1.86,371,2.743,372,1.127,373,1.534,375,2.166,392,1.027,512,2.215,566,3.001,638,2.153,878,3.094,882,5.753,966,2.407,1064,3.626,1065,3.417,1095,4.239,1157,4.772,1158,6.475,1159,4.772,1160,4.772,1161,4.772,1162,4.772,1163,6.475,1164,4.239,1165,4.772,1166,4.772,1167,4.772]],["t/889",[154,2.827,266,2.16,607,2.537,910,4.81,1143,5.637]],["t/891",[2,0.819,20,1.527,46,1.404,70,1.893,101,0.721,137,1.348,174,1.748,217,1.668,220,1.783,256,1.11,266,1.246,301,1.03,323,1.132,356,1.156,366,1.04,367,0.871,368,0.956,372,1.419,374,2.476,375,1.907,378,2.012,379,2.641,381,2.513,387,2.342,391,1.153,392,1.494,393,1.473,479,1.56,495,3.123,607,1.463,609,3.224,610,1.79,620,1.595,695,2.453,696,1.79,780,1.595,834,3.064,953,1.348,969,2.942,1014,1.296,1015,1.296,1018,1.27,1119,1.983,1132,2.783,1135,2.942,1136,1.79,1137,1.79,1138,1.707,1139,1.668,1142,4.301,1144,4.565]],["t/893",[2,0.836,46,1.326,70,2.311,101,0.681,126,1.932,137,1.273,174,1.65,217,1.575,220,1.712,256,1.048,266,1.176,301,0.972,323,1.068,356,1.11,366,1.008,367,0.822,368,0.903,372,1.362,374,2.4,375,1.848,376,3.442,378,1.932,379,2.536,381,2.413,387,2.248,391,1.089,392,1.447,393,1.414,479,1.473,495,2.999,607,1.382,609,3.096,610,1.69,620,1.506,695,2.356,696,1.69,780,1.506,953,1.273,969,2.825,1014,1.223,1015,1.223,1018,1.199,1119,1.872,1132,2.672,1135,2.825,1136,1.69,1137,1.69,1138,1.612,1139,1.575,1141,1.69,1142,4.13,1145,2.893]],["t/896",[953,2.399,1063,3.527]],["t/898",[1063,3.527,1141,3.185]],["t/900",[2,0.849,8,0.617,16,2.612,81,3.483,101,0.54,111,2.179,137,1.01,152,2.179,197,2.799,199,3.963,206,3.963,219,2.529,223,1.375,230,3.65,245,1.01,286,2.296,356,0.617,366,1.113,367,0.652,375,1.336,378,1.074,398,1.12,399,1.25,487,2.079,523,1.31,606,2.612,638,1.447,665,2.612,667,3.963,795,2.612,796,2.612,797,2.612,798,2.612,799,3.963,800,4.789,903,2.848,1064,2.437,1065,2.296,1071,2.848,1168,2.848,1169,3.206,1170,3.206,1171,3.206,1172,4.864,1173,3.206,1174,4.864,1175,3.206,1176,3.206,1177,3.206,1178,3.206,1179,3.206,1180,3.206,1181,3.206,1182,3.206,1183,2.848,1184,3.206,1185,2.848,1186,3.206,1187,3.206,1188,2.848,1189,4.864,1190,2.848,1191,3.206,1192,2.848,1193,2.848,1194,2.848,1195,2.848,1196,3.206,1197,3.206,1198,3.206,1199,2.848,1200,2.848,1201,4.321,1202,2.848,1203,3.206,1204,3.206,1205,3.206,1206,4.864,1207,3.206,1208,4.864,1209,3.206,1210,3.206,1211,3.206,1212,3.206,1213,3.206,1214,3.206,1215,3.206,1216,3.206,1217,3.206,1218,3.206]],["t/902",[2,0.838,8,0.705,70,1.694,101,0.618,111,2.491,121,1.906,137,1.155,197,2.56,199,2.987,223,1.572,356,0.705,366,1.169,369,1.429,370,1.429,372,0.866,373,1.179,374,2.271,375,1.477,377,1.337,392,1.37,398,1.28,399,1.429,487,2.377,512,2.177,523,1.497,575,3.338,610,1.534,638,1.654,642,3.849,692,2.987,795,2.987,796,2.987,797,2.987,798,2.987,799,2.987,800,2.987,897,6.227,956,2.377,968,1.654,969,1.796,970,1.698,1064,2.786,1065,2.625,1090,3.256,1168,3.256,1183,3.256,1185,3.256,1188,3.256,1190,3.256,1192,3.256,1193,3.256,1194,3.256,1195,3.256,1199,3.256,1200,3.256,1201,3.256,1202,3.256,1219,3.665,1220,3.665,1221,3.665,1222,3.665,1223,3.665,1224,3.665,1225,3.665,1226,3.665,1227,3.665,1228,3.665,1229,3.665,1230,5.375,1231,3.665,1232,3.665,1233,3.665,1234,3.665,1235,3.665,1236,3.665,1237,3.665,1238,3.665]],["t/904",[2,0.855,8,0.437,20,0.81,46,0.745,101,0.382,103,1.145,122,2.732,177,1.259,192,1.409,197,2.579,200,1.218,202,0.623,219,1.926,220,1.1,223,0.973,266,0.661,278,1.409,300,1.724,301,0.891,306,0.973,356,0.437,362,0.81,366,0.96,368,1.574,370,0.885,372,1.771,373,0.73,377,1.35,378,2.262,512,1.267,518,3.232,523,0.927,538,1.305,568,1.409,589,1.471,610,0.949,612,2.605,616,0.793,620,2.224,638,1.024,668,1.849,735,1.409,739,1.218,740,1.625,743,4.031,766,2.129,805,1.542,807,1.542,841,2.21,915,1.409,925,1.724,946,1.814,947,1.471,951,1.409,952,2.519,953,1.479,954,1.625,956,1.471,960,2.21,967,1.625,968,2.444,970,1.716,973,1.625,974,1.625,975,1.625,978,4.413,983,1.849,991,2.129,1131,1.218,1132,1.716,1239,1.471,1240,1.471,1241,1.471,1242,2.016,1243,2.016,1244,2.016,1245,2.517,1246,1.471,1247,2.517,1248,1.471,1249,1.471,1250,1.471,1251,1.471,1252,1.542,1253,2.402,1254,2.402,1255,2.402,1256,1.471,1257,1.471,1258,4.811,1259,1.471,1260,3.29,1261,2.016,1262,2.016,1263,2.016,1264,2.016,1265,2.016,1266,2.016,1267,2.016,1268,1.471,1269,1.471,1270,1.849,1271,1.471,1272,1.849,1273,2.016]],["t/906",[2,0.854,8,0.585,20,1.084,101,0.512,103,1.532,122,2.355,177,1.686,192,1.887,197,3.038,200,1.631,202,0.835,220,0.902,223,1.303,266,0.884,356,0.585,362,1.084,366,0.956,368,1.624,370,1.184,372,1.932,373,0.977,377,1.108,378,2.535,518,2.786,523,1.241,538,1.747,568,1.887,612,1.686,616,1.061,638,1.371,735,1.887,739,1.631,743,4.517,766,1.747,841,2.786,915,1.887,946,2.287,947,1.97,951,1.887,952,3.052,953,0.957,960,2.786,968,2.879,970,1.408,991,2.684,1131,1.631,1132,2.163,1239,1.97,1240,1.97,1241,1.97,1245,2.065,1246,1.97,1247,2.065,1248,1.97,1249,1.97,1250,1.97,1251,1.97,1252,2.065,1253,3.027,1254,3.027,1255,3.027,1256,1.97,1257,1.97,1259,1.97,1268,1.97,1269,1.97,1271,1.97,1274,2.309,1275,2.309,1276,2.309]],["t/908",[2,0.854,8,0.545,20,1.01,101,0.477,103,1.428,122,2.229,177,1.571,192,1.758,197,2.925,200,1.519,202,0.778,220,0.84,223,2.634,266,0.824,306,1.214,356,0.545,362,1.01,366,0.921,368,1.577,370,1.103,372,1.895,373,0.91,377,1.611,378,2.556,495,2.298,512,0.968,518,2.637,523,1.156,538,1.627,568,1.758,612,1.571,616,0.989,638,1.277,735,1.758,739,1.519,743,4.402,766,1.627,841,2.637,915,2.744,946,2.165,947,1.835,951,1.758,952,2.918,953,0.892,960,2.637,961,1.835,968,2.772,970,1.311,991,2.541,1131,1.519,1132,2.048,1239,1.835,1240,1.835,1241,1.835,1245,1.924,1246,1.835,1247,1.924,1248,1.835,1249,1.835,1250,1.835,1251,1.835,1252,1.924,1253,2.865,1254,2.865,1255,2.865,1256,1.835,1257,1.835,1259,2.865,1268,1.835,1269,1.835,1271,1.835,1274,2.151,1275,2.151,1276,2.151,1277,2.514,1278,2.514,1279,2.514]],["t/910",[2,0.855,8,0.569,20,1.055,101,0.498,103,1.491,122,2.305,177,1.64,192,1.836,197,2.994,200,1.587,202,0.812,219,1.537,220,1.357,223,1.267,266,0.86,306,1.267,356,0.569,362,1.055,366,0.942,368,1.606,370,1.152,372,1.918,373,0.95,377,1.078,378,2.51,518,2.727,523,1.207,538,1.699,568,1.836,589,1.916,612,1.64,616,1.032,638,1.334,735,1.836,739,1.587,743,4.472,766,1.699,841,2.727,915,1.836,946,2.239,947,1.916,951,1.836,952,3,953,0.931,960,2.727,968,2.837,970,1.369,991,2.627,1131,1.587,1132,2.117,1239,1.916,1240,1.916,1241,1.916,1245,2.009,1246,1.916,1247,2.009,1248,1.916,1249,1.916,1250,1.916,1251,1.916,1252,2.009,1253,2.963,1254,2.963,1255,2.963,1256,1.916,1257,1.916,1259,1.916,1268,1.916,1269,1.916,1270,2.408,1271,1.916,1272,2.408,1274,2.246]],["t/912",[2,0.855,8,0.531,20,0.984,101,0.465,103,1.391,122,2.185,177,1.531,192,1.713,197,2.885,200,1.481,202,0.758,219,1.435,220,1.286,223,2.597,266,0.803,306,1.857,356,0.531,362,0.984,366,0.908,368,1.561,370,1.075,372,1.881,373,0.887,377,1.579,378,2.534,495,2.252,512,0.943,518,2.585,523,1.127,538,1.586,568,1.713,589,1.789,612,1.531,616,0.964,638,1.245,735,1.713,739,1.481,743,4.36,766,1.586,841,2.585,915,2.69,946,2.122,947,1.789,951,1.713,952,2.87,953,0.869,960,2.585,961,1.789,968,2.733,970,1.278,991,2.49,1131,1.481,1132,2.007,1239,1.789,1240,1.789,1241,1.789,1245,1.875,1246,1.789,1247,1.875,1248,1.789,1249,1.789,1250,1.789,1251,1.789,1252,1.875,1253,2.808,1254,2.808,1255,2.808,1256,1.789,1257,1.789,1259,2.808,1268,1.789,1269,1.789,1270,2.248,1271,1.789,1272,2.248,1274,2.096,1277,2.451,1278,2.451,1279,2.451]],["t/914",[1,2.644,101,1.117,150,3.342,207,4.115,225,5.887,228,5.4,604,5.887,696,2.772,739,3.557,994,5.887,995,5.887,996,5.887,997,5.887,998,5.887,999,5.887,1000,5.887,1280,5.4,1281,6.626,1282,6.626]],["t/916",[0,4.608,1,2.902,2,0.587,3,3.524,4,3.524,5,3.397,6,3.691,8,1.4,9,3.014,15,2.572,30,4.341,38,4.182,41,4.341,62,4.638,66,3.524,71,1.744,76,5.056,78,2.063,95,2.841,282,1.889,283,1.838,284,2.202,285,3.232,286,2.841,287,3.014,289,3.014,290,4.638,291,3.691,295,3.232,312,3.524,325,3.232,326,3.014,330,3.524,331,3.524,333,2.841,386,3.014,389,3.232,400,3.014,412,3.524,413,3.524,416,3.232,455,5.056,456,3.232,465,3.232,595,3.524,732,2.572,1283,3.966,1284,3.966,1285,3.966,1286,3.966,1287,5.691,1288,3.966,1289,3.966,1290,3.966,1291,5.691,1292,5.691,1293,3.966,1294,3.966,1295,3.966,1296,3.966,1297,3.966,1298,3.966,1299,3.966,1300,5.691,1301,3.966,1302,5.691,1303,3.966,1304,3.966,1305,3.966,1306,3.966,1307,3.966,1308,3.966,1309,3.966]],["t/918",[8,1.018,81,2.571,101,1.169,106,2.728,126,1.202,136,4.702,142,4.717,170,3.189,180,7.207,196,3.287,202,0.986,210,6.165,211,3.189,217,1.4,224,2.142,232,4.503,245,1.131,257,3.189,267,2.571,313,3.189,328,2.728,372,1.25,652,2.728,659,2.925,676,2.728,717,3.189,718,4.702,719,2.571,738,4.702,752,4.702,832,2.571,843,3.189,888,4.023,965,2.925,966,1.811,987,3.189,1310,3.59,1311,3.59,1312,3.59,1313,5.293,1314,8.006,1315,3.59,1316,5.293,1317,3.59,1318,3.59,1319,3.59,1320,3.59,1321,3.59,1322,3.59,1323,3.59,1324,3.59,1325,3.59,1326,5.293,1327,6.287,1328,3.59,1329,3.59,1330,3.59,1331,3.59,1332,3.59,1333,3.59,1334,3.59,1335,3.59,1336,3.59,1337,3.59,1338,3.59,1339,5.293,1340,3.59,1341,3.59,1342,3.59,1343,3.59,1344,5.293,1345,3.59,1346,3.59,1347,3.59,1348,3.59,1349,3.59,1350,3.59,1351,5.293,1352,3.59,1353,3.59,1354,3.59,1355,3.59,1356,3.59,1357,3.59,1358,3.59]],["t/920",[1,2.664,228,5.441,256,2.084,266,1.944,356,1.285,479,2.435,607,2.284,677,5.075,780,2.489,1119,3.094,1139,2.603,1359,6.677,1360,6.677,1361,6.677,1362,6.677,1363,6.677,1364,6.677]],["t/922",[2,0.841,8,1.044,71,1.24,220,1.821,224,3.97,245,2.096,256,2.252,266,1.283,301,1.476,356,0.848,366,0.997,367,1.552,369,1.1,370,2.115,372,1.282,373,1.744,392,1.897,398,1.895,479,1.978,484,1.515,512,1.508,566,2.042,677,5.056,712,3.976,780,2.022,788,2.144,818,2.299,910,2.858,1018,1.975,1127,1.829,1138,2.446,1139,2.115,1148,1.752,1149,1.752,1164,2.506,1280,2.299,1365,5.91,1366,2.506,1367,2.506,1368,2.821,1369,2.821,1370,6.132,1371,2.821,1372,2.506,1373,2.506,1374,2.821,1375,2.506,1376,2.506,1377,3.916,1378,2.506,1379,2.506]],["t/924",[2,0.843,8,1.012,71,1.183,202,1.445,220,1.774,224,3.881,231,5.299,245,2.049,256,2.158,266,1.236,323,2.09,356,0.817,362,1.877,366,1.036,367,1.473,368,1.453,369,1.049,370,2.051,372,1.243,373,1.691,391,2.13,392,1.79,393,1.041,479,1.918,484,1.444,512,1.452,524,1.744,566,1.968,677,4.942,780,1.961,910,2.753,1018,1.931,1138,2.595,1139,2.051,1148,1.671,1149,1.671,1280,2.192,1365,5.777,1366,2.39,1367,2.39,1372,2.39,1373,2.39,1375,2.39,1376,2.39,1377,3.772,1378,2.39,1379,2.39,1380,2.69]],["t/926",[1381,7.546,1382,7.546,1383,7.546]],["t/928",[2,0.857,8,0.818,20,0.703,71,1.869,72,2.686,103,0.994,122,1.663,123,1.094,177,1.83,192,2.047,197,2.365,200,1.058,202,1.168,220,0.585,223,0.845,268,1.751,301,1.664,306,2.13,362,1.176,366,0.745,367,0.671,368,1.235,370,0.768,372,1.732,373,0.634,377,2.016,378,2.126,479,0.719,518,1.967,523,0.805,538,1.133,552,1.606,607,1.127,612,1.094,616,0.688,638,0.889,682,2.138,735,1.224,739,1.058,743,3.787,766,1.133,841,1.176,915,1.224,940,3.557,948,2.788,951,1.224,952,1.77,953,0.621,956,3.221,960,1.967,961,2.138,968,3.002,969,2.433,970,0.913,991,1.133,992,2.929,1131,1.058,1132,1.527,1239,1.278,1240,2.138,1241,2.138,1246,1.278,1248,1.278,1249,1.278,1250,1.278,1251,1.278,1253,2.138,1254,2.138,1255,2.138,1256,1.278,1257,1.278,1259,1.278,1268,1.278,1269,1.278,1271,1.278,1275,1.498,1276,1.498,1384,1.971,1385,1.971,1386,1.971,1387,1.971,1388,1.971,1389,1.971,1390,1.971,1391,1.971,1392,1.971,1393,4.249,1394,3.296,1395,1.971,1396,1.971,1397,4.249,1398,3.296,1399,1.971,1400,1.971,1401,1.971,1402,1.971,1403,1.971,1404,1.971,1405,6.653,1406,3.296,1407,1.971,1408,3.296,1409,3.296,1410,1.971,1411,3.296,1412,1.971,1413,3.296,1414,3.296]],["t/930",[2,0.854,8,0.446,20,0.827,46,0.76,101,0.39,103,1.169,122,2.766,177,1.286,192,1.439,197,2.612,200,1.244,202,0.637,219,1.205,220,0.688,223,0.994,266,0.675,278,1.439,300,1.761,301,0.907,356,0.446,362,0.827,366,0.969,368,1.586,370,0.903,372,1.783,373,0.745,377,1.374,378,2.283,512,1.289,518,3.273,523,0.947,538,1.332,568,1.439,610,0.97,612,2.643,616,0.809,620,2.249,638,1.046,668,1.888,735,1.439,739,1.244,740,1.66,743,4.067,766,2.166,805,1.575,807,1.575,841,2.249,915,1.439,925,1.761,946,1.846,947,1.503,951,1.439,952,2.556,953,1.5,954,1.66,956,1.503,960,2.249,967,1.66,968,2.475,970,1.746,973,1.66,974,1.66,975,1.66,978,4.469,983,1.888,991,2.166,1131,1.244,1132,1.746,1239,1.503,1240,1.503,1241,1.503,1242,2.059,1243,2.059,1244,2.059,1245,2.561,1246,1.503,1247,2.561,1248,1.503,1249,1.503,1250,1.503,1251,1.503,1252,1.575,1253,2.443,1254,2.443,1255,2.443,1256,1.503,1257,1.503,1258,4.872,1259,1.503,1260,3.347,1261,2.059,1262,2.059,1263,2.059,1264,2.059,1265,2.059,1266,2.059,1267,2.059,1268,1.503,1269,1.503,1271,1.503,1273,2.059,1275,1.761,1276,1.761]]],"invertedIndex":[["",{"_index":2,"t":{"622":{"position":[[9,1],[96,1],[304,1]]},"624":{"position":[[20,1],[195,1],[269,1]]},"632":{"position":[[632,1]]},"636":{"position":[[122,1],[132,1],[191,1],[246,2],[249,2],[252,2]]},"638":{"position":[[49,1],[61,1],[123,2],[170,2]]},"640":{"position":[[7,1],[13,1],[68,1]]},"642":{"position":[[7,1],[27,1],[216,2],[385,2]]},"650":{"position":[[254,1],[278,1]]},"660":{"position":[[160,2],[215,2],[271,1],[355,3],[359,2],[383,1],[409,1],[443,1],[471,1],[490,1],[496,2],[521,2],[597,2],[677,1],[691,1],[711,1],[713,2],[765,1],[783,1],[817,1],[845,1],[847,1],[859,1],[861,3],[878,2],[903,1],[917,1],[937,1],[939,2],[970,1],[991,2],[1047,1],[1125,3],[1129,2],[1175,1],[1203,1],[1222,1],[1261,1],[1285,2],[1361,2],[1441,1],[1443,2],[1446,2],[1520,1],[1548,1],[1550,1],[1562,1],[1564,3],[1606,1],[1630,1],[1632,2]]},"662":{"position":[[235,1],[837,1],[839,2],[895,1],[979,3],[983,2],[1078,1],[1114,1],[1142,1],[1144,1],[1156,1],[1158,3],[1181,2],[1206,2],[1282,2],[1362,1],[1376,1],[1396,1],[1410,1],[1431,2],[1487,1],[1565,3],[1569,2],[1668,1],[1696,1],[1698,1],[1710,1],[1712,3],[1768,1],[1792,2],[1868,2],[1948,1],[1950,2]]},"664":{"position":[[292,1],[476,2],[586,1],[718,2],[765,1],[817,2],[888,1],[962,3],[978,1],[999,2],[1109,1],[1241,2],[1288,1],[1340,2],[1411,1],[1485,3],[1735,1],[1737,2],[1804,1],[1855,2],[1868,1],[1921,1],[1933,1],[1947,1],[1967,1],[1969,2],[2086,1],[2088,2],[2101,1],[2154,1],[2166,3],[2307,2],[2364,1],[2394,2],[2442,3],[2446,4],[2451,2],[2537,2],[2623,1],[2625,2],[2667,3],[2671,4],[2676,2],[2762,3]]},"666":{"position":[[143,1],[145,2],[201,1],[285,3],[289,2],[340,1],[376,1],[404,1],[406,1],[418,1],[420,3],[438,2],[441,1],[568,2],[623,2],[722,2],[800,1],[903,3],[907,2],[958,1],[994,1],[1022,1],[1024,1],[1036,1],[1038,3],[1056,2],[1233,1],[1235,2],[1265,1],[1337,3],[1341,2],[1410,1],[1428,2],[1482,1],[1521,1],[1659,1],[1680,2],[1709,1],[1787,3],[1849,2],[1852,1],[1873,2],[1905,2]]},"668":{"position":[[145,1],[452,1],[555,3],[570,1],[667,3],[705,1],[731,1],[809,3],[835,2],[943,2],[977,1],[991,1],[1011,1],[1025,1],[1084,2],[1119,1],[1143,2],[1251,2],[1285,1],[1287,2]]},"670":{"position":[[837,1],[941,1],[968,2],[980,2],[983,1],[1014,1],[1051,2],[1054,1],[1071,1],[1109,2],[1173,2],[1189,2],[1192,1],[1194,2],[1259,3],[1263,2],[1266,2],[1269,2],[1272,3],[1687,1],[1806,2],[1832,2],[1839,1],[1856,3],[1876,1],[1898,2],[1901,1],[1918,1],[1946,2],[1993,2],[2085,3],[2089,1],[2096,1],[2108,1],[2175,2],[2188,1],[2205,1],[2207,2],[2210,3]]},"672":{"position":[[523,1],[674,1],[676,2],[689,3],[727,2],[740,2],[743,1],[780,1],[836,2],[839,2],[867,2],[880,2],[883,1],[920,1],[976,2],[979,2],[1007,2],[1020,2],[1023,1],[1060,1],[1116,2],[1119,2],[1122,2],[1125,3]]},"675":{"position":[[162,1],[462,1],[500,1],[512,1],[525,2],[540,2],[543,1],[545,2],[578,1],[580,1],[582,1],[621,2],[639,1],[641,1],[648,1],[650,1],[652,3],[686,1],[698,1],[705,2],[720,2],[723,1],[725,2],[735,1],[737,1],[739,1],[767,3],[799,1],[811,1],[818,2],[833,2],[836,1],[838,2],[856,1],[865,3],[869,2],[973,1],[975,1],[977,1],[1006,2],[1009,1],[1011,2],[1029,1],[1038,3]]},"677":{"position":[[14,1],[16,1],[68,2],[112,2],[115,1],[117,2],[170,2],[241,2],[244,4],[249,2],[252,3]]},"679":{"position":[[453,2],[562,1],[590,2],[593,2],[619,1],[693,1],[727,1],[776,1],[798,2],[801,2],[816,2],[898,1],[927,1],[965,1],[1052,2],[1055,1],[1057,2],[1096,1],[1149,1],[1238,3],[1242,3],[1246,2],[1249,1],[1285,2],[1288,3],[1379,2]]},"681":{"position":[[10,1],[40,1],[73,1],[111,1],[226,2],[255,3],[592,1],[635,1],[668,1],[759,1],[777,1],[800,1],[834,2],[837,1],[869,1],[871,2],[895,2],[898,3]]},"684":{"position":[[69,1]]},"688":{"position":[[107,2],[255,2],[497,1]]},"694":{"position":[[0,2],[18,2],[33,1],[62,2],[136,2],[191,2],[194,2],[210,2],[271,2],[312,1],[356,2],[483,2],[486,1],[498,1],[563,2],[581,2],[584,1],[617,2],[633,2],[636,1],[656,2],[714,3]]},"696":{"position":[[26,1],[40,1],[80,1],[128,3],[153,1],[182,3],[222,1],[250,1],[264,1],[304,1],[340,3],[344,2],[480,3],[534,1]]},"698":{"position":[[12,1],[42,1],[72,2],[75,1],[85,1],[164,3],[179,1],[287,1],[299,4],[319,3]]},"701":{"position":[[60,1],[62,1],[64,1],[66,1],[100,2],[103,1],[105,2],[114,1],[116,1],[129,1],[131,1],[133,2],[157,1],[159,1],[161,1],[163,1],[243,3],[247,2],[287,1],[289,1],[291,1],[293,1],[359,1],[361,1],[363,1],[365,1]]},"703":{"position":[[165,1],[167,1],[169,1],[199,2],[202,1],[204,2],[266,3],[295,2],[395,1],[407,2],[423,2],[489,2],[492,1],[494,2],[498,1],[500,1],[502,1],[513,1],[515,1],[517,3],[521,2],[573,2],[683,3]]},"705":{"position":[[22,1]]},"707":{"position":[[63,1],[81,1],[96,1],[114,1],[155,1],[187,1],[230,1],[250,1]]},"709":{"position":[[105,1],[140,1],[201,1],[211,1],[256,2],[259,1],[333,1],[343,1],[388,2],[391,1],[466,1],[476,1],[528,1],[538,1],[583,2],[586,1],[620,1],[622,2],[625,1],[627,2],[630,1],[632,2]]},"716":{"position":[[233,1],[266,1]]},"718":{"position":[[14,1],[34,1],[83,1],[85,1],[119,2],[133,1]]},"720":{"position":[[14,1],[28,1],[71,1],[73,1],[107,2],[121,1]]},"722":{"position":[[37,1],[67,2],[70,1],[72,3],[76,1],[85,1],[87,1],[97,1],[99,1],[101,2],[104,3],[131,1],[161,2],[164,1],[166,3],[170,1],[179,1],[181,1],[191,1],[193,1],[195,2],[198,3]]},"725":{"position":[[68,1],[84,1],[112,1],[171,3],[175,2],[223,1],[253,2],[256,1],[277,3],[281,1],[290,1],[292,1],[302,1],[304,1],[306,2],[309,3],[313,2],[390,2],[393,1],[414,3],[418,1],[427,1],[429,1],[454,1],[456,1],[458,2],[461,3],[513,1],[529,1],[557,1],[635,3],[639,2],[688,1],[703,1],[731,2],[734,1],[755,3],[759,1],[768,1],[770,1],[777,1],[779,1],[781,2],[784,1],[786,2],[789,2],[866,2],[869,1],[890,3],[894,1],[903,1],[905,1],[914,1],[916,1],[918,2],[921,3]]},"727":{"position":[[85,1],[101,1],[129,1],[214,3],[228,1],[230,1],[241,1],[263,1],[276,2],[327,2],[330,1],[351,3],[355,1],[364,1],[366,1],[368,1],[378,1],[380,2],[383,1],[385,1],[395,1],[397,1],[399,1],[401,2],[404,3]]},"729":{"position":[[322,1],[340,1],[368,1],[427,3],[441,1],[443,1],[452,1],[457,2],[508,2],[511,1],[534,3],[538,1],[565,1],[618,3],[672,1],[674,2],[677,3]]},"731":{"position":[[173,1],[191,1],[219,1],[304,3],[318,1],[320,1],[329,1],[341,1],[346,2],[400,2],[403,1],[427,3],[431,1],[443,1],[461,1],[514,3],[569,2],[588,1],[641,3],[695,1],[697,1],[699,2],[702,3]]},"733":{"position":[[281,1],[320,1],[348,1],[407,3],[411,3],[431,2],[486,3],[506,2],[566,1],[578,1],[587,3],[591,3],[615,2],[628,1],[721,2],[724,1],[747,3],[751,1],[778,1],[831,3],[885,1],[887,2],[890,3],[1066,3],[1107,2]]},"745":{"position":[[97,1],[110,1],[192,1],[222,2],[225,3],[262,1],[276,1],[296,1],[310,1],[342,1],[453,1],[481,1],[509,1],[511,2],[514,3],[551,3]]},"747":{"position":[[95,1],[108,1],[180,2],[195,2],[208,3],[212,3],[233,1],[263,2],[266,3],[303,1],[317,1],[337,1],[351,1],[383,1],[455,2],[470,2],[483,3],[487,3],[537,1],[565,1],[593,1],[595,2],[598,3],[635,3]]},"749":{"position":[[95,1],[108,1],[129,2],[132,3],[213,2],[216,3],[237,1],[267,2],[270,3],[307,1],[321,1],[341,1],[355,1],[387,1],[408,2],[411,3],[493,3],[543,1],[571,1],[599,1],[601,2],[604,3],[641,3]]},"751":{"position":[[113,1],[126,1],[147,2],[150,3],[159,1],[161,2],[212,2],[308,2],[311,3],[332,1],[362,2],[365,3],[402,1],[416,1],[436,1],[450,1],[482,1],[503,2],[506,3],[515,1],[517,2],[568,2],[664,2],[667,3],[717,1],[745,1],[773,1],[775,2],[778,3],[815,3]]},"753":{"position":[[282,1],[295,1],[316,2],[319,3],[390,3],[411,1],[441,2],[444,3],[481,1],[495,1],[515,1],[529,1],[543,1],[640,1],[654,1],[674,1],[688,1],[720,1],[741,2],[744,3],[815,3],[865,1],[893,1],[921,1],[923,2],[926,3],[963,3],[1046,1],[1086,1],[1114,1],[1134,3]]},"755":{"position":[[13,1],[77,1],[129,1]]},"757":{"position":[[54,1],[97,1],[136,1],[171,3],[186,1],[227,3],[243,1],[286,1],[319,1],[367,2],[370,1],[412,3],[416,2],[419,3],[494,2],[497,1],[525,1],[553,1],[582,3],[647,2],[650,1],[678,1],[706,1],[735,3],[800,2],[803,1],[831,1],[859,1],[888,3]]},"762":{"position":[[35,1],[71,1],[113,1],[157,2],[217,2],[350,2],[355,1],[377,3],[430,2],[433,1],[461,2],[464,2]]},"764":{"position":[[63,1],[114,1],[124,1],[238,3],[290,1],[348,1],[371,1],[413,1],[425,1],[464,1],[647,1],[759,2],[762,2],[878,2],[889,1],[953,1],[1055,3],[1155,1],[1267,2],[1270,2],[1323,1],[1379,1],[1397,2],[1400,1],[1423,2],[1439,2],[1442,1],[1483,3],[1513,1],[1551,1],[1581,2],[1584,1],[1594,1],[1678,3],[1693,1],[1801,1],[1813,4],[1833,2],[1851,2],[1854,1],[1877,2],[1902,1],[1933,3],[1937,1],[1983,1],[1985,1],[2050,3],[2085,1],[2130,2],[2141,2],[2154,3],[2192,1],[2216,1],[2218,1]]},"766":{"position":[[105,1],[140,1]]},"770":{"position":[[103,1],[122,1],[198,2],[201,1],[215,1],[235,1],[249,1],[287,1],[357,2],[398,2],[401,1],[421,3]]},"772":{"position":[[107,1],[126,1],[210,2],[225,2],[238,3],[242,3],[246,1],[260,1],[280,1],[294,1],[332,1],[410,2],[425,2],[438,3],[442,3],[484,2],[487,1],[507,3]]},"774":{"position":[[107,1],[126,1],[159,2],[162,3],[243,2],[246,3],[250,1],[264,1],[284,1],[298,1],[336,1],[363,2],[366,3],[448,3],[490,2],[493,1],[513,3]]},"776":{"position":[[125,1],[144,1],[177,2],[180,3],[189,1],[191,2],[242,2],[338,2],[341,3],[345,1],[359,1],[379,1],[393,1],[431,1],[458,2],[461,3],[470,1],[472,2],[523,2],[619,2],[622,3],[664,2],[667,1],[687,3]]},"778":{"position":[[294,1],[313,1],[346,2],[349,3],[420,3],[424,1],[438,1],[458,1],[472,1],[486,1],[589,1],[603,1],[623,1],[637,1],[675,1],[702,2],[705,3],[776,3],[818,2],[821,1],[841,3],[924,1],[970,1],[998,1],[1018,3]]},"780":{"position":[[13,1],[77,1],[129,1]]},"782":{"position":[[66,1],[109,1],[148,1],[183,3],[204,1],[251,3],[293,2],[296,1],[316,3],[332,1],[375,1],[414,1],[468,2],[471,1],[513,3],[517,2],[520,3],[562,2],[565,1],[585,3],[666,2],[669,1],[697,1],[725,1],[754,3],[825,2],[828,1],[856,1],[884,1],[913,3],[984,2],[987,1],[1015,1],[1043,1],[1072,3]]},"788":{"position":[[63,1],[75,1],[120,3],[124,3],[128,7],[149,1],[200,1],[283,1],[297,1],[317,1],[329,1],[374,3],[378,3],[382,7],[403,1],[485,2],[488,1],[516,1],[544,1],[588,3]]},"790":{"position":[[58,1],[70,1],[115,3],[119,3],[123,7],[144,1],[195,1],[237,2],[240,3],[258,3],[304,1],[318,1],[338,1],[350,1],[395,3],[399,3],[403,7],[424,1],[472,1],[487,2],[490,3],[508,2],[533,2],[536,1],[564,1],[592,1],[636,1],[638,2]]},"792":{"position":[[73,1],[85,1],[130,3],[134,3],[138,7],[159,1],[210,1],[238,1],[245,2],[248,3],[266,2],[276,2],[321,1],[335,1],[355,1],[367,1],[412,3],[416,3],[420,7],[441,1],[489,1],[496,2],[499,3],[517,2],[550,2],[553,1],[581,1],[609,1],[653,1],[655,2]]},"800":{"position":[[63,1],[75,1],[85,1],[113,1],[115,1],[127,1],[129,3],[146,1],[183,1],[264,1],[278,1],[298,1],[310,1],[320,1],[348,1],[350,1],[362,1],[364,3],[381,1],[449,2],[452,1],[480,1],[508,1],[550,3]]},"802":{"position":[[58,1],[70,1],[80,1],[108,1],[110,1],[122,1],[124,3],[141,1],[178,1],[220,2],[223,3],[241,3],[285,1],[299,1],[319,1],[331,1],[341,1],[369,1],[371,1],[383,1],[385,3],[402,1],[438,1],[453,2],[456,3],[474,2],[497,2],[500,1],[528,1],[556,1],[598,1],[600,2]]},"804":{"position":[[73,1],[85,1],[95,1],[123,1],[125,1],[137,1],[139,3],[156,1],[193,1],[221,1],[228,2],[231,3],[249,2],[259,2],[302,1],[316,1],[336,1],[348,1],[358,1],[386,1],[388,1],[400,1],[402,3],[419,1],[455,1],[462,2],[465,3],[483,2],[514,2],[517,1],[545,1],[573,1],[615,1],[617,2]]},"810":{"position":[[63,1],[75,1],[103,1],[105,1],[120,1],[122,1],[147,1],[186,1],[269,1],[283,1],[303,1],[315,1],[343,1],[345,1],[360,1],[362,1],[387,1],[457,2],[460,1],[488,1],[516,1],[560,3]]},"812":{"position":[[58,1],[70,1],[98,1],[100,1],[115,1],[117,1],[142,1],[181,1],[223,2],[226,3],[244,3],[290,1],[304,1],[324,1],[336,1],[364,1],[366,1],[381,1],[383,1],[408,1],[444,1],[459,2],[462,3],[480,2],[505,2],[508,1],[536,1],[564,1],[608,1],[610,2]]},"814":{"position":[[73,1],[85,1],[113,1],[115,1],[130,1],[132,1],[157,1],[196,1],[224,1],[231,2],[234,3],[252,2],[262,2],[307,1],[321,1],[341,1],[353,1],[381,1],[383,1],[398,1],[400,1],[425,1],[461,1],[468,2],[471,3],[489,2],[522,2],[525,1],[553,1],[581,1],[625,1],[627,2]]},"821":{"position":[[45,1]]},"825":{"position":[[46,1],[58,1],[94,1],[136,1],[209,1],[223,1],[243,1],[255,1],[291,1],[354,2],[357,1],[385,1],[413,1],[457,3]]},"827":{"position":[[56,1],[68,1],[104,1],[146,1],[178,2],[181,3],[199,3],[245,1],[259,1],[279,1],[291,1],[327,1],[364,1],[371,2],[374,3],[392,2],[417,2],[420,1],[448,1],[476,1],[520,1],[522,2]]},"835":{"position":[[63,1],[75,1],[111,1],[113,1],[138,1],[173,1],[256,1],[270,1],[290,1],[302,1],[338,1],[340,1],[365,1],[431,2],[434,1],[462,1],[490,1],[534,3]]},"837":{"position":[[58,1],[70,1],[106,1],[108,1],[133,1],[168,1],[210,2],[213,3],[231,3],[277,1],[291,1],[311,1],[323,1],[359,1],[361,1],[386,1],[418,1],[433,2],[436,3],[454,2],[479,2],[482,1],[510,1],[538,1],[582,1],[584,2]]},"839":{"position":[[73,1],[85,1],[121,1],[123,1],[148,1],[183,1],[211,1],[218,2],[221,3],[239,2],[249,2],[294,1],[308,1],[328,1],[340,1],[376,1],[378,1],[403,1],[435,1],[442,2],[445,3],[463,2],[496,2],[499,1],[527,1],[555,1],[599,1],[601,2]]},"848":{"position":[[46,1],[58,1],[155,1],[228,1],[242,1],[262,1],[274,1],[392,2],[395,1],[423,1],[451,1],[495,3]]},"850":{"position":[[56,1],[68,1],[165,1],[197,2],[200,3],[218,3],[264,1],[278,1],[298,1],[310,1],[402,1],[409,2],[412,3],[430,2],[455,2],[458,1],[486,1],[514,1],[558,1],[560,2]]},"859":{"position":[[105,1],[125,1],[228,2],[259,7],[284,1],[331,2],[334,3],[371,1],[385,1],[405,1],[419,1],[458,1],[561,2],[592,7],[665,1],[693,1],[721,1],[723,2],[726,3],[763,3]]},"861":{"position":[[103,1],[123,1],[180,1],[233,2],[248,2],[261,3],[265,3],[269,2],[300,7],[325,1],[372,2],[375,3],[412,1],[426,1],[446,1],[460,1],[499,1],[556,1],[609,2],[624,2],[637,3],[641,3],[645,2],[676,7],[749,1],[777,1],[805,1],[807,2],[810,3],[847,3]]},"863":{"position":[[103,1],[123,1],[180,1],[182,2],[185,3],[266,2],[269,3],[273,2],[304,7],[329,1],[376,2],[379,3],[416,1],[430,1],[450,1],[464,1],[503,1],[560,1],[562,2],[565,3],[647,3],[651,2],[682,7],[755,1],[783,1],[811,1],[813,2],[816,3],[853,3]]},"865":{"position":[[121,1],[141,1],[198,1],[200,2],[203,3],[212,1],[214,2],[265,2],[361,2],[364,3],[368,2],[399,7],[424,1],[471,2],[474,3],[511,1],[525,1],[545,1],[559,1],[598,1],[655,1],[657,2],[660,3],[669,1],[671,2],[722,2],[818,2],[821,3],[825,2],[856,7],[929,1],[957,1],[985,1],[987,2],[990,3],[1027,3]]},"867":{"position":[[290,1],[310,1],[367,1],[369,2],[372,3],[443,3],[447,2],[478,7],[503,1],[550,2],[553,3],[590,1],[604,1],[624,1],[638,1],[652,1],[756,1],[770,1],[790,1],[804,1],[843,1],[900,1],[902,2],[905,3],[976,3],[980,2],[1011,7],[1084,1],[1112,1],[1140,1],[1142,2],[1145,3],[1182,3],[1265,1],[1312,1],[1340,1],[1360,3]]},"869":{"position":[[13,1],[77,1],[129,1]]},"871":{"position":[[62,1],[105,1],[144,1],[179,3],[201,1],[258,1],[280,3],[284,2],[315,7],[343,1],[385,1],[428,1],[468,1],[525,1],[554,2],[557,1],[599,3],[603,2],[606,3],[610,2],[641,7],[669,1],[779,2],[782,1],[810,1],[838,1],[867,3],[941,2],[944,1],[972,1],[1000,1],[1029,3],[1103,2],[1106,1],[1134,1],[1162,1],[1191,3]]},"878":{"position":[[46,1],[58,1],[68,1],[96,1],[115,1],[143,1],[214,1],[228,1],[248,1],[260,1],[270,1],[298,1],[317,1],[366,2],[369,1],[397,1],[425,1],[467,3]]},"880":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[185,2],[188,3],[206,3],[250,1],[264,1],[284,1],[296,1],[306,1],[334,1],[353,1],[378,1],[385,2],[388,3],[406,2],[429,2],[432,1],[460,1],[488,1],[530,1],[532,2]]},"882":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[204,2],[207,3],[225,3],[269,1],[283,1],[303,1],[315,1],[325,1],[353,1],[372,1],[397,1],[423,2],[426,3],[444,2],[467,2],[470,1],[498,1],[526,1],[568,1],[570,2]]},"887":{"position":[[34,1],[136,3],[155,2],[158,1],[171,1],[178,1],[188,1],[221,2],[224,1],[253,2],[313,3],[317,1],[319,2],[344,2],[347,1],[360,1],[367,1],[377,1],[408,2],[411,1],[470,2],[473,1],[516,3],[520,3],[524,1],[526,2]]},"891":{"position":[[46,1],[58,1],[86,1],[104,1],[146,1],[219,1],[233,1],[253,1],[265,1],[293,1],[311,1],[374,2],[377,1],[405,1],[433,1],[477,3]]},"893":{"position":[[56,1],[68,1],[96,1],[114,1],[156,1],[188,2],[191,3],[209,3],[255,1],[269,1],[289,1],[301,1],[329,1],[347,1],[384,1],[391,2],[394,3],[412,2],[437,2],[440,1],[468,1],[496,1],[540,1],[542,2]]},"900":{"position":[[35,1],[68,1],[124,1],[194,1],[233,1],[277,1],[373,2],[389,1],[401,1],[408,1],[410,2],[464,1],[509,3],[513,1],[515,1],[530,1],[606,2],[609,1],[611,2],[643,2],[693,3],[697,2],[783,2],[856,2],[886,2],[976,3],[1018,2],[1021,1],[1083,3],[1112,2],[1115,1],[1137,1],[1324,2],[1327,3],[1356,4],[1361,3],[1365,10],[1376,7],[1393,4],[1424,7],[1432,4],[1437,8],[1446,6],[1453,11],[1496,3],[1500,3]]},"902":{"position":[[35,1],[74,1],[132,1],[208,2],[211,1],[395,1],[419,3],[461,2],[464,1],[526,3],[543,1],[652,3],[679,2],[682,1],[756,1],[758,2],[807,2],[881,1],[883,2],[939,1],[963,1],[1076,1],[1083,1],[1085,2],[1147,1],[1216,1],[1218,3],[1222,3],[1267,3]]},"904":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[303,3],[310,2],[324,3],[333,2],[347,1],[373,1],[416,2],[419,1],[431,2],[446,3],[485,1],[487,1],[587,2],[614,2],[631,2],[641,2],[644,2],[647,1],[681,1],[683,1],[691,3],[701,3],[715,3],[729,3],[752,2],[766,1],[806,3],[851,2],[922,3],[956,2],[1088,2],[1091,3],[1116,2],[1136,1],[1215,4],[1220,4],[1225,6],[1267,2],[1319,3],[1371,2],[1446,3],[1488,2],[1568,1],[1604,3],[1608,3],[1626,2],[1653,1],[1753,2],[1756,1],[1758,3],[1860,2],[1893,1],[1924,3],[1979,1],[1986,1],[2009,2],[2012,1],[2043,3],[2064,2],[2108,3],[2112,1],[2114,3],[2136,5],[2142,3],[2153,1],[2155,1],[2169,1],[2188,1],[2196,1],[2210,1],[2229,1],[2237,1],[2250,1],[2269,1],[2277,1],[2290,1],[2309,1],[2317,1],[2331,1],[2350,1],[2369,2]]},"906":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[409,2],[423,1],[463,3],[508,2],[579,3],[613,2],[745,2],[748,3],[773,2],[793,1],[872,4],[877,4],[882,6],[924,2],[976,3],[994,2],[1011,1],[1047,1],[1084,2],[1108,2],[1111,1],[1137,3],[1158,2],[1204,3],[1226,5],[1232,3],[1243,1],[1245,1],[1259,1],[1273,1],[1281,1],[1295,1],[1309,1],[1317,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1401,2]]},"908":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[435,2],[449,1],[489,3],[534,2],[605,3],[639,2],[771,2],[774,3],[799,2],[819,1],[898,4],[903,4],[908,6],[950,2],[1002,3],[1020,2],[1036,1],[1066,1],[1076,1],[1130,1],[1194,2],[1197,2],[1221,2],[1224,1],[1247,2],[1250,1],[1276,3],[1297,2],[1343,3],[1347,3],[1369,5],[1375,3],[1386,1],[1388,1],[1402,1],[1416,1],[1424,1],[1438,1],[1452,1],[1460,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1544,2]]},"910":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[446,2],[460,1],[500,3],[545,2],[616,3],[650,2],[782,2],[785,3],[810,2],[830,1],[909,4],[914,4],[919,6],[961,2],[1013,3],[1031,2],[1048,1],[1084,1],[1121,2],[1145,2],[1148,1],[1174,3],[1195,2],[1239,3],[1261,5],[1267,3],[1278,1],[1280,1],[1294,1],[1308,1],[1316,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1400,1],[1414,1],[1422,1],[1436,2]]},"912":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[472,2],[486,1],[526,3],[571,2],[642,3],[676,2],[808,2],[811,3],[836,2],[856,1],[935,4],[940,4],[945,6],[987,2],[1039,3],[1057,2],[1073,1],[1103,1],[1113,1],[1167,1],[1231,2],[1234,2],[1258,2],[1261,1],[1284,2],[1287,1],[1313,3],[1334,2],[1378,3],[1382,3],[1404,5],[1410,3],[1421,1],[1423,1],[1437,1],[1451,1],[1459,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1543,1],[1557,1],[1565,1],[1579,2]]},"916":{"position":[[17,1],[354,1],[531,1]]},"922":{"position":[[166,1],[198,1],[231,3],[241,3],[255,3],[259,3],[301,2],[304,1],[332,1],[379,1],[381,3],[508,1],[540,1],[567,3],[577,3],[591,3],[595,3],[636,2],[639,1],[667,1],[724,1],[726,3],[860,1],[899,1],[953,1],[961,3],[971,3],[985,3],[989,3],[1046,2],[1049,1],[1077,1],[1141,1],[1143,3],[1280,1],[1298,2],[1301,1],[1329,1],[1375,1],[1396,3],[1613,1],[1631,2],[1634,1],[1662,1],[1706,1],[1727,3]]},"924":{"position":[[184,1],[203,1],[242,3],[252,3],[266,3],[270,3],[274,1],[288,1],[316,1],[336,1],[338,1],[489,1],[516,3],[526,3],[540,3],[544,3],[552,1],[571,1],[601,1],[615,1],[643,1],[663,1],[665,1],[830,1],[884,1],[892,3],[902,3],[916,3],[920,3],[928,1],[972,1],[986,1],[1014,1],[1061,1],[1063,1],[1165,1],[1180,1],[1216,1],[1242,1],[1256,1],[1284,1],[1322,1],[1324,1],[1508,1],[1523,1],[1557,1],[1583,1],[1597,1],[1625,1],[1661,1],[1663,1]]},"928":{"position":[[15,3],[19,1],[66,2],[76,1],[90,1],[122,1],[130,1],[185,1],[213,1],[241,1],[243,1],[251,3],[261,3],[275,3],[289,3],[293,2],[303,2],[306,2],[309,1],[323,1],[344,3],[389,2],[450,3],[484,2],[606,2],[609,3],[634,2],[654,1],[723,4],[728,4],[733,6],[775,2],[827,3],[845,2],[862,1],[895,1],[932,2],[962,2],[965,1],[991,3],[1012,2],[1058,3],[1092,5],[1098,3],[1109,1],[1111,1],[1125,1],[1139,1],[1147,1],[1161,1],[1175,1],[1183,1],[1196,1],[1210,1],[1218,1],[1231,1],[1245,1],[1253,1],[1267,2],[1270,3],[1274,1],[1321,2],[1331,1],[1396,1],[1440,1],[1534,1],[1553,1],[1578,1],[1610,1],[1612,3],[1683,2],[1713,1],[1742,1],[1774,1],[1776,3],[1804,2],[1823,1],[1907,1],[1909,3],[1965,2],[1991,1],[2077,1],[2079,3],[2112,2],[2133,1],[2217,1],[2219,3],[2297,2],[2319,1],[2405,1],[2407,3],[2435,2],[2456,1],[2542,1],[2544,3],[2600,2],[2628,1],[2716,1],[2718,3],[2751,2],[2774,1],[2860,1],[2862,3],[2940,2],[2964,1],[3052,1],[3054,3],[3085,2],[3105,1],[3125,1],[3127,1]]},"930":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[329,1],[355,1],[398,2],[401,1],[413,2],[428,3],[467,1],[469,1],[569,2],[596,2],[613,2],[623,2],[626,2],[629,1],[663,1],[665,1],[673,3],[683,3],[697,3],[711,3],[715,2],[729,1],[769,3],[814,2],[885,3],[919,2],[1051,2],[1054,3],[1079,2],[1099,1],[1178,4],[1183,4],[1188,6],[1230,2],[1282,3],[1334,2],[1409,3],[1451,2],[1531,1],[1567,3],[1571,3],[1589,2],[1616,1],[1716,2],[1719,1],[1721,3],[1823,2],[1856,1],[1887,3],[1942,1],[1949,1],[1972,2],[1975,1],[2006,3],[2027,2],[2073,3],[2077,1],[2079,3],[2101,5],[2107,3],[2118,1],[2120,1],[2134,1],[2153,1],[2161,1],[2175,1],[2194,1],[2202,1],[2215,1],[2234,1],[2242,1],[2255,1],[2274,1],[2282,1],[2296,1],[2315,1],[2334,2]]}}}],["0",{"_index":219,"t":{"638":{"position":[[257,2]]},"664":{"position":[[910,2],[959,2],[1433,2],[1482,2]]},"707":{"position":[[121,2]]},"729":{"position":[[579,2],[596,2],[609,2],[654,2],[670,1]]},"731":{"position":[[475,2],[492,2],[505,2],[551,2],[567,1],[602,2],[619,2],[632,2],[677,2],[693,1]]},"733":{"position":[[792,2],[809,2],[822,2],[867,2],[883,1]]},"762":{"position":[[291,2]]},"887":{"position":[[173,2],[362,2]]},"900":{"position":[[1308,2],[1321,2]]},"904":{"position":[[313,2],[2367,1]]},"910":{"position":[[292,2]]},"912":{"position":[[292,2]]},"930":{"position":[[2332,1]]}}}],["0deprec",{"_index":987,"t":{"735":{"position":[[0,11]]},"918":{"position":[[101,11]]}}}],["0xffffff",{"_index":1195,"t":{"900":{"position":[[876,9]]},"902":{"position":[[386,8]]}}}],["1",{"_index":220,"t":{"638":{"position":[[260,2]]},"666":{"position":[[1516,4],[1822,3]]},"668":{"position":[[209,1],[765,1],[1040,1]]},"675":{"position":[[517,2],[703,1],[760,3],[764,2],[816,1],[854,1],[858,1],[986,3],[990,3],[1027,1],[1031,1]]},"701":{"position":[[58,1],[155,1],[285,1],[357,1]]},"707":{"position":[[135,1]]},"709":{"position":[[189,3],[222,3],[321,3],[454,3],[516,3]]},"722":{"position":[[35,1],[39,1],[129,1],[133,1]]},"725":{"position":[[221,1],[225,1],[686,1],[690,1]]},"727":{"position":[[239,1],[243,1]]},"729":{"position":[[449,2],[454,2]]},"731":{"position":[[326,2],[331,2]]},"733":{"position":[[563,2],[568,2]]},"757":{"position":[[347,2]]},"762":{"position":[[347,2],[353,1]]},"764":{"position":[[2138,2]]},"782":{"position":[[448,2]]},"810":{"position":[[130,3],[370,3]]},"812":{"position":[[125,3],[391,3]]},"814":{"position":[[140,3],[408,3]]},"825":{"position":[[109,3],[306,3]]},"827":{"position":[[119,3],[342,3]]},"835":{"position":[[121,3],[348,3]]},"837":{"position":[[116,3],[369,3]]},"839":{"position":[[131,3],[386,3]]},"871":{"position":[[534,2]]},"891":{"position":[[119,3],[326,3]]},"893":{"position":[[129,3],[362,3]]},"904":{"position":[[336,2],[2275,1]]},"906":{"position":[[1350,1]]},"908":{"position":[[1493,1]]},"910":{"position":[[315,2],[1385,1]]},"912":{"position":[[315,2],[1528,1]]},"922":{"position":[[1278,1],[1282,3],[1611,1],[1615,3]]},"924":{"position":[[1214,1],[1218,4],[1555,1],[1559,4]]},"928":{"position":[[1216,1]]},"930":{"position":[[2240,1]]}}}],["1+1",{"_index":764,"t":{"681":{"position":[[284,3]]}}}],["1+:toadd",{"_index":877,"t":{"698":{"position":[[269,8]]},"764":{"position":[[1783,8]]}}}],["1,2",{"_index":725,"t":{"675":{"position":[[608,5]]}}}],["1.0.0",{"_index":205,"t":{"636":{"position":[[202,8]]},"764":{"position":[[2026,8]]}}}],["1.1",{"_index":221,"t":{"638":{"position":[[263,4]]}}}],["1.1earli",{"_index":1331,"t":{"918":{"position":[[756,8]]}}}],["1.2",{"_index":222,"t":{"638":{"position":[[268,4]]}}}],["1.2releas",{"_index":1335,"t":{"918":{"position":[[848,10]]}}}],["10",{"_index":487,"t":{"664":{"position":[[701,3],[714,3],[1224,3],[1237,3]]},"681":{"position":[[237,2]]},"698":{"position":[[296,2]]},"731":{"position":[[532,3]]},"764":{"position":[[1810,2]]},"900":{"position":[[754,3]]},"902":{"position":[[280,3]]}}}],["1000",{"_index":1163,"t":{"887":{"position":[[322,6],[529,6]]}}}],["1045",{"_index":1182,"t":{"900":{"position":[[504,4]]}}}],["1080",{"_index":779,"t":{"681":{"position":[[864,4]]}}}],["12",{"_index":884,"t":{"701":{"position":[[126,2]]}}}],["120",{"_index":1079,"t":{"762":{"position":[[335,4]]}}}],["123",{"_index":1071,"t":{"762":{"position":[[152,4]]},"900":{"position":[[689,3]]}}}],["1234",{"_index":1193,"t":{"900":{"position":[[817,5]]},"902":{"position":[[330,5]]}}}],["137",{"_index":442,"t":{"662":{"position":[[1171,5],[1725,5]]}}}],["14",{"_index":541,"t":{"666":{"position":[[434,3],[1052,3]]}}}],["16000",{"_index":919,"t":{"705":{"position":[[86,5]]}}}],["18.x",{"_index":112,"t":{"630":{"position":[[60,5]]}}}],["19",{"_index":1133,"t":{"788":{"position":[[160,3],[414,3]]},"790":{"position":[[155,3],[435,3]]},"792":{"position":[[170,3],[452,3]]},"848":{"position":[[112,4],[328,4]]},"850":{"position":[[122,4],[364,4]]}}}],["1998",{"_index":1382,"t":{"926":{"position":[[12,5]]}}}],["1experiment",{"_index":257,"t":{"644":{"position":[[144,13]]},"918":{"position":[[642,13]]}}}],["2",{"_index":223,"t":{"638":{"position":[[273,1]]},"668":{"position":[[221,1],[777,1],[1052,1]]},"675":{"position":[[523,1]]},"696":{"position":[[195,3],[199,4]]},"703":{"position":[[293,1],[464,3]]},"722":{"position":[[95,1],[189,1]]},"725":{"position":[[300,1],[701,1],[705,1],[772,2]]},"727":{"position":[[261,1],[265,1],[376,1]]},"729":{"position":[[636,2]]},"731":{"position":[[338,2],[343,2],[659,2]]},"733":{"position":[[575,2],[580,2],[849,2]]},"900":{"position":[[836,2]]},"902":{"position":[[349,2]]},"904":{"position":[[2235,1]]},"906":{"position":[[1315,1]]},"908":{"position":[[1117,4],[1171,1],[1180,4],[1458,1]]},"910":{"position":[[1350,1]]},"912":{"position":[[1154,4],[1208,1],[1217,4],[1493,1]]},"928":{"position":[[1181,1]]},"930":{"position":[[2200,1]]}}}],["2+3",{"_index":1099,"t":{"764":{"position":[[785,3],[1292,3]]}}}],["2.0",{"_index":736,"t":{"679":{"position":[[238,3]]}}}],["2.rds.amazonaws.com",{"_index":1043,"t":{"753":{"position":[[349,21],[774,21]]},"778":{"position":[[379,21],[735,21]]},"867":{"position":[[402,21],[935,21]]}}}],["20",{"_index":1142,"t":{"810":{"position":[[149,4],[389,4]]},"812":{"position":[[144,4],[410,4]]},"814":{"position":[[159,4],[427,4]]},"891":{"position":[[88,2],[295,2]]},"893":{"position":[[98,2],[331,2]]}}}],["2113931265",{"_index":1196,"t":{"900":{"position":[[907,11]]}}}],["2119",{"_index":1051,"t":{"755":{"position":[[71,5]]},"780":{"position":[[71,5]]},"869":{"position":[[71,5]]}}}],["2130",{"_index":1049,"t":{"755":{"position":[[7,5]]},"780":{"position":[[7,5]]},"869":{"position":[[7,5]]}}}],["2131",{"_index":1054,"t":{"755":{"position":[[123,5]]},"780":{"position":[[123,5]]},"869":{"position":[[123,5]]}}}],["2181036031",{"_index":1197,"t":{"900":{"position":[[936,11]]}}}],["2282",{"_index":1383,"t":{"926":{"position":[[18,5]]}}}],["253",{"_index":1214,"t":{"900":{"position":[[1296,4]]}}}],["2stabl",{"_index":224,"t":{"638":{"position":[[290,7],[298,7]]},"725":{"position":[[0,7]]},"727":{"position":[[0,7]]},"729":{"position":[[0,7]]},"731":{"position":[[0,7]]},"733":{"position":[[0,7]]},"918":{"position":[[1114,7]]},"922":{"position":[[17,7],[396,7],[748,7],[1155,7],[1492,7]]},"924":{"position":[[17,7],[351,7],[685,7],[1073,7],[1418,7]]}}}],["3",{"_index":103,"t":{"628":{"position":[[39,2]]},"638":{"position":[[279,2]]},"672":{"position":[[292,3]]},"675":{"position":[[646,1]]},"696":{"position":[[388,1]]},"703":{"position":[[511,1]]},"709":{"position":[[232,3],[354,3],[364,3],[549,3],[559,3]]},"904":{"position":[[2315,1]]},"906":{"position":[[1385,1]]},"908":{"position":[[1528,1]]},"910":{"position":[[1420,1]]},"912":{"position":[[1563,1]]},"928":{"position":[[1251,1]]},"930":{"position":[[2280,1]]}}}],["33",{"_index":1210,"t":{"900":{"position":[[1261,3]]}}}],["3306",{"_index":778,"t":{"681":{"position":[[829,4]]},"747":{"position":[[189,5],[464,5]]},"757":{"position":[[166,4],[407,4]]},"764":{"position":[[163,5],[980,5],[1633,5]]},"772":{"position":[[219,5],[419,5]]},"782":{"position":[[178,4],[508,4]]},"861":{"position":[[242,5],[618,5]]},"871":{"position":[[174,4],[594,4]]}}}],["384",{"_index":1212,"t":{"900":{"position":[[1279,4]]}}}],["3legaci",{"_index":1347,"t":{"918":{"position":[[1181,7]]}}}],["4",{"_index":960,"t":{"725":{"position":[[775,1]]},"727":{"position":[[393,1]]},"904":{"position":[[2167,1],[2194,1]]},"906":{"position":[[1257,1],[1279,1]]},"908":{"position":[[1400,1],[1422,1]]},"910":{"position":[[1292,1],[1314,1]]},"912":{"position":[[1435,1],[1457,1]]},"928":{"position":[[1123,1],[1145,1]]},"930":{"position":[[2132,1],[2159,1]]}}}],["4.5.2",{"_index":941,"t":{"714":{"position":[[224,8]]}}}],["45",{"_index":380,"t":{"660":{"position":[[492,3],[874,3],[1224,4],[1577,4]]},"788":{"position":[[172,4],[426,4]]},"790":{"position":[[167,4],[447,4]]},"792":{"position":[[182,4],[464,4]]},"800":{"position":[[157,4],[392,4]]},"802":{"position":[[152,4],[413,4]]},"804":{"position":[[167,4],[430,4]]},"848":{"position":[[126,5],[342,5]]},"850":{"position":[[136,5],[378,5]]},"878":{"position":[[117,4],[319,4]]},"880":{"position":[[127,4],[355,4]]},"882":{"position":[[127,4],[374,4]]}}}],["5",{"_index":882,"t":{"701":{"position":[[80,3]]},"887":{"position":[[180,2],[369,2]]}}}],["5.6.10",{"_index":1191,"t":{"900":{"position":[[773,9]]}}}],["53",{"_index":443,"t":{"662":{"position":[[1177,3],[1731,4]]}}}],["6",{"_index":883,"t":{"701":{"position":[[84,3]]}}}],["6.9.0",{"_index":1118,"t":{"764":{"position":[[2207,8]]}}}],["60000",{"_index":494,"t":{"664":{"position":[[810,6],[890,7],[1333,6],[1413,7]]}}}],["8",{"_index":1194,"t":{"900":{"position":[[853,2]]},"902":{"position":[[366,2]]}}}],["8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":1025,"t":{"749":{"position":[[163,43]]},"774":{"position":[[193,43]]},"863":{"position":[[216,43]]}}}],["_err",{"_index":950,"t":{"722":{"position":[[54,6],[148,6]]},"725":{"position":[[240,6],[377,6],[718,6],[853,6]]},"727":{"position":[[314,6]]},"729":{"position":[[493,6]]},"731":{"position":[[384,6]]},"733":{"position":[[706,6]]}}}],["a,b,c,d",{"_index":728,"t":{"677":{"position":[[31,7]]}}}],["a.j",{"_index":1055,"t":{"757":{"position":[[32,4]]},"782":{"position":[[44,4]]},"871":{"position":[[40,4]]}}}],["aberta",{"_index":464,"t":{"664":{"position":[[142,7]]}}}],["abov",{"_index":858,"t":{"694":{"position":[[708,5]]}}}],["accept",{"_index":782,"t":{"681":{"position":[[976,6]]}}}],["access",{"_index":739,"t":{"679":{"position":[[357,6]]},"718":{"position":[[57,7]]},"720":{"position":[[51,7]]},"739":{"position":[[78,6]]},"904":{"position":[[655,7]]},"906":{"position":[[331,7]]},"908":{"position":[[331,7]]},"910":{"position":[[349,7]]},"912":{"position":[[349,7]]},"914":{"position":[[146,6]]},"928":{"position":[[221,7]]},"930":{"position":[[637,7]]}}}],["accord",{"_index":679,"t":{"670":{"position":[[2435,9]]}}}],["accordingli",{"_index":633,"t":{"670":{"position":[[760,12]]}}}],["acima",{"_index":511,"t":{"664":{"position":[[1777,5],[2009,5],[2347,5],[2577,5]]}}}],["ack",{"_index":911,"t":{"703":{"position":[[641,3]]}}}],["acompanhamento",{"_index":56,"t":{"622":{"position":[[524,14]]}}}],["action",{"_index":254,"t":{"644":{"position":[[101,7],[238,7],[335,7],[530,7]]}}}],["activ",{"_index":1349,"t":{"918":{"position":[[1289,6]]}}}],["ad",{"_index":1368,"t":{"922":{"position":[[122,6]]}}}],["add(group",{"_index":1146,"t":{"859":{"position":[[0,10]]},"861":{"position":[[0,10]]},"863":{"position":[[0,10]]},"865":{"position":[[0,10]]},"867":{"position":[[0,10]]},"871":{"position":[[0,10]]}}}],["addit",{"_index":281,"t":{"646":{"position":[[228,10]]},"670":{"position":[[599,10]]},"672":{"position":[[245,10],[296,10]]},"679":{"position":[[3,8]]},"681":{"position":[[905,8]]},"690":{"position":[[251,8]]},"692":{"position":[[3,8]]}}}],["address",{"_index":1358,"t":{"918":{"position":[[1520,10]]}}}],["adicionai",{"_index":389,"t":{"660":{"position":[[626,10],[1390,10]]},"662":{"position":[[1311,10],[1897,10]]},"916":{"position":[[496,11]]}}}],["adicionalment",{"_index":532,"t":{"664":{"position":[[2766,15]]}}}],["adquirir",{"_index":520,"t":{"664":{"position":[[2221,8]]}}}],["advanc",{"_index":989,"t":{"737":{"position":[[80,8]]}}}],["affect",{"_index":1273,"t":{"904":{"position":[[2352,8]]},"930":{"position":[[2317,8]]}}}],["affectedrow",{"_index":805,"t":{"688":{"position":[[222,13]]},"729":{"position":[[242,12],[582,13]]},"731":{"position":[[478,13],[605,13]]},"733":{"position":[[795,13]]},"904":{"position":[[503,15]]},"930":{"position":[[485,15]]}}}],["ag",{"_index":379,"t":{"660":{"position":[[484,5],[853,5],[1216,5],[1556,5]]},"662":{"position":[[1150,5],[1704,5]]},"666":{"position":[[412,5],[1030,5]]},"788":{"position":[[106,6],[360,6]]},"790":{"position":[[101,6],[381,6]]},"792":{"position":[[116,6],[398,6]]},"800":{"position":[[121,5],[356,5]]},"802":{"position":[[116,5],[377,5]]},"804":{"position":[[131,5],[394,5]]},"810":{"position":[[97,5],[337,5]]},"812":{"position":[[92,5],[358,5]]},"814":{"position":[[107,5],[375,5]]},"848":{"position":[[89,6],[305,6]]},"850":{"position":[[99,6],[341,6]]},"878":{"position":[[109,5],[311,5]]},"880":{"position":[[119,5],[347,5]]},"882":{"position":[[119,5],[366,5]]},"891":{"position":[[80,5],[287,5]]},"893":{"position":[[90,5],[323,5]]}}}],["again",{"_index":699,"t":{"672":{"position":[[396,6]]},"766":{"position":[[246,6]]}}}],["aim",{"_index":270,"t":{"646":{"position":[[7,4]]}}}],["ajuda",{"_index":457,"t":{"664":{"position":[[31,5]]},"668":{"position":[[1298,5],[1315,6]]}}}],["algo",{"_index":91,"t":{"626":{"position":[[14,4]]},"664":{"position":[[2403,4],[2634,4]]}}}],["algorithm",{"_index":684,"t":{"670":{"position":[[2592,9]]}}}],["algoritm",{"_index":700,"t":{"672":{"position":[[502,9]]}}}],["allow",{"_index":184,"t":{"634":{"position":[[181,6]]}}}],["alongsid",{"_index":201,"t":{"636":{"position":[[90,9]]}}}],["alterada",{"_index":1290,"t":{"916":{"position":[[140,8]]}}}],["alternativament",{"_index":517,"t":{"664":{"position":[[2170,17]]}}}],["alway",{"_index":300,"t":{"650":{"position":[[192,6]]},"670":{"position":[[1488,6],[2239,6]]},"904":{"position":[[1830,6]]},"930":{"position":[[1793,6]]}}}],["além",{"_index":429,"t":{"662":{"position":[[472,4]]}}}],["amazon",{"_index":1036,"t":{"753":{"position":[[44,6],[101,6],[376,7],[801,7]]},"755":{"position":[[36,6],[138,6]]},"778":{"position":[[56,6],[113,6],[406,7],[762,7]]},"780":{"position":[[36,6],[138,6]]},"867":{"position":[[52,6],[109,6],[429,7],[962,7]]},"869":{"position":[[36,6],[138,6]]}}}],["analisador",{"_index":1285,"t":{"916":{"position":[[64,10]]}}}],["anoth",{"_index":618,"t":{"670":{"position":[[372,7]]}}}],["answer",{"_index":1280,"t":{"914":{"position":[[22,7]]},"922":{"position":[[84,7]]},"924":{"position":[[84,7]]}}}],["anterior",{"_index":462,"t":{"664":{"position":[[119,8]]}}}],["ao",{"_index":465,"t":{"664":{"position":[[150,2]]},"668":{"position":[[890,2],[1198,2]]},"916":{"position":[[167,2]]}}}],["apena",{"_index":587,"t":{"668":{"position":[[370,6]]}}}],["api",{"_index":6,"t":{"622":{"position":[[45,3]]},"624":{"position":[[247,3]]},"646":{"position":[[76,3]]},"666":{"position":[[32,4]]},"670":{"position":[[1303,3]]},"692":{"position":[[79,3]]},"916":{"position":[[132,3],[390,3]]}}}],["aplica",{"_index":585,"t":{"668":{"position":[[297,7],[359,7]]}}}],["aplicada",{"_index":33,"t":{"622":{"position":[[267,9]]}}}],["approach",{"_index":1332,"t":{"918":{"position":[[817,11]]}}}],["aqui",{"_index":353,"t":{"658":{"position":[[270,5]]}}}],["arg",{"_index":1228,"t":{"902":{"position":[[772,5]]}}}],["argument",{"_index":791,"t":{"684":{"position":[[89,9]]}}}],["argumento",{"_index":34,"t":{"622":{"position":[[279,10]]}}}],["arguments[1",{"_index":1230,"t":{"902":{"position":[[941,13],[1149,13]]}}}],["arguments[2",{"_index":1231,"t":{"902":{"position":[[965,13]]}}}],["arquivo",{"_index":93,"t":{"626":{"position":[[41,7]]}}}],["array",{"_index":575,"t":{"668":{"position":[[89,6],[874,5],[883,6],[905,5],[1182,5],[1191,6],[1213,5]]},"675":{"position":[[398,5],[942,5]]},"677":{"position":[[139,5],[148,6]]},"688":{"position":[[536,5]]},"703":{"position":[[230,5],[318,5]]},"725":{"position":[[11,5]]},"882":{"position":[[614,5]]},"902":{"position":[[824,7],[840,7]]}}}],["array.isarray(arguments[1",{"_index":1229,"t":{"902":{"position":[[851,29]]}}}],["asc",{"_index":1259,"t":{"904":{"position":[[1595,4]]},"906":{"position":[[1078,5]]},"908":{"position":[[1107,3],[1161,3]]},"910":{"position":[[1115,5]]},"912":{"position":[[1144,3],[1198,3]]},"928":{"position":[[926,5]]},"930":{"position":[[1558,4]]}}}],["ascertain",{"_index":1340,"t":{"918":{"position":[[1045,9]]}}}],["ask",{"_index":604,"t":{"670":{"position":[[43,3]]},"914":{"position":[[42,5]]}}}],["associada",{"_index":476,"t":{"664":{"position":[[282,9]]}}}],["assur",{"_index":1312,"t":{"918":{"position":[[162,6]]}}}],["async",{"_index":538,"t":{"666":{"position":[[72,5],[121,5],[1211,5]]},"696":{"position":[[0,5],[224,5]]},"764":{"position":[[92,5],[1962,5]]},"904":{"position":[[634,6]]},"906":{"position":[[310,6]]},"908":{"position":[[310,6]]},"910":{"position":[[328,6]]},"912":{"position":[[328,6]]},"928":{"position":[[296,6]]},"930":{"position":[[616,6]]}}}],["asynchron",{"_index":631,"t":{"670":{"position":[[703,14]]}}}],["ataqu",{"_index":421,"t":{"662":{"position":[[344,7]]}}}],["atenção",{"_index":1019,"t":{"745":{"position":[[555,7]]},"747":{"position":[[639,7]]},"749":{"position":[[645,7]]},"751":{"position":[[834,7]]},"753":{"position":[[1138,7]]},"859":{"position":[[767,7]]},"861":{"position":[[851,7]]},"863":{"position":[[857,7]]},"865":{"position":[[1046,7]]},"867":{"position":[[1364,7]]}}}],["atingido",{"_index":506,"t":{"664":{"position":[[1605,9]]}}}],["atravé",{"_index":55,"t":{"622":{"position":[[513,7]]}}}],["attach",{"_index":835,"t":{"690":{"position":[[499,6]]}}}],["atualização",{"_index":77,"t":{"624":{"position":[[179,11]]}}}],["auth",{"_index":606,"t":{"670":{"position":[[83,4],[801,4],[952,6],[1869,6]]},"672":{"position":[[702,5],[842,5],[982,5]]},"900":{"position":[[119,4]]}}}],["auth.doublesha1('pass123",{"_index":1173,"t":{"900":{"position":[[235,27]]}}}],["auth.verifytoken",{"_index":1175,"t":{"900":{"position":[[279,17]]}}}],["authcallback",{"_index":1198,"t":{"900":{"position":[[948,13]]}}}],["authent",{"_index":286,"t":{"646":{"position":[[285,14]]},"670":{"position":[[211,14],[610,14]]},"672":{"position":[[34,14],[159,14],[256,14],[412,14]]},"900":{"position":[[962,13]]},"916":{"position":[[737,14]]}}}],["authenticate(param",{"_index":1170,"t":{"900":{"position":[[169,20]]}}}],["authentication::native41",{"_index":680,"t":{"670":{"position":[[2448,24]]}}}],["authnextfactor",{"_index":691,"t":{"672":{"position":[[90,14]]}}}],["author",{"_index":1114,"t":{"764":{"position":[[2144,9]]}}}],["authplugin",{"_index":608,"t":{"670":{"position":[[103,11],[928,12],[2480,11]]},"672":{"position":[[661,12]]}}}],["authswitchhandl",{"_index":653,"t":{"670":{"position":[[1318,17],[1778,18],[2508,17]]}}}],["authswitchrequest",{"_index":669,"t":{"670":{"position":[[2130,17]]}}}],["auto",{"_index":163,"t":{"632":{"position":[[709,4]]}}}],["auto_incr",{"_index":1249,"t":{"904":{"position":[[1030,15]]},"906":{"position":[[687,15]]},"908":{"position":[[713,15]]},"910":{"position":[[724,15]]},"912":{"position":[[750,15]]},"928":{"position":[[548,15]]},"930":{"position":[[993,15]]}}}],["automat",{"_index":1160,"t":{"887":{"position":[[270,13]]}}}],["automaticament",{"_index":514,"t":{"664":{"position":[[1870,15],[2103,15]]}}}],["auxiliar",{"_index":425,"t":{"662":{"position":[[393,8]]}}}],["avail",{"_index":217,"t":{"638":{"position":[[239,9]]},"681":{"position":[[1080,10]]},"788":{"position":[[758,9]]},"790":{"position":[[807,9]]},"792":{"position":[[824,9]]},"800":{"position":[[639,9]]},"802":{"position":[[688,9]]},"804":{"position":[[705,9]]},"810":{"position":[[730,9]]},"812":{"position":[[779,9]]},"814":{"position":[[796,9]]},"825":{"position":[[627,9]]},"827":{"position":[[691,9]]},"835":{"position":[[704,9]]},"837":{"position":[[753,9]]},"839":{"position":[[770,9]]},"848":{"position":[[665,9]]},"850":{"position":[[729,9]]},"878":{"position":[[556,9]]},"880":{"position":[[620,9]]},"882":{"position":[[667,9]]},"891":{"position":[[647,9]]},"893":{"position":[[711,9]]},"918":{"position":[[1330,10]]}}}],["avg",{"_index":31,"t":{"622":{"position":[[254,5]]}}}],["await",{"_index":368,"t":{"660":{"position":[[273,5],[411,5],[785,5]]},"662":{"position":[[897,5],[1080,5]]},"664":{"position":[[1806,5],[2366,5],[2422,5]]},"666":{"position":[[78,6],[203,5],[342,5],[802,5],[960,5],[1484,5]]},"668":{"position":[[454,5],[733,5]]},"696":{"position":[[82,5],[155,5],[204,5],[398,5],[516,5]]},"698":{"position":[[356,5]]},"745":{"position":[[194,5]]},"747":{"position":[[235,5]]},"749":{"position":[[239,5]]},"751":{"position":[[334,5]]},"753":{"position":[[413,5],[545,5],[604,5]]},"764":{"position":[[126,5],[292,5],[373,5],[675,5],[930,5],[1183,5],[1364,5],[2007,7]]},"770":{"position":[[124,5]]},"772":{"position":[[128,5]]},"774":{"position":[[128,5]]},"776":{"position":[[146,5]]},"778":{"position":[[315,5],[488,5],[547,5]]},"788":{"position":[[202,5]]},"790":{"position":[[197,5]]},"792":{"position":[[212,5]]},"800":{"position":[[185,5]]},"802":{"position":[[180,5]]},"804":{"position":[[195,5]]},"810":{"position":[[188,5]]},"812":{"position":[[183,5]]},"814":{"position":[[198,5]]},"825":{"position":[[138,5]]},"827":{"position":[[148,5]]},"835":{"position":[[175,5]]},"837":{"position":[[170,5]]},"839":{"position":[[185,5]]},"848":{"position":[[157,5]]},"850":{"position":[[167,5]]},"859":{"position":[[286,5]]},"861":{"position":[[327,5]]},"863":{"position":[[331,5]]},"865":{"position":[[426,5]]},"867":{"position":[[505,5],[654,5],[713,5]]},"878":{"position":[[145,5]]},"880":{"position":[[155,5]]},"882":{"position":[[155,5]]},"891":{"position":[[148,5]]},"893":{"position":[[158,5]]},"904":{"position":[[768,5],[854,5],[959,5],[1138,5],[1374,5],[1491,5],[1655,5],[2118,5]]},"906":{"position":[[425,5],[511,5],[616,5],[795,5],[1013,5],[1208,5]]},"908":{"position":[[451,5],[537,5],[642,5],[821,5],[1038,5],[1351,5]]},"910":{"position":[[462,5],[548,5],[653,5],[832,5],[1050,5],[1243,5]]},"912":{"position":[[488,5],[574,5],[679,5],[858,5],[1075,5],[1386,5]]},"924":{"position":[[205,5],[573,5],[930,5],[1182,5],[1525,5]]},"928":{"position":[[392,5],[487,5],[656,5],[864,5],[1062,5]]},"930":{"position":[[731,5],[817,5],[922,5],[1101,5],[1337,5],[1454,5],[1618,5],[2083,5]]}}}],["await.j",{"_index":1085,"t":{"764":{"position":[[0,8],[2062,11]]}}}],["b",{"_index":159,"t":{"632":{"position":[[622,1]]},"677":{"position":[[197,1]]}}}],["b.j",{"_index":1056,"t":{"757":{"position":[[37,4]]},"782":{"position":[[49,4]]},"871":{"position":[[45,4]]}}}],["babel",{"_index":1117,"t":{"764":{"position":[[2194,6]]}}}],["babelrc",{"_index":1087,"t":{"764":{"position":[[15,8]]}}}],["back",{"_index":629,"t":{"670":{"position":[[659,4]]}}}],["backend",{"_index":1006,"t":{"741":{"position":[[118,8],[166,8]]}}}],["backward",{"_index":1313,"t":{"918":{"position":[[169,8],[281,8]]}}}],["badg",{"_index":211,"t":{"638":{"position":[[18,6]]},"918":{"position":[[14,6]]}}}],["banco",{"_index":364,"t":{"660":{"position":[[239,5],[1015,5]]},"662":{"position":[[863,5],[1455,5]]},"666":{"position":[[169,5],[304,5],[922,5]]}}}],["bar",{"_index":774,"t":{"681":{"position":[[730,6]]},"694":{"position":[[241,6],[528,6]]}}}],["base",{"_index":843,"t":{"692":{"position":[[73,5]]},"918":{"position":[[983,5]]}}}],["baseado",{"_index":79,"t":{"624":{"position":[[197,7]]}}}],["basic",{"_index":993,"t":{"737":{"position":[[608,5]]}}}],["befor",{"_index":268,"t":{"644":{"position":[[474,6]]},"928":{"position":[[1651,6]]}}}],["begin",{"_index":983,"t":{"733":{"position":[[553,5]]},"904":{"position":[[1555,5]]},"930":{"position":[[1518,5]]}}}],["behavior",{"_index":829,"t":{"690":{"position":[[363,8]]}}}],["below",{"_index":1143,"t":{"823":{"position":[[13,5]]},"846":{"position":[[13,5]]},"876":{"position":[[13,5]]},"889":{"position":[[13,5]]}}}],["bem",{"_index":536,"t":{"666":{"position":[[58,3]]}}}],["benchmark",{"_index":322,"t":{"654":{"position":[[63,10],[85,10],[115,10]]}}}],["beta",{"_index":1208,"t":{"900":{"position":[[1222,7],[1239,7]]}}}],["better",{"_index":277,"t":{"646":{"position":[[170,6]]},"701":{"position":[[449,6]]},"766":{"position":[[336,6]]}}}],["between",{"_index":688,"t":{"670":{"position":[[2648,7]]},"714":{"position":[[107,7]]}}}],["biblioteca",{"_index":579,"t":{"668":{"position":[[166,10]]}}}],["bin.000007",{"_index":1077,"t":{"762":{"position":[[311,12]]}}}],["binari",{"_index":289,"t":{"646":{"position":[[364,6]]},"656":{"position":[[153,7]]},"688":{"position":[[584,6]]},"916":{"position":[[622,6]]}}}],["bind",{"_index":314,"t":{"652":{"position":[[99,8],[173,8]]},"707":{"position":[[4,4]]}}}],["binlog",{"_index":320,"t":{"652":{"position":[[249,6]]}}}],["binlogpo",{"_index":1078,"t":{"762":{"position":[[324,10]]}}}],["binlogstream",{"_index":1068,"t":{"762":{"position":[[100,12]]}}}],["binlogstream.pip",{"_index":1081,"t":{"762":{"position":[[381,18]]}}}],["binário",{"_index":330,"t":{"656":{"position":[[145,7]]},"916":{"position":[[601,7]]}}}],["blob",{"_index":662,"t":{"670":{"position":[[1607,4]]}}}],["block",{"_index":231,"t":{"640":{"position":[[178,6]]},"762":{"position":[[362,8]]},"924":{"position":[[137,6],[435,6],[769,6],[1154,6],[1497,6]]}}}],["bluebird",{"_index":550,"t":{"666":{"position":[[677,11],[696,8],[710,11],[757,10],[893,9]]}}}],["boolean",{"_index":821,"t":{"690":{"position":[[146,7]]},"707":{"position":[[105,7]]}}}],["both",{"_index":1377,"t":{"922":{"position":[[1417,4],[1748,4]]},"924":{"position":[[1343,4],[1682,4]]}}}],["bound",{"_index":1315,"t":{"918":{"position":[[230,5]]}}}],["branch",{"_index":124,"t":{"632":{"position":[[154,6]]}}}],["browser",{"_index":140,"t":{"632":{"position":[[399,7]]}}}],["buffer",{"_index":627,"t":{"670":{"position":[[630,8],[1667,8]]},"707":{"position":[[222,6]]}}}],["buffer.from",{"_index":1024,"t":{"749":{"position":[[150,12]]},"774":{"position":[[180,12]]},"863":{"position":[[203,12]]}}}],["buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":1027,"t":{"749":{"position":[[429,55]]},"774":{"position":[[384,55]]},"863":{"position":[[583,55]]}}}],["bug",{"_index":1357,"t":{"918":{"position":[[1488,4]]}}}],["build",{"_index":261,"t":{"644":{"position":[[266,5],[306,5]]}}}],["built",{"_index":100,"t":{"628":{"position":[[16,5]]}}}],["bun",{"_index":1053,"t":{"755":{"position":[[119,3]]},"780":{"position":[[119,3]]},"869":{"position":[[119,3]]}}}],["byte",{"_index":825,"t":{"690":{"position":[[242,5]]}}}],["bytes/sec",{"_index":762,"t":{"681":{"position":[[240,9]]}}}],["c",{"_index":441,"t":{"662":{"position":[[1169,1],[1723,1]]},"677":{"position":[[214,1]]},"698":{"position":[[83,1]]},"764":{"position":[[122,1],[1592,1]]}}}],["c.end",{"_index":880,"t":{"698":{"position":[[310,8]]},"764":{"position":[[936,8],[1824,8]]}}}],["c.execute('select",{"_index":876,"t":{"698":{"position":[[251,17]]},"764":{"position":[[484,17],[569,17],[695,17],[727,17],[1765,17]]}}}],["c.query('show",{"_index":874,"t":{"698":{"position":[[187,13]]},"764":{"position":[[298,13],[1701,13]]}}}],["c.query('som",{"_index":1091,"t":{"764":{"position":[[379,13]]}}}],["ca",{"_index":1033,"t":{"751":{"position":[[264,3],[620,3]]},"753":{"position":[[190,2],[202,2]]},"755":{"position":[[153,2]]},"776":{"position":[[294,3],[575,3]]},"778":{"position":[[202,2],[214,2]]},"780":{"position":[[153,2]]},"865":{"position":[[317,3],[774,3]]},"867":{"position":[[198,2],[210,2]]},"869":{"position":[[153,2]]}}}],["cach",{"_index":451,"t":{"662":{"position":[[2042,6]]},"701":{"position":[[215,6],[256,6],[322,5],[416,5],[480,5]]},"703":{"position":[[52,5]]},"705":{"position":[[36,6],[63,6],[173,5]]},"766":{"position":[[282,5]]}}}],["call",{"_index":624,"t":{"670":{"position":[[520,4],[560,4],[1549,5],[2556,6]]},"701":{"position":[[209,5]]},"733":{"position":[[90,4],[630,5],[1034,5]]}}}],["callback",{"_index":360,"t":{"660":{"position":[[151,8]]},"662":{"position":[[788,8]]},"664":{"position":[[431,8],[1722,8],[2298,8]]},"668":{"position":[[432,8],[692,8]]},"670":{"position":[[1443,9]]},"688":{"position":[[453,9]]},"703":{"position":[[598,8]]}}}],["callback'",{"_index":1370,"t":{"922":{"position":[[470,10],[822,10],[1226,10],[1561,10]]}}}],["callback(nul",{"_index":664,"t":{"670":{"position":[[1646,14]]}}}],["callback.j",{"_index":1015,"t":{"745":{"position":[[45,11]]},"747":{"position":[[43,11]]},"749":{"position":[[43,11]]},"751":{"position":[[43,11]]},"753":{"position":[[230,11]]},"770":{"position":[[51,11]]},"772":{"position":[[55,11]]},"774":{"position":[[55,11]]},"776":{"position":[[55,11]]},"778":{"position":[[242,11]]},"788":{"position":[[47,11]]},"790":{"position":[[42,11]]},"792":{"position":[[57,11]]},"800":{"position":[[47,11]]},"802":{"position":[[42,11]]},"804":{"position":[[57,11]]},"810":{"position":[[47,11]]},"812":{"position":[[42,11]]},"814":{"position":[[57,11]]},"825":{"position":[[30,11]]},"827":{"position":[[40,11]]},"835":{"position":[[47,11]]},"837":{"position":[[42,11]]},"839":{"position":[[57,11]]},"848":{"position":[[30,11]]},"850":{"position":[[40,11]]},"859":{"position":[[53,11]]},"861":{"position":[[51,11]]},"863":{"position":[[51,11]]},"865":{"position":[[51,11]]},"867":{"position":[[238,11]]},"878":{"position":[[30,11]]},"880":{"position":[[40,11]]},"882":{"position":[[40,11]]},"891":{"position":[[30,11]]},"893":{"position":[[40,11]]}}}],["candid",{"_index":1336,"t":{"918":{"position":[[859,9]]}}}],["capabilityflag",{"_index":800,"t":{"688":{"position":[[91,15]]},"900":{"position":[[859,16],[889,16],[919,16]]},"902":{"position":[[369,16]]}}}],["case",{"_index":655,"t":{"670":{"position":[[1461,5]]},"681":{"position":[[352,4]]},"753":{"position":[[136,4]]},"778":{"position":[[148,4]]},"867":{"position":[[144,4]]}}}],["catalog",{"_index":1204,"t":{"900":{"position":[[1139,8]]}}}],["catch",{"_index":391,"t":{"660":{"position":[[679,5],[905,5]]},"662":{"position":[[1364,5]]},"664":{"position":[[1935,5]]},"668":{"position":[[979,5]]},"745":{"position":[[264,5]]},"747":{"position":[[305,5]]},"749":{"position":[[309,5]]},"751":{"position":[[404,5]]},"753":{"position":[[483,5],[642,5]]},"764":{"position":[[415,5]]},"770":{"position":[[203,5]]},"772":{"position":[[248,5]]},"774":{"position":[[252,5]]},"776":{"position":[[347,5]]},"778":{"position":[[426,5],[591,5]]},"788":{"position":[[285,5]]},"790":{"position":[[306,5]]},"792":{"position":[[323,5]]},"800":{"position":[[266,5]]},"802":{"position":[[287,5]]},"804":{"position":[[304,5]]},"810":{"position":[[271,5]]},"812":{"position":[[292,5]]},"814":{"position":[[309,5]]},"825":{"position":[[211,5]]},"827":{"position":[[247,5]]},"835":{"position":[[258,5]]},"837":{"position":[[279,5]]},"839":{"position":[[296,5]]},"848":{"position":[[230,5]]},"850":{"position":[[266,5]]},"859":{"position":[[373,5]]},"861":{"position":[[414,5]]},"863":{"position":[[418,5]]},"865":{"position":[[513,5]]},"867":{"position":[[592,5],[758,5]]},"878":{"position":[[216,5]]},"880":{"position":[[252,5]]},"882":{"position":[[271,5]]},"891":{"position":[[221,5]]},"893":{"position":[[257,5]]},"924":{"position":[[131,5],[276,5],[429,5],[603,5],[763,5],[974,5],[1148,5],[1244,5],[1491,5],[1585,5]]}}}],["catch((err",{"_index":647,"t":{"670":{"position":[[1176,12]]},"694":{"position":[[620,12]]},"764":{"position":[[1426,12]]}}}],["catch(console.log",{"_index":567,"t":{"666":{"position":[[1876,19]]}}}],["catch(funct",{"_index":1110,"t":{"764":{"position":[[1880,15]]}}}],["caus",{"_index":1352,"t":{"918":{"position":[[1407,5]]}}}],["caution",{"_index":170,"t":{"632":{"position":[[816,7]]},"918":{"position":[[387,7]]}}}],["cb",{"_index":665,"t":{"670":{"position":[[1835,3]]},"681":{"position":[[754,4]]},"900":{"position":[[190,3]]}}}],["cb(err",{"_index":671,"t":{"670":{"position":[[2196,8]]}}}],["cb(null",{"_index":667,"t":{"670":{"position":[[2065,8]]},"681":{"position":[[874,8]]},"900":{"position":[[391,9],[455,8]]}}}],["cd",{"_index":128,"t":{"632":{"position":[[189,2],[643,2]]}}}],["cert",{"_index":1032,"t":{"751":{"position":[[215,5],[571,5]]},"753":{"position":[[205,4]]},"755":{"position":[[26,5],[156,4]]},"776":{"position":[[245,5],[526,5]]},"778":{"position":[[217,4]]},"780":{"position":[[26,5],[156,4]]},"865":{"position":[[268,5],[725,5]]},"867":{"position":[[213,4]]},"869":{"position":[[26,5],[156,4]]}}}],["cert.pem",{"_index":1029,"t":{"751":{"position":[[64,8],[253,10],[296,11],[609,10],[652,11]]},"753":{"position":[[193,8]]},"776":{"position":[[76,8],[283,10],[326,11],[564,10],[607,11]]},"778":{"position":[[205,8]]},"865":{"position":[[72,8],[306,10],[349,11],[763,10],[806,11]]},"867":{"position":[[201,8]]}}}],["certs/ca",{"_index":1028,"t":{"751":{"position":[[55,8]]},"776":{"position":[[67,8]]},"865":{"position":[[63,8]]}}}],["chamar",{"_index":437,"t":{"662":{"position":[[1000,6],[1586,6]]}}}],["chang",{"_index":142,"t":{"632":{"position":[[420,7]]},"636":{"position":[[39,7],[106,8],[211,8],[227,6],[305,7],[345,7],[365,6]]},"729":{"position":[[24,7]]},"731":{"position":[[24,7]]},"733":{"position":[[24,7]]},"918":{"position":[[301,7],[471,7],[747,8],[930,7]]}}}],["changedrow",{"_index":967,"t":{"729":{"position":[[148,11],[657,12]]},"731":{"position":[[554,12],[680,12]]},"733":{"position":[[870,12]]},"904":{"position":[[572,14]]},"930":{"position":[[554,14]]}}}],["changeus",{"_index":781,"t":{"681":{"position":[[963,12]]},"703":{"position":[[749,13]]}}}],["characterset",{"_index":799,"t":{"688":{"position":[[77,13]]},"900":{"position":[[839,13],[1247,13]]},"902":{"position":[[352,13]]}}}],["check",{"_index":246,"t":{"644":{"position":[[13,5],[119,5],[158,6]]},"648":{"position":[[7,5]]},"650":{"position":[[57,5]]},"722":{"position":[[374,5]]},"737":{"position":[[13,5],[372,8],[477,8]]}}}],["checkout",{"_index":158,"t":{"632":{"position":[[612,8]]}}}],["ci",{"_index":131,"t":{"632":{"position":[[240,2],[679,2]]}}}],["class",{"_index":72,"t":{"624":{"position":[[113,6]]},"737":{"position":[[628,5]]},"928":{"position":[[1428,5],[1669,5]]}}}],["classif",{"_index":1343,"t":{"918":{"position":[[1098,15]]}}}],["classifi",{"_index":1326,"t":{"918":{"position":[[618,10],[1354,10]]}}}],["clear",{"_index":260,"t":{"644":{"position":[[256,5],[292,5]]}}}],["cli",{"_index":153,"t":{"632":{"position":[[541,3]]},"764":{"position":[[2201,5]]}}}],["client",{"_index":86,"t":{"624":{"position":[[300,7]]},"646":{"position":[[384,6]]},"652":{"position":[[68,6],[143,7],[220,6]]},"656":{"position":[[0,7]]},"660":{"position":[[171,7],[950,7]]},"666":{"position":[[579,7]]},"670":{"position":[[51,6],[1577,6],[2656,6]]},"672":{"position":[[68,6]]},"675":{"position":[[171,6]]},"688":{"position":[[276,6],[383,7]]},"690":{"position":[[318,7]]},"741":{"position":[[237,6],[281,6]]}}}],["clientflag",{"_index":1219,"t":{"902":{"position":[[62,11]]}}}],["clientflags.compress",{"_index":1221,"t":{"902":{"position":[[397,21]]}}}],["clientplugindata(password1",{"_index":707,"t":{"672":{"position":[[789,27]]}}}],["clientplugindata(password2",{"_index":709,"t":{"672":{"position":[[929,27]]}}}],["clientplugindata(password3",{"_index":711,"t":{"672":{"position":[[1069,27]]}}}],["clone",{"_index":156,"t":{"632":{"position":[[557,5]]}}}],["close",{"_index":832,"t":{"690":{"position":[[405,5]]},"701":{"position":[[250,5]]},"703":{"position":[[72,6],[635,5]]},"705":{"position":[[187,7]]},"918":{"position":[[895,5]]}}}],["co",{"_index":870,"t":{"698":{"position":[[39,2],[353,2]]},"764":{"position":[[1548,2],[2004,2]]}}}],["co(funct",{"_index":872,"t":{"698":{"position":[[59,12]]},"764":{"position":[[1568,12]]}}}],["co.j",{"_index":1086,"t":{"764":{"position":[[9,5]]}}}],["code",{"_index":230,"t":{"640":{"position":[[173,4]]},"670":{"position":[[821,4]]},"690":{"position":[[230,4]]},"737":{"position":[[24,4]]},"755":{"position":[[98,4]]},"780":{"position":[[98,4]]},"869":{"position":[[98,4]]},"900":{"position":[[425,5],[498,5],[683,5]]}}}],["codificaçõ",{"_index":327,"t":{"656":{"position":[[105,12]]}}}],["collat",{"_index":1308,"t":{"916":{"position":[[694,9]]}}}],["column",{"_index":897,"t":{"703":{"position":[[239,6],[334,6],[480,8]]},"902":{"position":[[832,7],[955,7],[1029,9],[1066,9]]}}}],["columnlength",{"_index":1211,"t":{"900":{"position":[[1265,13]]}}}],["columntyp",{"_index":1213,"t":{"900":{"position":[[1284,11]]}}}],["coluna",{"_index":571,"t":{"668":{"position":[[19,7]]}}}],["com",{"_index":5,"t":{"622":{"position":[[39,3],[476,3]]},"624":{"position":[[294,3]]},"656":{"position":[[27,3]]},"660":{"position":[[233,3],[1009,3]]},"662":{"position":[[0,3],[857,3],[1449,3]]},"664":{"position":[[72,3],[2408,3],[2639,3]]},"666":{"position":[[62,3],[163,3]]},"668":{"position":[[27,3]]},"916":{"position":[[241,3],[384,3]]}}}],["come",{"_index":893,"t":{"703":{"position":[[37,5]]}}}],["começar",{"_index":98,"t":{"626":{"position":[[103,8]]}}}],["command",{"_index":267,"t":{"644":{"position":[[466,7]]},"688":{"position":[[203,8]]},"690":{"position":[[6,7],[162,7],[222,7],[291,8]]},"764":{"position":[[842,8]]},"918":{"position":[[547,7]]}}}],["commandcod",{"_index":823,"t":{"690":{"position":[[190,13]]}}}],["commit",{"_index":269,"t":{"644":{"position":[[495,7]]}}}],["commonli",{"_index":1281,"t":{"914":{"position":[[33,8]]}}}],["como",{"_index":19,"t":{"622":{"position":[[139,4],[196,4],[596,4]]},"626":{"position":[[98,4]]},"662":{"position":[[270,4]]},"664":{"position":[[1654,4]]},"666":{"position":[[768,4]]},"668":{"position":[[81,4]]}}}],["compartilhado",{"_index":1296,"t":{"916":{"position":[[293,13]]}}}],["compat",{"_index":232,"t":{"640":{"position":[[189,10]]},"755":{"position":[[103,10]]},"780":{"position":[[103,10]]},"869":{"position":[[103,10]]},"918":{"position":[[178,14],[290,10],[1122,13]]}}}],["compatívei",{"_index":85,"t":{"624":{"position":[[282,11]]}}}],["compatível",{"_index":4,"t":{"622":{"position":[[28,10]]},"916":{"position":[[373,10]]}}}],["compil",{"_index":181,"t":{"634":{"position":[[121,8]]},"741":{"position":[[101,9]]}}}],["complet",{"_index":148,"t":{"632":{"position":[[500,8]]},"634":{"position":[[52,8]]}}}],["complianc",{"_index":250,"t":{"644":{"position":[[49,10]]}}}],["compon",{"_index":175,"t":{"634":{"position":[[12,9],[165,11],[273,10]]},"636":{"position":[[12,9],[287,10]]},"638":{"position":[[205,10]]},"640":{"position":[[123,9],[231,10]]},"644":{"position":[[173,10]]}}}],["compress",{"_index":288,"t":{"646":{"position":[[352,11]]}}}],["compressão",{"_index":331,"t":{"656":{"position":[[176,11]]},"916":{"position":[[720,10]]}}}],["comprimida",{"_index":84,"t":{"624":{"position":[[271,10]]}}}],["concept",{"_index":990,"t":{"737":{"position":[[89,9]]}}}],["conexão",{"_index":82,"t":{"624":{"position":[[254,7]]},"660":{"position":[[225,7],[1001,7]]},"662":{"position":[[849,7],[1441,7]]},"664":{"position":[[64,7],[111,7],[314,8],[486,7],[1009,7],[1666,7],[1860,7],[2093,7],[2246,7],[2414,7],[2482,7],[2645,7],[2707,7],[2802,7]]},"666":{"position":[[155,7],[732,8],[1690,7]]},"668":{"position":[[289,7]]}}}],["conexõ",{"_index":456,"t":{"664":{"position":[[14,8],[366,8],[731,8],[837,8],[1254,8],[1360,8],[1525,8],[1591,8]]},"666":{"position":[[1597,8]]},"916":{"position":[[794,8]]}}}],["config",{"_index":304,"t":{"650":{"position":[[239,6]]},"670":{"position":[[126,6],[345,6],[1347,6]]},"672":{"position":[[354,6]]},"675":{"position":[[75,6]]},"861":{"position":[[19,7]]},"863":{"position":[[19,7]]},"865":{"position":[[19,7]]},"867":{"position":[[19,7]]},"871":{"position":[[19,7]]}}}],["configuração",{"_index":582,"t":{"668":{"position":[[258,12]]}}}],["confirm",{"_index":1366,"t":{"922":{"position":[[59,9]]},"924":{"position":[[59,9]]}}}],["conflito",{"_index":577,"t":{"668":{"position":[[129,10]]}}}],["conhecida",{"_index":11,"t":{"622":{"position":[[86,9]]}}}],["conjunto",{"_index":455,"t":{"664":{"position":[[2,8],[354,8]]},"916":{"position":[[232,8],[782,8]]}}}],["conn",{"_index":523,"t":{"664":{"position":[[2359,4],[2617,5]]},"666":{"position":[[1704,4],[1791,4]]},"668":{"position":[[447,4],[565,4]]},"670":{"position":[[832,4],[1682,4]]},"672":{"position":[[518,4]]},"696":{"position":[[75,4]]},"718":{"position":[[128,4]]},"720":{"position":[[116,4]]},"725":{"position":[[107,4],[552,4]]},"727":{"position":[[124,4]]},"729":{"position":[[363,4]]},"731":{"position":[[214,4]]},"733":{"position":[[343,4]]},"900":{"position":[[599,6]]},"902":{"position":[[201,6]]},"904":{"position":[[761,4]]},"906":{"position":[[418,4]]},"908":{"position":[[444,4]]},"910":{"position":[[455,4]]},"912":{"position":[[481,4]]},"928":{"position":[[1450,5]]},"930":{"position":[[724,4]]}}}],["conn.clos",{"_index":1189,"t":{"900":{"position":[[700,13],[1482,13]]}}}],["conn.end",{"_index":568,"t":{"666":{"position":[[1908,12]]},"696":{"position":[[210,11]]},"904":{"position":[[2124,11]]},"906":{"position":[[1214,11]]},"908":{"position":[[1357,11]]},"910":{"position":[[1249,11]]},"912":{"position":[[1392,11]]},"930":{"position":[[2089,11]]}}}],["conn.execute('select",{"_index":860,"t":{"696":{"position":[[161,20]]},"722":{"position":[[108,20]]}}}],["conn.execute>(sql",{"_index":984,"t":{"733":{"position":[[652,53]]}}}],["conn.query>('cal",{"_index":1261,"t":{"904":{"position":[[1661,45]]},"930":{"position":[[1624,45]]}}}],["conn.query('drop",{"_index":1245,"t":{"904":{"position":[[860,33],[1380,33]]},"906":{"position":[[517,33]]},"908":{"position":[[543,33]]},"910":{"position":[[554,33]]},"912":{"position":[[580,33]]},"930":{"position":[[823,33],[1343,33]]}}}],["conn.query(sql",{"_index":972,"t":{"729":{"position":[[460,32]]}}}],["conn.query(sql",{"_index":977,"t":{"731":{"position":[[349,34]]}}}],["conn.query('select",{"_index":955,"t":{"725":{"position":[[185,35]]}}}],["conn.query('show",{"_index":957,"t":{"725":{"position":[[321,33],[797,33]]}}}],["conn.query(sql",{"_index":962,"t":{"727":{"position":[[279,34]]}}}],["conn.query Search the documentation - + diff --git a/search-index.json b/search-index.json index 77f2e5956f..8e2909f9ef 100644 --- a/search-index.json +++ b/search-index.json @@ -1 +1 @@ -[{"documents":[{"i":1,"t":"Acknowledgements","u":"/node-mysql2/docs/acknowledgements","b":[]},{"i":3,"t":"API and Configuration","u":"/node-mysql2/docs/api-and-configurations","b":[]},{"i":5,"t":"MySQL2","u":"/node-mysql2/docs","b":[]},{"i":19,"t":"Contributing","u":"/node-mysql2/docs/contributing","b":["Contributing"]},{"i":21,"t":"Documentation","u":"/node-mysql2/docs/documentation","b":["Docs","Documentation"]},{"i":31,"t":"Authentication Switch Request","u":"/node-mysql2/docs/documentation/authentication-switch","b":["Docs","Documentation"]},{"i":35,"t":"Website Contributing Guidelines","u":"/node-mysql2/docs/contributing/website","b":["Contributing"]},{"i":53,"t":"MySQL Server API","u":"/node-mysql2/docs/documentation/mysql-server","b":["Docs","Documentation"]},{"i":62,"t":"Prepared Statements","u":"/node-mysql2/docs/documentation/prepared-statements","b":["Docs","Documentation"]},{"i":75,"t":"Extra Features","u":"/node-mysql2/docs/documentation/extras","b":["Docs","Documentation"]},{"i":84,"t":"Promise Wrappers","u":"/node-mysql2/docs/documentation/promise-wrapper","b":["Docs","Documentation"]},{"i":92,"t":"Using MySQL2 with TypeScript","u":"/node-mysql2/docs/documentation/typescript-examples","b":["Docs","Documentation"]},{"i":118,"t":"Examples","u":"/node-mysql2/docs/examples","b":["Examples"]},{"i":122,"t":"createConnection","u":"/node-mysql2/docs/examples/connections/create-connection","b":["Examples","Connections"]},{"i":141,"t":"Binlog Watcher","u":"/node-mysql2/docs/examples/binlog-watcher","b":["Examples"]},{"i":143,"t":"createPool","u":"/node-mysql2/docs/examples/connections/create-pool","b":["Examples","Connections"]},{"i":162,"t":"createPoolCluster","u":"/node-mysql2/docs/examples/connections/createPoolCluster","b":["Examples","Connections"]},{"i":181,"t":"Prepared Statements","u":"/node-mysql2/docs/examples/queries/prepared-statements","b":["Examples","Queries","Prepared Statements"]},{"i":183,"t":"await — co","u":"/node-mysql2/docs/examples/promise-wrapper/co-await","b":["Examples","Promise Wrapper"]},{"i":185,"t":"DELETE","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","b":["Examples","Queries","Prepared Statements"]},{"i":197,"t":"INSERT","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","b":["Examples","Queries","Prepared Statements"]},{"i":209,"t":"SELECT","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","b":["Examples","Queries","Prepared Statements"]},{"i":219,"t":"UPDATE","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","b":["Examples","Queries","Prepared Statements"]},{"i":231,"t":"Simple Queries","u":"/node-mysql2/docs/examples/queries/simple-queries","b":["Examples","Queries","Simple Queries"]},{"i":233,"t":"DELETE","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","b":["Examples","Queries","Simple Queries"]},{"i":244,"t":"INSERT","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","b":["Examples","Queries","Simple Queries"]},{"i":255,"t":"SELECT","u":"/node-mysql2/docs/examples/queries/simple-queries/select","b":["Examples","Queries","Simple Queries"]},{"i":266,"t":"UPDATE","u":"/node-mysql2/docs/examples/queries/simple-queries/update","b":["Examples","Queries","Simple Queries"]},{"i":277,"t":"MySQL Proxy","u":"/node-mysql2/docs/examples/tests/mysql-proxy","b":["Examples","Tests"]},{"i":279,"t":"Pool","u":"/node-mysql2/docs/examples/tests/pool","b":["Examples","Tests"]},{"i":281,"t":"Server","u":"/node-mysql2/docs/examples/tests/server","b":["Examples","Tests"]},{"i":283,"t":"Basic Custom Class","u":"/node-mysql2/docs/examples/typescript/basic-custom-class","b":["Examples","TypeScript"]},{"i":285,"t":"Procedure Call Packet","u":"/node-mysql2/docs/examples/typescript/procedure-call/index","b":["Examples","TypeScript","Procedure Call"]},{"i":287,"t":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/docs/examples/typescript/procedure-call/row-as-array","b":["Examples","TypeScript","Procedure Call"]},{"i":289,"t":"Row Data Packet","u":"/node-mysql2/docs/examples/typescript/row-data/index","b":["Examples","TypeScript","Row Data"]},{"i":291,"t":"Row Data Packet (Multi Statements)","u":"/node-mysql2/docs/examples/typescript/row-data/multi-statements","b":["Examples","TypeScript","Row Data"]},{"i":293,"t":"Row Data Packet (Row as Array)","u":"/node-mysql2/docs/examples/typescript/row-data/row-as-array","b":["Examples","TypeScript","Row Data"]},{"i":295,"t":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/docs/examples/typescript/row-data/row-as-array-multi-statements","b":["Examples","TypeScript","Row Data"]},{"i":297,"t":"Frequently Asked Questions","u":"/node-mysql2/docs/faq","b":["FAQ"]},{"i":299,"t":"How to handle errors?","u":"/node-mysql2/docs/faq/how-to-handle-errors","b":["FAQ"]},{"i":307,"t":"History and Why MySQL2","u":"/node-mysql2/docs/history-and-why-mysq2","b":[]},{"i":309,"t":"Stability Badges","u":"/node-mysql2/docs/stability-badges","b":[]}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/1",[0,4.28]],["t/3",[1,2.912,2,3.435]],["t/5",[3,3.2]],["t/19",[4,3.629]],["t/21",[5,4.28]],["t/31",[6,2.868,7,2.868,8,2.868]],["t/35",[4,2.431,9,2.868,10,2.868]],["t/53",[1,2.431,11,2.431,12,2.431]],["t/62",[13,2.912,14,2.31]],["t/75",[15,3.435,16,3.435]],["t/84",[17,3.435,18,3.435]],["t/92",[3,2.144,19,2.868,20,2.868]],["t/118",[21,4.28]],["t/122",[22,4.28]],["t/141",[23,3.435,24,3.435]],["t/143",[25,4.28]],["t/162",[26,4.28]],["t/181",[13,2.912,14,2.31]],["t/183",[27,2.868,28,2.868,29,2.868]],["t/185",[30,3.629]],["t/197",[31,3.629]],["t/209",[32,3.629]],["t/219",[33,3.629]],["t/231",[34,3.435,35,3.435]],["t/233",[30,3.629]],["t/244",[31,3.629]],["t/255",[32,3.629]],["t/266",[33,3.629]],["t/277",[11,2.912,36,3.435]],["t/279",[37,4.28]],["t/281",[12,3.629]],["t/283",[38,2.868,39,2.868,40,2.868]],["t/285",[41,2.431,42,2.431,43,1.615]],["t/287",[41,1.828,42,1.828,43,1.214,44,1.321,45,1.612]],["t/289",[43,1.615,44,1.758,46,1.929]],["t/291",[14,1.45,43,1.214,44,1.321,46,1.45,47,1.828]],["t/293",[43,1.214,44,2.045,45,1.612,46,1.45]],["t/295",[14,1.162,43,0.973,44,1.716,45,1.291,46,1.162,47,1.465]],["t/297",[48,2.868,49,2.868,50,2.868]],["t/299",[51,3.435,52,3.435]],["t/307",[3,2.567,53,3.435]],["t/309",[54,3.435,55,3.435]]],"invertedIndex":[["",{"_index":28,"t":{"183":{"position":[[6,1]]}}}],["acknowledg",{"_index":0,"t":{"1":{"position":[[0,16]]}}}],["api",{"_index":1,"t":{"3":{"position":[[0,3]]},"53":{"position":[[13,3]]}}}],["array",{"_index":45,"t":{"287":{"position":[[30,6]]},"293":{"position":[[24,6]]},"295":{"position":[[45,6]]}}}],["ask",{"_index":49,"t":{"297":{"position":[[11,5]]}}}],["authent",{"_index":6,"t":{"31":{"position":[[0,14]]}}}],["await",{"_index":27,"t":{"183":{"position":[[0,5]]}}}],["badg",{"_index":55,"t":{"309":{"position":[[10,6]]}}}],["basic",{"_index":38,"t":{"283":{"position":[[0,5]]}}}],["binlog",{"_index":23,"t":{"141":{"position":[[0,6]]}}}],["call",{"_index":42,"t":{"285":{"position":[[10,4]]},"287":{"position":[[10,4]]}}}],["class",{"_index":40,"t":{"283":{"position":[[13,5]]}}}],["co",{"_index":29,"t":{"183":{"position":[[8,2]]}}}],["configur",{"_index":2,"t":{"3":{"position":[[8,13]]}}}],["contribut",{"_index":4,"t":{"19":{"position":[[0,12]]},"35":{"position":[[8,12]]}}}],["createconnect",{"_index":22,"t":{"122":{"position":[[0,16]]}}}],["createpool",{"_index":25,"t":{"143":{"position":[[0,10]]}}}],["createpoolclust",{"_index":26,"t":{"162":{"position":[[0,17]]}}}],["custom",{"_index":39,"t":{"283":{"position":[[6,6]]}}}],["data",{"_index":46,"t":{"289":{"position":[[4,4]]},"291":{"position":[[4,4]]},"293":{"position":[[4,4]]},"295":{"position":[[4,4]]}}}],["delet",{"_index":30,"t":{"185":{"position":[[0,6]]},"233":{"position":[[0,6]]}}}],["document",{"_index":5,"t":{"21":{"position":[[0,13]]}}}],["error",{"_index":52,"t":{"299":{"position":[[14,7]]}}}],["exampl",{"_index":21,"t":{"118":{"position":[[0,8]]}}}],["extra",{"_index":15,"t":{"75":{"position":[[0,5]]}}}],["featur",{"_index":16,"t":{"75":{"position":[[6,8]]}}}],["frequent",{"_index":48,"t":{"297":{"position":[[0,10]]}}}],["guidelin",{"_index":10,"t":{"35":{"position":[[21,10]]}}}],["handl",{"_index":51,"t":{"299":{"position":[[7,6]]}}}],["histori",{"_index":53,"t":{"307":{"position":[[0,7]]}}}],["insert",{"_index":31,"t":{"197":{"position":[[0,6]]},"244":{"position":[[0,6]]}}}],["multi",{"_index":47,"t":{"291":{"position":[[16,6]]},"295":{"position":[[16,6]]}}}],["mysql",{"_index":11,"t":{"53":{"position":[[0,5]]},"277":{"position":[[0,5]]}}}],["mysql2",{"_index":3,"t":{"5":{"position":[[0,6]]},"92":{"position":[[6,6]]},"307":{"position":[[16,6]]}}}],["packet",{"_index":43,"t":{"285":{"position":[[15,6]]},"287":{"position":[[15,6]]},"289":{"position":[[9,6]]},"291":{"position":[[9,6]]},"293":{"position":[[9,6]]},"295":{"position":[[9,6]]}}}],["pool",{"_index":37,"t":{"279":{"position":[[0,4]]}}}],["prepar",{"_index":13,"t":{"62":{"position":[[0,8]]},"181":{"position":[[0,8]]}}}],["procedur",{"_index":41,"t":{"285":{"position":[[0,9]]},"287":{"position":[[0,9]]}}}],["promis",{"_index":17,"t":{"84":{"position":[[0,7]]}}}],["proxi",{"_index":36,"t":{"277":{"position":[[6,5]]}}}],["queri",{"_index":35,"t":{"231":{"position":[[7,7]]}}}],["question",{"_index":50,"t":{"297":{"position":[[17,9]]}}}],["request",{"_index":8,"t":{"31":{"position":[[22,7]]}}}],["row",{"_index":44,"t":{"287":{"position":[[22,4]]},"289":{"position":[[0,3]]},"291":{"position":[[0,3]]},"293":{"position":[[0,3],[16,4]]},"295":{"position":[[0,3],[38,3]]}}}],["select",{"_index":32,"t":{"209":{"position":[[0,6]]},"255":{"position":[[0,6]]}}}],["server",{"_index":12,"t":{"53":{"position":[[6,6]]},"281":{"position":[[0,6]]}}}],["simpl",{"_index":34,"t":{"231":{"position":[[0,6]]}}}],["stabil",{"_index":54,"t":{"309":{"position":[[0,9]]}}}],["statement",{"_index":14,"t":{"62":{"position":[[9,10]]},"181":{"position":[[9,10]]},"291":{"position":[[23,11]]},"295":{"position":[[23,10]]}}}],["switch",{"_index":7,"t":{"31":{"position":[[15,6]]}}}],["typescript",{"_index":20,"t":{"92":{"position":[[18,10]]}}}],["updat",{"_index":33,"t":{"219":{"position":[[0,6]]},"266":{"position":[[0,6]]}}}],["us",{"_index":19,"t":{"92":{"position":[[0,5]]}}}],["watcher",{"_index":24,"t":{"141":{"position":[[7,7]]}}}],["websit",{"_index":9,"t":{"35":{"position":[[0,7]]}}}],["wrapper",{"_index":18,"t":{"84":{"position":[[8,8]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":7,"t":"Installation","u":"/node-mysql2/docs","h":"#installation","p":5},{"i":9,"t":"First Query","u":"/node-mysql2/docs","h":"#first-query","p":5},{"i":11,"t":"Using Prepared Statements","u":"/node-mysql2/docs","h":"#using-prepared-statements","p":5},{"i":13,"t":"Using Connection Pools","u":"/node-mysql2/docs","h":"#using-connection-pools","p":5},{"i":15,"t":"Using Promise Wrapper","u":"/node-mysql2/docs","h":"#using-promise-wrapper","p":5},{"i":17,"t":"Array Results","u":"/node-mysql2/docs","h":"#array-results","p":5},{"i":23,"t":"Examples","u":"/node-mysql2/docs/documentation","h":"#examples","p":21},{"i":25,"t":"Known incompatibilities with Node MySQL","u":"/node-mysql2/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":21},{"i":27,"t":"Other Resources","u":"/node-mysql2/docs/documentation","h":"#other-resources","p":21},{"i":29,"t":"Benchmarks","u":"/node-mysql2/docs/documentation","h":"#benchmarks","p":21},{"i":33,"t":"Multi-factor authentication","u":"/node-mysql2/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":31},{"i":37,"t":"Environment","u":"/node-mysql2/docs/contributing/website","h":"#environment","p":35},{"i":39,"t":"Development","u":"/node-mysql2/docs/contributing/website","h":"#development","p":35},{"i":41,"t":"Extras Components","u":"/node-mysql2/docs/contributing/website","h":"#extras-components","p":35},{"i":43,"t":"History","u":"/node-mysql2/docs/contributing/website","h":"#history","p":35},{"i":45,"t":"Stability","u":"/node-mysql2/docs/contributing/website","h":"#stability","p":35},{"i":47,"t":"FAQ","u":"/node-mysql2/docs/contributing/website","h":"#faq","p":35},{"i":49,"t":"ExternalCodeEmbed","u":"/node-mysql2/docs/contributing/website","h":"#externalcodeembed","p":35},{"i":51,"t":"Running Tests","u":"/node-mysql2/docs/contributing/website","h":"#running-tests","p":35},{"i":54,"t":"Server","u":"/node-mysql2/docs/documentation/mysql-server","h":"#server","p":53},{"i":56,"t":"Events","u":"/node-mysql2/docs/documentation/mysql-server","h":"#events","p":53},{"i":58,"t":"Connection","u":"/node-mysql2/docs/documentation/mysql-server","h":"#connection","p":53},{"i":60,"t":"Events","u":"/node-mysql2/docs/documentation/mysql-server","h":"#events-1","p":53},{"i":63,"t":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":62},{"i":65,"t":"Manual prepare / execute","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":62},{"i":67,"t":"Configuration","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#configuration","p":62},{"i":69,"t":"Serialization of bind parameters","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":62},{"i":71,"t":"Prepared Statements Helper","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":62},{"i":73,"t":"Examples","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#examples","p":62},{"i":76,"t":"Named placeholders","u":"/node-mysql2/docs/documentation/extras","h":"#named-placeholders","p":75},{"i":78,"t":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":75},{"i":80,"t":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":75},{"i":82,"t":"Connecting using custom stream:","u":"/node-mysql2/docs/documentation/extras","h":"#connecting-using-custom-stream","p":75},{"i":86,"t":"Basic Promise","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#basic-promise","p":84},{"i":88,"t":"ES7 Async Await","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#es7-async-await","p":84},{"i":90,"t":"With CO","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#with-co","p":84},{"i":93,"t":"Installation","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#installation","p":92},{"i":95,"t":"Usage","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#usage","p":92},{"i":97,"t":"Connection","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#connection","p":92},{"i":99,"t":"Pool Connection","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#pool-connection","p":92},{"i":101,"t":"Query and Execute","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#query-and-execute","p":92},{"i":103,"t":"Type Specification","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#type-specification","p":92},{"i":104,"t":"RowDataPacket[]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#rowdatapacket","p":92},{"i":106,"t":"RowDataPacket[][]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":92},{"i":108,"t":"ResultSetHeader","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#resultsetheader","p":92},{"i":110,"t":"ResultSetHeader[]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":92},{"i":112,"t":"ProcedureCallPacket","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":92},{"i":114,"t":"OkPacket","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#okpacket","p":92},{"i":116,"t":"Examples","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#examples","p":92},{"i":120,"t":"Examples using MySQL server API","u":"/node-mysql2/docs/examples","h":"#examples-using-mysql-server-api","p":118},{"i":124,"t":"createConnection(connectionUri)","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":122},{"i":126,"t":"createConnection(config)","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":122},{"i":128,"t":"createConnection(config) — SHA1","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":122},{"i":130,"t":"createConnection(config) — SSL","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":122},{"i":132,"t":"createConnection(config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":122},{"i":134,"t":"Related Links","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#related-links","p":122},{"i":136,"t":"createConnection(config) — Socks","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":122},{"i":138,"t":"Glossary","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#glossary","p":122},{"i":139,"t":"ConnectionOptions","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#connectionoptions","p":122},{"i":145,"t":"createPool(connectionUri)","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":143},{"i":147,"t":"createPool(config)","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig","p":143},{"i":149,"t":"createPool(config) — SHA1","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":143},{"i":151,"t":"createPool(config) — SSL","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":143},{"i":153,"t":"createPool(config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":143},{"i":155,"t":"Related Links","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#related-links","p":143},{"i":157,"t":"createPool(config) — Socks","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":143},{"i":159,"t":"Glossary","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#glossary","p":143},{"i":160,"t":"PoolOptions","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#pooloptions","p":143},{"i":164,"t":"add(group, connectionUri)","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":162},{"i":166,"t":"add(group, config)","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":162},{"i":168,"t":"add(group, config) — SHA1","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":162},{"i":170,"t":"add(group, config) — SSL","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":162},{"i":172,"t":"add(group, config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":162},{"i":174,"t":"Related Links","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#related-links","p":162},{"i":176,"t":"add(group, config) — Socks","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":162},{"i":178,"t":"Glossary","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#glossary","p":162},{"i":179,"t":"PoolOptions","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":162},{"i":186,"t":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":185},{"i":188,"t":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":185},{"i":190,"t":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":185},{"i":192,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#glossary","p":185},{"i":193,"t":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":185},{"i":195,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":185},{"i":198,"t":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":197},{"i":200,"t":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":197},{"i":202,"t":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":197},{"i":204,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#glossary","p":197},{"i":205,"t":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":197},{"i":207,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":197},{"i":210,"t":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":209},{"i":212,"t":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":209},{"i":214,"t":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":209},{"i":216,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#glossary","p":209},{"i":217,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":209},{"i":220,"t":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":219},{"i":222,"t":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":219},{"i":224,"t":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":219},{"i":226,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#glossary","p":219},{"i":227,"t":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":219},{"i":229,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":219},{"i":235,"t":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#querysql","p":233},{"i":237,"t":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":233},{"i":239,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#glossary","p":233},{"i":240,"t":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":233},{"i":242,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":233},{"i":246,"t":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#querysql","p":244},{"i":248,"t":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":244},{"i":250,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#glossary","p":244},{"i":251,"t":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":244},{"i":253,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":244},{"i":257,"t":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#querysql","p":255},{"i":259,"t":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":255},{"i":261,"t":"query(options) — Row as Array","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":255},{"i":263,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#glossary","p":255},{"i":264,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":255},{"i":268,"t":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#querysql","p":266},{"i":270,"t":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":266},{"i":272,"t":"Glossary","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#glossary","p":266},{"i":273,"t":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":266},{"i":275,"t":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":266},{"i":301,"t":"Using callbacks","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":299},{"i":303,"t":"Using promises","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#using-promises","p":299},{"i":305,"t":"Related Links","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#related-links","p":299}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/7",[0,4.81]],["t/9",[1,4.277,2,3.782]],["t/11",[3,2.139,4,2.847,5,3.116]],["t/13",[3,2.139,6,2.353,7,3.116]],["t/15",[3,2.139,8,2.847,9,3.523]],["t/17",[10,3.456,11,4.277]],["t/23",[12,4.086]],["t/25",[13,2.996,14,2.996,15,2.996,16,2.649]],["t/27",[17,5.44]],["t/29",[18,5.44]],["t/33",[19,3.523,20,3.523,21,3.523]],["t/37",[22,5.44]],["t/39",[23,5.44]],["t/41",[24,4.277,25,4.277]],["t/43",[26,5.44]],["t/45",[27,5.44]],["t/47",[28,5.44]],["t/49",[29,5.44]],["t/51",[30,4.277,31,4.277]],["t/54",[32,4.81]],["t/56",[33,4.81]],["t/58",[6,3.633]],["t/60",[33,4.81]],["t/63",[3,1.4,6,1.54,34,2.305,35,2.305,36,2.305,37,2.305]],["t/65",[4,2.421,38,2.996,39,1.456,40,2.649]],["t/67",[41,5.44]],["t/69",[42,3.523,43,3.523,44,3.523]],["t/71",[4,2.847,5,3.116,45,3.523]],["t/73",[12,4.086]],["t/76",[46,3.782,47,4.277]],["t/78",[10,1.384,46,1.515,48,1.713,49,1.515,50,2.912,51,1.713,52,1.713,53,1.713]],["t/80",[54,2.067,55,2.067,56,2.067,57,2.067,58,2.067,59,2.067,60,1.828]],["t/82",[3,1.819,6,2.001,60,2.649,61,2.996]],["t/86",[8,3.456,62,4.277]],["t/88",[63,3.523,64,3.523,65,3.523]],["t/90",[66,5.44]],["t/93",[0,4.81]],["t/95",[67,5.44]],["t/97",[6,3.633]],["t/99",[6,2.856,7,3.782]],["t/101",[2,3.782,40,3.782]],["t/103",[68,4.277,69,4.277]],["t/104",[70,4.81]],["t/106",[70,4.81]],["t/108",[71,3.302]],["t/110",[71,3.302]],["t/112",[72,5.44]],["t/114",[73,5.44]],["t/116",[12,4.086]],["t/120",[3,1.582,12,1.957,16,2.304,32,2.304,74,2.606]],["t/124",[75,5.44]],["t/126",[76,3.839]],["t/128",[39,1.713,76,2.486,77,2.847]],["t/130",[39,1.713,76,2.486,78,2.353]],["t/132",[39,1.456,76,2.114,78,2.001,79,2.421]],["t/134",[80,3.212,81,3.212]],["t/136",[39,1.713,76,2.486,82,2.847]],["t/138",[83,2.93]],["t/139",[84,5.44]],["t/145",[85,5.44]],["t/147",[86,3.839]],["t/149",[39,1.713,77,2.847,86,2.486]],["t/151",[39,1.713,78,2.353,86,2.486]],["t/153",[39,1.456,78,2.001,79,2.421,86,2.114]],["t/155",[80,3.212,81,3.212]],["t/157",[39,1.713,82,2.847,86,2.486]],["t/159",[83,2.93]],["t/160",[87,4.81]],["t/164",[88,2.856,89,4.277]],["t/166",[88,2.856,90,3.018]],["t/168",[39,1.456,77,2.421,88,2.001,90,2.114]],["t/170",[39,1.456,78,2.001,88,2.001,90,2.114]],["t/172",[39,1.267,78,1.74,79,2.106,88,1.74,90,1.839]],["t/174",[80,3.212,81,3.212]],["t/176",[39,1.456,82,2.421,88,2.001,90,2.114]],["t/178",[83,2.93]],["t/179",[87,4.81]],["t/186",[91,3.212,92,2.596]],["t/188",[93,3.302]],["t/190",[92,2.596,93,2.596]],["t/192",[83,2.93]],["t/193",[71,3.302]],["t/195",[94,3.302]],["t/198",[91,3.212,92,2.596]],["t/200",[93,3.302]],["t/202",[92,2.596,93,2.596]],["t/204",[83,2.93]],["t/205",[71,3.302]],["t/207",[94,3.302]],["t/210",[91,3.212,92,2.596]],["t/212",[93,3.302]],["t/214",[92,2.596,93,2.596]],["t/216",[83,2.93]],["t/217",[94,3.302]],["t/220",[91,3.212,92,2.596]],["t/222",[93,3.302]],["t/224",[92,2.596,93,2.596]],["t/226",[83,2.93]],["t/227",[71,3.302]],["t/229",[94,3.302]],["t/235",[95,4.086]],["t/237",[96,3.839]],["t/239",[83,2.93]],["t/240",[71,3.302]],["t/242",[94,3.302]],["t/246",[95,4.086]],["t/248",[96,3.839]],["t/250",[83,2.93]],["t/251",[71,3.302]],["t/253",[94,3.302]],["t/257",[95,4.086]],["t/259",[96,3.839]],["t/261",[10,2.421,39,1.456,49,2.649,96,2.114]],["t/263",[83,2.93]],["t/264",[94,3.302]],["t/268",[95,4.086]],["t/270",[96,3.839]],["t/272",[83,2.93]],["t/273",[71,3.302]],["t/275",[94,3.302]],["t/301",[3,2.596,97,4.277]],["t/303",[3,2.596,8,3.456]],["t/305",[80,3.212,81,3.212]]],"invertedIndex":[["",{"_index":39,"t":{"65":{"position":[[15,1]]},"128":{"position":[[25,1]]},"130":{"position":[[25,1]]},"132":{"position":[[25,1]]},"136":{"position":[[25,1]]},"149":{"position":[[19,1]]},"151":{"position":[[19,1]]},"153":{"position":[[19,1]]},"157":{"position":[[19,1]]},"168":{"position":[[19,1]]},"170":{"position":[[19,1]]},"172":{"position":[[19,1]]},"176":{"position":[[19,1]]},"261":{"position":[[15,1]]}}}],["add(group",{"_index":88,"t":{"164":{"position":[[0,10]]},"166":{"position":[[0,10]]},"168":{"position":[[0,10]]},"170":{"position":[[0,10]]},"172":{"position":[[0,10]]},"176":{"position":[[0,10]]}}}],["api",{"_index":74,"t":{"120":{"position":[[28,3]]}}}],["array",{"_index":10,"t":{"17":{"position":[[0,5]]},"78":{"position":[[18,5]]},"261":{"position":[[24,5]]}}}],["async",{"_index":64,"t":{"88":{"position":[[4,5]]}}}],["authent",{"_index":21,"t":{"33":{"position":[[13,14]]}}}],["automat",{"_index":34,"t":{"63":{"position":[[0,9]]}}}],["await",{"_index":65,"t":{"88":{"position":[[10,5]]}}}],["basic",{"_index":62,"t":{"86":{"position":[[0,5]]}}}],["benchmark",{"_index":18,"t":{"29":{"position":[[0,10]]}}}],["bind",{"_index":43,"t":{"69":{"position":[[17,4]]}}}],["cach",{"_index":36,"t":{"63":{"position":[[20,6]]}}}],["callback",{"_index":97,"t":{"301":{"position":[[6,9]]}}}],["co",{"_index":66,"t":{"90":{"position":[[5,2]]}}}],["column",{"_index":50,"t":{"78":{"position":[[27,7],[56,6]]}}}],["compon",{"_index":25,"t":{"41":{"position":[[7,10]]}}}],["config",{"_index":90,"t":{"166":{"position":[[11,7]]},"168":{"position":[[11,7]]},"170":{"position":[[11,7]]},"172":{"position":[[11,7]]},"176":{"position":[[11,7]]}}}],["configur",{"_index":41,"t":{"67":{"position":[[0,13]]}}}],["connect",{"_index":6,"t":{"13":{"position":[[6,10]]},"58":{"position":[[0,10]]},"63":{"position":[[42,10]]},"82":{"position":[[0,10]]},"97":{"position":[[0,10]]},"99":{"position":[[5,10]]}}}],["connectionopt",{"_index":84,"t":{"139":{"position":[[0,17]]}}}],["connectionuri",{"_index":89,"t":{"164":{"position":[[11,14]]}}}],["createconnection(config",{"_index":76,"t":{"126":{"position":[[0,24]]},"128":{"position":[[0,24]]},"130":{"position":[[0,24]]},"132":{"position":[[0,24]]},"136":{"position":[[0,24]]}}}],["createconnection(connectionuri",{"_index":75,"t":{"124":{"position":[[0,31]]}}}],["createpool(config",{"_index":86,"t":{"147":{"position":[[0,18]]},"149":{"position":[[0,18]]},"151":{"position":[[0,18]]},"153":{"position":[[0,18]]},"157":{"position":[[0,18]]}}}],["createpool(connectionuri",{"_index":85,"t":{"145":{"position":[[0,25]]}}}],["creation",{"_index":35,"t":{"63":{"position":[[10,9]]}}}],["custom",{"_index":61,"t":{"82":{"position":[[17,6]]}}}],["data",{"_index":56,"t":{"80":{"position":[[16,4]]}}}],["develop",{"_index":23,"t":{"39":{"position":[[0,11]]}}}],["environ",{"_index":22,"t":{"37":{"position":[[0,11]]}}}],["es7",{"_index":63,"t":{"88":{"position":[[0,3]]}}}],["event",{"_index":33,"t":{"56":{"position":[[0,6]]},"60":{"position":[[0,6]]}}}],["exampl",{"_index":12,"t":{"23":{"position":[[0,8]]},"73":{"position":[[0,8]]},"116":{"position":[[0,8]]},"120":{"position":[[0,8]]}}}],["execut",{"_index":40,"t":{"65":{"position":[[17,7]]},"101":{"position":[[10,7]]}}}],["execute(opt",{"_index":93,"t":{"188":{"position":[[0,16]]},"190":{"position":[[0,16]]},"200":{"position":[[0,16]]},"202":{"position":[[0,16]]},"212":{"position":[[0,16]]},"214":{"position":[[0,16]]},"222":{"position":[[0,16]]},"224":{"position":[[0,16]]}}}],["execute(sql",{"_index":91,"t":{"186":{"position":[[0,12]]},"198":{"position":[[0,12]]},"210":{"position":[[0,12]]},"220":{"position":[[0,12]]}}}],["externalcodeemb",{"_index":29,"t":{"49":{"position":[[0,17]]}}}],["extra",{"_index":24,"t":{"41":{"position":[[0,6]]}}}],["factor",{"_index":20,"t":{"33":{"position":[[6,6]]}}}],["faq",{"_index":28,"t":{"47":{"position":[[0,3]]}}}],["first",{"_index":1,"t":{"9":{"position":[[0,5]]}}}],["glossari",{"_index":83,"t":{"138":{"position":[[0,8]]},"159":{"position":[[0,8]]},"178":{"position":[[0,8]]},"192":{"position":[[0,8]]},"204":{"position":[[0,8]]},"216":{"position":[[0,8]]},"226":{"position":[[0,8]]},"239":{"position":[[0,8]]},"250":{"position":[[0,8]]},"263":{"position":[[0,8]]},"272":{"position":[[0,8]]}}}],["hash",{"_index":52,"t":{"78":{"position":[[46,4]]}}}],["helper",{"_index":45,"t":{"71":{"position":[[20,6]]}}}],["histori",{"_index":26,"t":{"43":{"position":[[0,7]]}}}],["incompat",{"_index":14,"t":{"25":{"position":[[6,17]]}}}],["infil",{"_index":58,"t":{"80":{"position":[[32,7]]}}}],["instal",{"_index":0,"t":{"7":{"position":[[0,12]]},"93":{"position":[[0,12]]}}}],["instead",{"_index":51,"t":{"78":{"position":[[35,7]]}}}],["key",{"_index":53,"t":{"78":{"position":[[71,4]]}}}],["known",{"_index":13,"t":{"25":{"position":[[0,5]]}}}],["link",{"_index":81,"t":{"134":{"position":[[8,5]]},"155":{"position":[[8,5]]},"174":{"position":[[8,5]]},"305":{"position":[[8,5]]}}}],["load",{"_index":57,"t":{"80":{"position":[[26,5]]}}}],["local",{"_index":59,"t":{"80":{"position":[[44,5]]}}}],["manual",{"_index":38,"t":{"65":{"position":[[0,6]]}}}],["multi",{"_index":19,"t":{"33":{"position":[[0,5]]}}}],["mysql",{"_index":16,"t":{"25":{"position":[[34,5]]},"120":{"position":[[15,5]]}}}],["name",{"_index":46,"t":{"76":{"position":[[0,5]]},"78":{"position":[[63,4]]}}}],["node",{"_index":15,"t":{"25":{"position":[[29,4]]}}}],["okpacket",{"_index":73,"t":{"114":{"position":[[0,8]]}}}],["paramet",{"_index":44,"t":{"69":{"position":[[22,10]]}}}],["placehold",{"_index":47,"t":{"76":{"position":[[6,12]]}}}],["pool",{"_index":7,"t":{"13":{"position":[[17,5]]},"99":{"position":[[0,4]]}}}],["poolopt",{"_index":87,"t":{"160":{"position":[[0,11]]},"179":{"position":[[0,11]]}}}],["prepar",{"_index":4,"t":{"11":{"position":[[6,8]]},"65":{"position":[[7,7]]},"71":{"position":[[0,8]]}}}],["procedurecallpacket",{"_index":72,"t":{"112":{"position":[[0,19]]}}}],["promis",{"_index":8,"t":{"15":{"position":[[6,7]]},"86":{"position":[[6,7]]},"303":{"position":[[6,8]]}}}],["queri",{"_index":2,"t":{"9":{"position":[[6,5]]},"101":{"position":[[0,5]]}}}],["query(opt",{"_index":96,"t":{"237":{"position":[[0,14]]},"248":{"position":[[0,14]]},"259":{"position":[[0,14]]},"261":{"position":[[0,14]]},"270":{"position":[[0,14]]}}}],["query(sql",{"_index":95,"t":{"235":{"position":[[0,10]]},"246":{"position":[[0,10]]},"257":{"position":[[0,10]]},"268":{"position":[[0,10]]}}}],["queryopt",{"_index":94,"t":{"195":{"position":[[0,12]]},"207":{"position":[[0,12]]},"217":{"position":[[0,12]]},"229":{"position":[[0,12]]},"242":{"position":[[0,12]]},"253":{"position":[[0,12]]},"264":{"position":[[0,12]]},"275":{"position":[[0,12]]}}}],["rd",{"_index":79,"t":{"132":{"position":[[27,3]]},"153":{"position":[[21,3]]},"172":{"position":[[21,3]]}}}],["re",{"_index":37,"t":{"63":{"position":[[31,2]]}}}],["receiv",{"_index":48,"t":{"78":{"position":[[0,9]]}}}],["relat",{"_index":80,"t":{"134":{"position":[[0,7]]},"155":{"position":[[0,7]]},"174":{"position":[[0,7]]},"305":{"position":[[0,7]]}}}],["resourc",{"_index":17,"t":{"27":{"position":[[6,9]]}}}],["result",{"_index":11,"t":{"17":{"position":[[6,7]]}}}],["resultsethead",{"_index":71,"t":{"108":{"position":[[0,15]]},"110":{"position":[[0,17]]},"193":{"position":[[0,15]]},"205":{"position":[[0,15]]},"227":{"position":[[0,15]]},"240":{"position":[[0,15]]},"251":{"position":[[0,15]]},"273":{"position":[[0,15]]}}}],["row",{"_index":49,"t":{"78":{"position":[[10,4]]},"261":{"position":[[17,3]]}}}],["rowdatapacket",{"_index":70,"t":{"104":{"position":[[0,15]]},"106":{"position":[[0,17]]}}}],["run",{"_index":30,"t":{"51":{"position":[[0,7]]}}}],["send",{"_index":54,"t":{"80":{"position":[[0,7]]}}}],["serial",{"_index":42,"t":{"69":{"position":[[0,13]]}}}],["server",{"_index":32,"t":{"54":{"position":[[0,6]]},"120":{"position":[[21,6]]}}}],["sha1",{"_index":77,"t":{"128":{"position":[[27,4]]},"149":{"position":[[21,4]]},"168":{"position":[[21,4]]}}}],["sock",{"_index":82,"t":{"136":{"position":[[27,5]]},"157":{"position":[[21,5]]},"176":{"position":[[21,5]]}}}],["specif",{"_index":69,"t":{"103":{"position":[[5,13]]}}}],["ssl",{"_index":78,"t":{"130":{"position":[[27,3]]},"132":{"position":[[31,3]]},"151":{"position":[[21,3]]},"153":{"position":[[25,3]]},"170":{"position":[[21,3]]},"172":{"position":[[25,3]]}}}],["stabil",{"_index":27,"t":{"45":{"position":[[0,9]]}}}],["statement",{"_index":5,"t":{"11":{"position":[[15,10]]},"71":{"position":[[9,10]]}}}],["stream",{"_index":60,"t":{"80":{"position":[[50,7]]},"82":{"position":[[24,7]]}}}],["tabular",{"_index":55,"t":{"80":{"position":[[8,7]]}}}],["test",{"_index":31,"t":{"51":{"position":[[8,5]]}}}],["type",{"_index":68,"t":{"103":{"position":[[0,4]]}}}],["us",{"_index":3,"t":{"11":{"position":[[0,5]]},"13":{"position":[[0,5]]},"15":{"position":[[0,5]]},"63":{"position":[[34,4]]},"82":{"position":[[11,5]]},"120":{"position":[[9,5]]},"301":{"position":[[0,5]]},"303":{"position":[[0,5]]}}}],["usag",{"_index":67,"t":{"95":{"position":[[0,5]]}}}],["valu",{"_index":92,"t":{"186":{"position":[[13,7]]},"190":{"position":[[17,7]]},"198":{"position":[[13,7]]},"202":{"position":[[17,7]]},"210":{"position":[[13,7]]},"214":{"position":[[17,7]]},"220":{"position":[[13,7]]},"224":{"position":[[17,7]]}}}],["wrapper",{"_index":9,"t":{"15":{"position":[[14,7]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":2,"t":"Internal protocol is written by @sidorares MySQL-Native. Constants, SQL parameters interpolation, Pooling, ConnectionConfig class taken from Node MySQL. SSL upgrade code based on @TooTallNate code. Secure connection / compressed connection api flags compatible to MariaSQL client. Contributors.","s":"Acknowledgements","u":"/node-mysql2/docs/acknowledgements","h":"","p":1},{"i":4,"t":"MySQL2 is mostly API compatible with Node MySQL. One known incompatibility is that DECIMAL values are returned as strings whereas in Node MySQL they are returned as numbers. This includes the result of SUM() and AVG() functions when applied to INTEGER arguments. This is done deliberately to avoid loss of precision - see https://github.com/sidorares/node-mysql2/issues/935. info If you find any other incompatibility with Node MySQL, Please report via Issue tracker. We will fix reported incompatibility on priority basis.","s":"API and Configuration","u":"/node-mysql2/docs/api-and-configurations","h":"","p":3},{"i":6,"t":"MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more.","s":"MySQL2","u":"/node-mysql2/docs","h":"","p":5},{"i":8,"t":"MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues. JavaScript TypeScript npm install --save mysql2 npm install --save mysql2 npm install --save-dev @types/node For TypeScript documentation and examples, see here.","s":"Installation","u":"/node-mysql2/docs","h":"#installation","p":5},{"i":10,"t":"To explore more queries examples, please visit the example sections Simple Queries and Prepared Statements. Promise Callback // Get the client import mysql from 'mysql2/promise'; // Create the connection to database const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // A simple SELECT query try { const [results, fields] = await connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45' ); console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } catch (err) { console.log(err); } // Using placeholders try { const [results] = await connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45] ); console.log(results); } catch (err) { console.log(err); } // Get the client const mysql = require('mysql2'); // Create the connection to database const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // A simple SELECT query connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45', function (err, results, fields) { console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } ); // Using placeholders connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45], function (err, results) { console.log(results); } );","s":"First Query","u":"/node-mysql2/docs","h":"#first-query","p":5},{"i":12,"t":"With MySQL2 you also get the prepared statements. With prepared statements MySQL doesn't have to prepare plan for same query every time, this results in better performance. If you don't know why they are important, please check these discussions: How prepared statements can protect from SQL Injection attacks MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. To explore more Prepared Statements and Placeholders examples, please visit the example section Prepared Statements. Promise Callback import mysql from 'mysql2/promise'; try { // create the connection to database const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute will internally call prepare and query const [results, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53] ); console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } catch (err) { console.log(err); } const mysql = require('mysql2'); // create the connection to database const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute will internally call prepare and query connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53], function (err, results, fields) { console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } ); tip If you execute same statement again, it will be picked from a LRU cache which will save query preparation time and give better performance.","s":"Using Prepared Statements","u":"/node-mysql2/docs","h":"#using-prepared-statements","p":5},{"i":14,"t":"Connection pools help reduce the time spent connecting to the MySQL server by reusing a previous connection, leaving them open instead of closing when you are done with them. This improves the latency of queries as you avoid all of the overhead that comes with establishing a new connection. To explore more Connection Pools examples, please visit the example section createPool. Promise Callback import mysql from 'mysql2/promise'; // Create the connection pool. The pool-specific settings are the defaults const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); const mysql = require('mysql2'); // Create the connection pool. The pool-specific settings are the defaults const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); note The pool does not create all connections upfront but creates them on demand until the connection limit is reached. You can use the pool in the same way as connections (using pool.query() and pool.execute()): Promise Callback try { // For pool initialization, see above const [rows, fields] = await pool.query('SELECT `field` FROM `table`'); // Connection is automatically released when query resolves } catch (err) { console.log(err); } // For pool initialization, see above pool.query('SELECT `field` FROM `table`', function (err, rows, fields) { // Connection is automatically released when query resolves }); Alternatively, there is also the possibility of manually acquiring a connection from the pool and returning it later: Promise Callback // For pool initialization, see above const conn = await pool.getConnection(); // Do something with the connection await conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); // For pool initialization, see above pool.getConnection(function (err, conn) { // Do something with the connection conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); }); Additionally, directly release the connection using the connection object: conn.release();","s":"Using Connection Pools","u":"/node-mysql2/docs","h":"#using-connection-pools","p":5},{"i":16,"t":"MySQL2 also support Promise API. Which works very well with ES7 async await. import mysql from 'mysql2/promise'; async function main() { // create the connection const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); } MySQL2 use default Promise object available in scope. But you can choose which Promise implementation you want to use. // get the client import mysql from 'mysql2/promise'; // get the promise implementation, we will use bluebird import bluebird from 'bluebird'; // create the connection, specify bluebird as Promise const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', Promise: bluebird, }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); MySQL2 also exposes a .promise() function on Pools, so you can create a promise/non-promise connections from the same pool. import mysql from 'mysql2'; async function main() { // create the pool const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', }); // now get a Promise wrapped instance of that pool const promisePool = pool.promise(); // query database using promises const [rows, fields] = await promisePool.query('SELECT 1'); } MySQL2 exposes a .promise() function on Connections, to \"upgrade\" an existing non-promise connection to use promise. const mysql = require('mysql2'); // create the connection const conn = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); conn .promise() .query('SELECT 1') .then(([rows, fields]) => { console.log(rows); }) .catch(console.log) .then(() => conn.end());","s":"Using Promise Wrapper","u":"/node-mysql2/docs","h":"#using-promise-wrapper","p":5},{"i":18,"t":"If you have two columns with the same name, you might want to get results as an array rather than an object to prevent them from clashing. This is a deviation from the Node MySQL library. For example: SELECT 1 AS `foo`, 2 AS `foo`. You can enable this setting at either the connection level (applies to all queries), or at the query level (applies only to that specific query). Connection Level​ Promise Callback const conn = await mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); const conn = mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); Query Level​ Promise Callback try { const [results, fields] = await conn.query({ sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }); console.log(results); // in this query, results will be an array of arrays rather than an array of objects console.log(fields); // fields are unchanged } catch (err) { console.log(err); } conn.query( { sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }, function (err, results, fields) { console.log(results); // in this query, results will be an array of arrays rather than an array of objects console.log(fields); // fields are unchanged } ); Getting Help Need help? Ask your question on Stack Overflow or GitHub. If you've encountered an issue, please file it on GitHub.","s":"Array Results","u":"/node-mysql2/docs","h":"#array-results","p":5},{"i":20,"t":"Want to improve something in MySQL2? Please check Contributing.md for detailed instruction on how to get started.","s":"Contributing","u":"/node-mysql2/docs/contributing","h":"","p":19},{"i":22,"t":"MySQL2 aims to be a drop in replacement for Node MySQL. note If you see any API incompatibilities with Node MySQL, please report via github issue. Not only MySQL2 offers better performance over Node MySQL, we also support these additional features: Prepared Statements Promise Wrapper Authentication Switch More Features MySQL Server Pooling SSL MySQL Compression Binary Log Protocol Client","s":"Documentation","u":"/node-mysql2/docs/documentation","h":"","p":21},{"i":24,"t":"Please check these examples for MySQL2.","s":"Examples","u":"/node-mysql2/docs/documentation","h":"#examples","p":21},{"i":26,"t":"zeroFill flag is ignored in type conversion. You need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you. DECIMAL and NEWDECIMAL types always returned as string unless you pass this config option: { decimalNumbers: true, } note This option could lose precision on the number as Javascript Number is a Float!","s":"Known incompatibilities with Node MySQL","u":"/node-mysql2/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":21},{"i":28,"t":"Wire protocol documentation Node MySQL - Most popular node.js mysql client library node-mariasql - Bindings to libmariasql. One of the fastest clients node-libmysqlclient - Bindings to libmysqlclient go-mysql - MySQL Go client (prepared statements, binlog protocol, server)","s":"Other Resources","u":"/node-mysql2/docs/documentation","h":"#other-resources","p":21},{"i":30,"t":"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b npm run benchmarks node-mysql-benchmarks try to run example benchmarks on your system","s":"Benchmarks","u":"/node-mysql2/docs/documentation","h":"#benchmarks","p":21},{"i":32,"t":"During the connection phase the server may ask the client to switch to a different auth method. If the authPlugins connection config option is set, it must be an object where each key is the name of a potential authentication plugin requested by the server, and the corresponding value must be a function that optionally receives the connection config options and returns another function, which in turn, optionally receives the switch request data. The plugin is loaded with a ({user,password,...}) signature, and each call has a (pluginData) signature. Each call should make the plugin return any additional authentication data (Buffer) that should be sent back to the server, either synchronously or asynchronously using a Promise, or should yield an error accordingly. Example: (imaginary ssh-key-auth plugin) pseudo code const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authPlugins: { 'ssh-key-auth': function ({ password }) { return function (pluginData) { return getPrivate(key) .then((key) => { const response = encrypt(key, password, pluginData); // continue handshake by sending response data return response; }) .catch((err) => { // throw error to propagate error to connect/changeUser handlers }); }; }, }, }); There is also a deprecated API where if a authSwitchHandler connection config option is set it must be a function that receives switch request data and responds via a callback. In this case, the first invocation always has a ({pluginName, pluginData}) signature, following calls - ({pluginData}). The client replies with an opaque blob matching the requested plugin via callback(null, data: Buffer). const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authSwitchHandler: function ({ pluginName, pluginData }, cb) { if (pluginName === 'ssh-key-auth') { getPrivateKey((key) => { const response = encrypt(key, pluginData); // continue handshake by sending response data // respond with error to propagate error to connect/changeUser handlers cb(null, response); }); } else { const err = new Error( `Unknown AuthSwitchRequest plugin name ${pluginName}` ); err.fatal = true; cb(err); } }, }); The initial handshake is always performed using mysql_native_password plugin. This will be possible to override in future versions. Note that if the mysql_native_password method is requested it will be handled internally according to Authentication::Native41 and no authPlugins function or the authSwitchHandler will be invoked. These MAY be called multiple times if the plugin algorithm requires multiple roundtrips of data exchange between client and server.","s":"Authentication Switch Request","u":"/node-mysql2/docs/documentation/authentication-switch","h":"","p":31},{"i":34,"t":"If the user requires multi-factor authentication in the server, the client will receive a AuthNextFactor request, which is similar in structure to the regular authentication switch request and contains the name and possible initial data for the additional authentication factor plugin (up to 3). Additional passwords can be provided using the connection config options - password2 and password3. Again, for each authentication factor, multiple roundtrips of data exchange can be required by the plugin algoritm. const conn = mysql.createConnection({ user: 'test_user', password: 'secret1', password2: 'secret2', password3: 'secret3', database: 'test_database', authPlugins: { // password1 === password 'auth-plugin1': function ({ password1 }) { return function (serverPluginData) { return clientPluginData(password1, serverPluginData); }; }, 'auth-plugin2': function ({ password2 }) { return function (serverPluginData) { return clientPluginData(password2, serverPluginData); }; }, 'auth-plugin3': function ({ password3 }) { return function (serverPluginData) { return clientPluginData(password3, serverPluginData); }; }, }, });","s":"Multi-factor authentication","u":"/node-mysql2/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":31},{"i":36,"t":"This website is built using Docusaurus 3, a modern static website generator.","s":"Website Contributing Guidelines","u":"/node-mysql2/docs/contributing/website","h":"","p":35},{"i":38,"t":"You will need these tools installed on your system: Node.js (18.x or higher)","s":"Environment","u":"/node-mysql2/docs/contributing/website","h":"#environment","p":35},{"i":40,"t":"Fork the MySQL2 repository. Download your forked repository locally. The website's workspace is the \"website\" directory in node-mysql2 root. Create a new branch from master (optional). Run cd website to enter the website workspace. Run npm ci to install the dependecies from package-lock.json. Run npm start to starting the local development. It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. For Docusaurus complete documentation, please see here. CLI example git clone https://github.com/sidorares/node-mysql2.git git checkout -b website # optional cd /path-to/node-mysql2/website npm ci npm start Documentation is auto-generated from MDX files placed in these directories: ./docs/documentation ./docs/examples ./docs/faq Caution Note that the website has its own package.json. Please, do not install dependencies for the website in node-mysql2 root.","s":"Development","u":"/node-mysql2/docs/contributing/website","h":"#development","p":35},{"i":42,"t":"Every extra component is thoroughly documented with complete typings descriptions. Docusaurus Markdown Features: The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences.","s":"Extras Components","u":"/node-mysql2/docs/contributing/website","h":"#extras-components","p":35},{"i":44,"t":"The History component displays version changes in a table format, listing version numbers alongside their changes. import { History } from '@site/src/components/History'; tip You can also utilize React components in the changes option. Example History Version Changes v1.0.0 Some change message.","s":"History","u":"/node-mysql2/docs/contributing/website","h":"#history","p":35},{"i":46,"t":"See the Stability Badges for more detais. import { Stability } from '@site/src/components/Stability'; tip You can also utilize React components in the message option. Available levels: 0, 1, 1.1, 1.2, 2 and 3. Example 2Stable 2Stable Some message.","s":"Stability","u":"/node-mysql2/docs/contributing/website","h":"#stability","p":35},{"i":48,"t":"import { FAQ } from '@site/src/components/FAQ'; > Some markdown (**MDX**) content. tip The FAQ component can be utilized in any section or page. Code blocks are compatible and can be used within the FAQ component. Example Title Some markdown (MDX) content.","s":"FAQ","u":"/node-mysql2/docs/contributing/website","h":"#faq","p":35},{"i":50,"t":"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; Example","s":"ExternalCodeEmbed","u":"/node-mysql2/docs/contributing/website","h":"#externalcodeembed","p":35},{"i":52,"t":"npm run test Check Prettier and ESLint rules for compliance npm run lintcheck Included in the GitHub Actions workflow. Check for typings errors 1Experimental Checks for MDX components are missing. npm run typecheck Included in the GitHub Actions workflow. Clear and build the website npm run clear npm run build Included in the GitHub Actions workflow. Fix issues from Prettier and ESLint rules npm run lint To prevent lint issues, it is recommended to execute this command before creating your commit. Not included in the GitHub Actions workflow.","s":"Running Tests","u":"/node-mysql2/docs/contributing/website","h":"#running-tests","p":35},{"i":55,"t":"createServer() - creates server instance Server.listen - listen port / unix socket (same arguments as net.Server.listen)","s":"Server","u":"/node-mysql2/docs/documentation/mysql-server","h":"#server","p":53},{"i":57,"t":"connect new incoming connection.","s":"Events","u":"/node-mysql2/docs/documentation/mysql-server","h":"#events","p":53},{"i":59,"t":"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags }) send server handshake initialisation packet, wait handshake response and start listening for commands writeOk({ affectedRows: num, insertId: num }) send OK packet to client writeEof(warnings, statusFlags) send EOF packet writeTextResult(rows, fields) write query result to client. Rows and fields are in the same format as in connection.query callback. writeColumns(fields) write fields + EOF packets. writeTextRow(row) write array (not hash!) of values as result row TODO: binary protocol","s":"Connection","u":"/node-mysql2/docs/documentation/mysql-server","h":"#connection","p":53},{"i":61,"t":"Every command packet received by the server will be emitted as a packet event with the parameters: packet: Packet The packet itself knownCommand: boolean is this command known to the server *commandCode: number the parsed command code (first byte) In addition special events are emitted for commands received from the client. If no listener is present a fallback behavior will be invoked. quit() Default: close the connection init_db(schemaName: string) Default: return OK query(sql: string) Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR field_list(table: string, fields: string) Default: return ER_WARN_DEPRECATED_SYNTAX ping() - Default: return OK","s":"Events","u":"/node-mysql2/docs/documentation/mysql-server","h":"#events-1","p":53},{"i":64,"t":"Similar to connection.query(). connection.execute('select 1 + ? + ? as result', [5, 6], (err, rows) => { // rows: [ { result: 12 } ] // internally 'select 1 + ? + ? as result' is prepared first. On subsequent calls cached statement is re-used }); // close cached statement for 'select 1 + ? + ? as result'. noop if not in cache connection.unprepare('select 1 + ? + ? as result'); Note that connection.execute() will cache the prepared statement for better performance, remove the cache with connection.unprepare() when you're done.","s":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":62},{"i":66,"t":"Manually prepared statements doesn't comes with LRU cache and SHOULD be closed using statement.close() instead of connection.unprepare(). connection.prepare('select ? + ? as tests', (err, statement) => { // statement.parameters - array of column definitions, length === number of params, here 2 // statement.columns - array of result column definitions. Can be empty if result schema is dynamic / not known // statement.id // statement.query statement.execute([1, 2], (err, rows, columns) => { // -> [ { tests: 3 } ] }); // don't use connection.unprepare(), it won't work! // note that there is no callback here. There is no statement close ack at protocol level. statement.close(); }); Note that you should not use statement after connection reset (changeUser() or disconnect). Statement scope is connection, you need to prepare statement for each new connection in order to use it.","s":"Manual prepare / execute","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":62},{"i":68,"t":"maxPreparedStatements : We keep the cached statements in a lru-cache. Default size is 16000 but you can use this option to override it. Any statements that are dropped from cache will be closed.","s":"Configuration","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#configuration","p":62},{"i":70,"t":"The bind parameter values passed to execute are serialized JS -> MySQL as: null -> NULL number -> DOUBLE boolean -> TINY (0 for false, 1 for true) object -> depending on prototype: Date -> DATETIME JSON like object - JSON Buffer -> VAR_STRING Other -> VAR_STRING Passing in undefined or a function will result in an error.","s":"Serialization of bind parameters","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":62},{"i":72,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [1, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.unprepare('select ?+1 as qqq, ? as rrr, ? as yyy'); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); } ); } ); } );","s":"Prepared Statements Helper","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":62},{"i":74,"t":"For Prepared Statements examples, please see here.","s":"Examples","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#examples","p":62},{"i":77,"t":"You can use named placeholders for parameters by setting namedPlaceholders config value or query/execute time option. Named placeholders are converted to unnamed ? on the client (mysql protocol does not support named parameters). If you reference parameter multiple times under the same name it is sent to server multiple times. Unnamed placeholders can still be used by providing the values as an array instead of an object. connection.config.namedPlaceholders = true; connection.execute('select :x + :y as z', { x: 1, y: 2 }, (err, rows) => { // statement prepared as \"select ? + ? as z\" and executed with [1,2] values // rows returned: [ { z: 3 } ] }); connection.execute('select :x + :x as z', { x: 1 }, (err, rows) => { // select ? + ? as z, execute with [1, 1] }); connection.query('select :x + :x as z', { x: 1 }, (err, rows) => { // query select 1 + 1 as z }); // unnamed placeholders are still valid if the values are provided in an array connection.query('select ? + ? as z', [1, 1], (err, rows) => { // query select 1 + 1 as z });","s":"Named placeholders","u":"/node-mysql2/docs/documentation/extras","h":"#named-placeholders","p":75},{"i":79,"t":"const options = { sql: 'select A,B,C,D from foo', rowsAsArray: true }; connection.query(options, (err, results) => { /* results will be an array of arrays like this now: [[ 'field A value', 'field B value', 'field C value', 'field D value', ], ...] */ });","s":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":75},{"i":81,"t":"In addition to sending local fs files you can send any stream using infileStreamFactory query option. If set, it has to be a function that return a readable stream. It gets file path from query as a parameter. Note: starting from version 2.0 infileStreamFactory is required parameter for LOAD DATA LOCAL INFILE. Response from server indicates that it wants access to a local file and no infileStreamFactory option is provided the query ends with error. // local file connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)', onInserted1 ); // local stream const sql = 'LOAD DATA LOCAL INFILE \"mystream\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)'; connection.query( { sql: sql, infileStreamFactory: function (path) { return getStream(); }, }, onInserted2 ); The infileStreamFactory option may also be set at a connection-level: const fs = require('fs'); const mysql = require('mysql2'); const connection = mysql.createConnection({ user: 'test', database: 'test', infileStreamFactory: (path) => { // Validate file path const validPaths = ['/tmp/data.csv']; if (!validPaths.includes(path)) { throw new Error( `invalid file path: ${path}: expected to be one of ${validPaths.join( ',' )}` ); } return fs.createReadStream(path); }, }); connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test', onInserted );","s":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":75},{"i":83,"t":"const net = require('net'); const mysql = require('mysql2'); const shape = require('shaper'); const connection = mysql.createConnection({ user: 'test', database: 'test', stream: net.connect('/tmp/mysql.sock').pipe(shape(10)), // emulate 10 bytes/sec link }); connection.query('SELECT 1+1 as test1', console.log); stream also can be a function. In that case function result has to be duplex stream, and it is used for connection transport. This is required if you connect pool using custom transport as new pooled connection needs new stream. Example connecting over socks5 proxy: const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ database: 'test', user: 'foo', password: 'bar', stream: function (cb) { const newStream = new SocksConnection( { host: 'remote.host', port: 3306 }, { host: 'localhost', port: 1080 } ); cb(null, newStream); }, }); In addition to password createConnection(), createPool() and changeUser() accept passwordSha1 option. This is useful when implementing proxies as plaintext password might be not available.","s":"Connecting using custom stream:","u":"/node-mysql2/docs/documentation/extras","h":"#connecting-using-custom-stream","p":75},{"i":85,"t":"In addition to errback interface there is thin wrapper to expose Promise-based api","s":"Promise Wrappers","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"","p":84},{"i":87,"t":"/* eslint-env es6 */ const mysql = require('mysql2/promise'); // or require('mysql2').createConnectionPromise mysql .createConnection({ /* same parameters as for non-promise createConnection */ }) .then((conn) => conn.query('select foo from bar')) .then(([rows, fields]) => console.log(rows[0].foo)); const pool = require('mysql2/promise').createPool({}); // or require('mysql2').createPoolPromise({}) or require('mysql2').createPool({}).promise() pool .getConnection() .then((conn) => { const res = conn.query('select foo from bar'); conn.release(); return res; }) .then((result) => { console.log(result[0][0].foo); }) .catch((err) => { console.log(err); // any of connection time or query time errors from above });","s":"Basic Promise","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#basic-promise","p":84},{"i":89,"t":"async function example1() { const mysql = require('mysql2/promise'); const conn = await mysql.createConnection({ database: test }); const [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]); await conn.end(); } async function example2() { const mysql = require('mysql2/promise'); const pool = mysql.createPool({ database: test }); // execute in parallel, next console.log in 3 seconds await Promise.all([ pool.query('select sleep(2)'), pool.query('select sleep(3)'), ]); console.log('3 seconds after'); await pool.end(); }","s":"ES7 Async Await","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#es7-async-await","p":84},{"i":91,"t":"const mysql = require('mysql2'); const co = require('co'); co(function* () { const c = yield mysql.createConnectionPromise({ user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }); Examples in /examples/promise-co-await","s":"With CO","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#with-co","p":84},{"i":94,"t":"npm install --save mysql2 npm install --save-dev @types/node The @types/node ensure the proper interaction between TypeScript and the Node.js modules used by MySQL2 (net, events, stream, tls, etc.). info Requires TypeScript >=4.5.2.","s":"Installation","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#installation","p":92},{"i":96,"t":"You can import MySQL2 in two ways: By setting the esModuleInterop option to true in tsconfig.json import mysql from 'mysql2'; import mysql from 'mysql2/promise'; By setting the esModuleInterop option to false in tsconfig.json import * as mysql from 'mysql2'; import * as mysql from 'mysql2/promise';","s":"Usage","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#usage","p":92},{"i":98,"t":"import mysql, { ConnectionOptions } from 'mysql2'; const access: ConnectionOptions = { user: 'test', database: 'test', }; const conn = mysql.createConnection(access);","s":"Connection","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#connection","p":92},{"i":100,"t":"import mysql, { PoolOptions } from 'mysql2'; const access: PoolOptions = { user: 'test', database: 'test', }; const conn = mysql.createPool(access);","s":"Pool Connection","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#pool-connection","p":92},{"i":102,"t":"A simple query​ conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); conn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); The rows output will be these possible types: RowDataPacket[] RowDataPacket[][] ResultSetHeader ResultSetHeader[] ProcedureCallPacket In this example, you need to manually check the output types","s":"Query and Execute","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#query-and-execute","p":92},{"i":105,"t":"2Stable An array with the returned rows, for example: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); // SELECT conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { test: 2 } ] */ }); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { Tables_in_test: 'test' } ] */ }); Using rowsAsArray option as true: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', rowsAsArray: true, }); // SELECT conn.query( 'SELECT 1 + 1 AS test, 2 + 2 AS test;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 2, 4 ] ] */ } ); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 'test' ] ] */ });","s":"RowDataPacket[]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#rowdatapacket","p":92},{"i":107,"t":"2Stable Using multipleStatements option as true with multiple queries: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SELECT 1 + 1 AS test; SELECT 2 + 2 AS test; `; conn.query(sql, (_err, rows) => { console.log(rows); /** * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ] */ });","s":"RowDataPacket[][]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":92},{"i":109,"t":"2Stable History Version Changes v3.5.1 OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead. changedRows option is deprecated and might be removed in the future major release. Please use affectedRows instead. For INSERT, UPDATE, DELETE, TRUNCATE, etc.: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); const sql = ` SET @1 = 1; `; conn.query(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ });","s":"ResultSetHeader","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#resultsetheader","p":92},{"i":111,"t":"2Stable History Version Changes v3.5.1 Introduce ResultSetHeader[] For multiples INSERT, UPDATE, DELETE, TRUNCATE, etc. when using multipleStatements as true: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SET @1 = 1; SET @2 = 2; `; conn.query(sql, (_err, results) => { console.log(results); /** * @results: [ ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 10, warningStatus: 0, changedRows: 0 }, ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } ] */ });","s":"ResultSetHeader[]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":92},{"i":113,"t":"2Stable History Version Changes v3.5.1 Introduce ProcedureCallPacket tip By performing a Call Procedure using INSERT, UPDATE, etc., the return will be a ProcedureCallPacket (even if you perform multiples queries and set multipleStatements to true): import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); /** ResultSetHeader */ conn.query('DROP PROCEDURE IF EXISTS myProcedure'); /** ResultSetHeader */ conn.query(` CREATE PROCEDURE myProcedure() BEGIN SET @1 = 1; SET @2 = 2; END `); /** ProcedureCallPacket */ const sql = 'CALL myProcedure()'; conn.query>(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ }); For CREATE PROCEDURE and DROP PROCEDURE, these returns will be the default ResultSetHeader. By using SELECT and SHOW queries in a Procedure Call, it groups the results as: /** ProcedureCallPacket */ [RowDataPacket[], ResultSetHeader] For ProcedureCallPacket, please see the following examples.","s":"ProcedureCallPacket","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":92},{"i":115,"t":"0Deprecated OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead.","s":"OkPacket","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#okpacket","p":92},{"i":117,"t":"You can also check some code examples using MySQL2 and TypeScript to understand advanced concepts: Extending and using Interfaces with RowDataPacket Extending and using Interfaces with RowDataPacket and rowAsArray Extending and using Interfaces with RowDataPacket and multipleStatements Extending and using Interfaces with RowDataPacket, rowAsArray and multipleStatements Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket from ProcedureCallPacket Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket and rowAsArray from ProcedureCallPacket Creating a basic custom MySQL2 Class","s":"Examples","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#examples","p":92},{"i":119,"t":"tip To explore the examples, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Examples","u":"/node-mysql2/docs/examples","h":"","p":118},{"i":121,"t":"MySQL-pg-proxy - MySQL to Postgres proxy server. MySQLite.js - MySQL server with JS-only (emscripten compiled) sqlite backend. SQL-engine - MySQL server with LevelDB backend. MySQL-osquery-proxy - Connect to facebook osquery using MySQL client PlyQL - Connect to Druid using MySQL client","s":"Examples using MySQL server API","u":"/node-mysql2/docs/examples","h":"#examples-using-mysql-server-api","p":118},{"i":123,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createConnection","u":"/node-mysql2/docs/examples/connections/create-connection","h":"","p":122},{"i":125,"t":"createConnection(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(connectionUri)","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":122},{"i":127,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config)","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":122},{"i":129,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config) — SHA1","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":122},{"i":131,"t":"createConnection(config: ConnectionOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); connection.addListener('error', (err) => { console.log(err); }); See ssl/certs.","s":"createConnection(config) — SSL","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":122},{"i":133,"t":"createConnection(config: ConnectionOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await connection.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); connection.addListener('error', (err) => { console.log(err); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { connection.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); });","s":"createConnection(config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":122},{"i":135,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#related-links","p":122},{"i":137,"t":"createConnection(config: ConnectionOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const connection = mysql.createConnection({ stream: socksProxy, }); connection.addListener('error', (err) => { console.log(err); }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const connection = mysql.createConnection({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); connection.addListener('error', (err) => { console.log(err); }); Testing connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createConnection(config) — Socks","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":122},{"i":140,"t":"ConnectionOptions Specification","s":"ConnectionOptions","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#connectionoptions","p":122},{"i":142,"t":"index.js 'use strict'; const mysql = require('mysql2'); const through2 = require('through2'); const binlogStream = mysql.createBinlogStream({ serverId: 123, // slave ID, first field in \"show slave hosts\" sql response // you can also specify slave host, username, password and port masterId: 0, filename: 'mysql-bin.000007', binlogPos: 120, flags: 1, // 1 = \"non-blocking mode\" }); binlogStream.pipe( through2.obj((obj, enc, next) => { console.log(obj); next(); }) );","s":"Binlog Watcher","u":"/node-mysql2/docs/examples/binlog-watcher","h":"","p":141},{"i":144,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPool","u":"/node-mysql2/docs/examples/connections/create-pool","h":"","p":143},{"i":146,"t":"createPool(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(connectionUri)","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":143},{"i":148,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config)","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig","p":143},{"i":150,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SHA1","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":143},{"i":152,"t":"createPool(config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SSL","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":143},{"i":154,"t":"createPool(config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await pool.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { pool.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":143},{"i":156,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#related-links","p":143},{"i":158,"t":"createPool(config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const pool = mysql.createPool({ stream: socksProxy, }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); Testing pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createPool(config) — Socks","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":143},{"i":161,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#pooloptions","p":143},{"i":163,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPoolCluster","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"","p":162},{"i":165,"t":"add(group: string, connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, connectionUri)","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":162},{"i":167,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config)","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":162},{"i":169,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SHA1","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":162},{"i":171,"t":"add(group: string, config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SSL","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":162},{"i":173,"t":"add(group: string, config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await poolCluster.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { poolCluster.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":162},{"i":175,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#related-links","p":162},{"i":177,"t":"add(group: string, config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { stream: socksProxy, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); Testing poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"add(group, config) — Socks","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":162},{"i":180,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":162},{"i":182,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. See detailed documentaion in Prepared Statements. tip If you execute same statement again, it will be picked form a LRU cache which will save query preparation time and give better performance. Usage examples: INSERT SELECT UPDATE DELETE","s":"Prepared Statements","u":"/node-mysql2/docs/examples/queries/prepared-statements","h":"","p":181},{"i":184,"t":"await.js co.js .babelrc package.json 'use strict'; const mysql = require('mysql2/promise'); async function test() { const c = await mysql.createConnection({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log('connected!'); const [rows, fields] = await c.query('show databases'); console.log(rows); try { const [rows, fields] = await c.query('some invalid sql here'); } catch (e) { console.log('caught exception!', e); } console.log(await c.execute('select sleep(0.5)')); console.log('after first sleep'); console.log(await c.execute('select sleep(0.5)')); console.log('after second sleep'); let start = +new Date(); console.log( await Promise.all([ c.execute('select sleep(2.5)'), c.execute('select sleep(2.5)'), ]) ); console.log( 'after 2+3 parallel sleep which is in fact not parallel because commands are queued per connection' ); let end = +new Date(); console.log(end - start); await c.end(); const p = mysql.createPool({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log(await p.execute('select sleep(0.5)')); console.log('after first pool sleep'); start = +new Date(); console.log( await Promise.all([ p.execute('select sleep(2.5)'), p.execute('select sleep(2.5)'), ]) ); console.log('after 2+3 parallel pool sleep'); end = +new Date(); console.log(end - start); await p.end(); } test() .then(() => { console.log('done'); }) .catch((err) => { console.log('error!', err); throw err; }); 'use strict'; const mysql = require('mysql2/promise'); const co = require('co'); co(function* () { const c = yield mysql.createConnection({ port: 3306, user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }) .then(function () { console.log('done'); }) .catch(function (err) { console.log(err); throw err; }); { \"plugins\": [\"transform-async-to-generator\"] } { \"name\": \"promise-co-await\", \"version\": \"1.0.0\", \"description\": \"\", \"main\": \"await.js\", \"scripts\": { \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\" }, \"author\": \"\", \"license\": \"ISC\", \"dependencies\": { \"babel-cli\": \"^6.9.0\" } }","s":"await — co","u":"/node-mysql2/docs/examples/promise-wrapper/co-await","h":"","p":183},{"i":187,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":185},{"i":189,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":185},{"i":191,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":185},{"i":194,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":185},{"i":196,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":185},{"i":199,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":197},{"i":201,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":197},{"i":203,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":197},{"i":206,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":197},{"i":208,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":197},{"i":211,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute(sql, values); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute(sql, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":209},{"i":213,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute({ sql, values, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, values, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":209},{"i":215,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, // ... other options }, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":209},{"i":218,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":209},{"i":221,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":219},{"i":223,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":219},{"i":225,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":219},{"i":228,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":219},{"i":230,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":219},{"i":232,"t":"info For Prepared Statements or Placeholders / Parameters examples, please see here. Usage examples: INSERT SELECT UPDATE DELETE","s":"Simple Queries","u":"/node-mysql2/docs/examples/queries/simple-queries","h":"","p":231},{"i":234,"t":"The examples below also work for the execute method.","s":"DELETE","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"","p":233},{"i":236,"t":"query(sql: string) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#querysql","p":233},{"i":238,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":233},{"i":241,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":233},{"i":243,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":233},{"i":245,"t":"The examples below also work for the execute method.","s":"INSERT","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"","p":244},{"i":247,"t":"query(sql: string) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#querysql","p":244},{"i":249,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":244},{"i":252,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":244},{"i":254,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":244},{"i":256,"t":"The examples below also work for the execute method.","s":"SELECT","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"","p":255},{"i":258,"t":"query(sql: string) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query(sql); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query(sql, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#querysql","p":255},{"i":260,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":255},{"i":262,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, rowsAsArray: true, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, rowsAsArray: true, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server as array fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options) — Row as Array","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":255},{"i":265,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":255},{"i":267,"t":"The examples below also work for the execute method.","s":"UPDATE","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"","p":266},{"i":269,"t":"query(sql: string) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#querysql","p":266},{"i":271,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":266},{"i":274,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":266},{"i":276,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":266},{"i":278,"t":"index.js 'use strict'; const mysql = require('mysql2'); const ClientFlags = require('mysql2/lib/constants/client.js'); const server = mysql.createServer(); server.listen(3307); server.on('connection', (conn) => { console.log('connection'); conn.serverHandshake({ protocolVersion: 10, serverVersion: 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, capabilityFlags: 0xffffff ^ ClientFlags.COMPRESS, }); conn.on('field_list', (table, fields) => { console.log('field list:', table, fields); conn.writeEof(); }); const remote = mysql.createConnection({ user: 'root', database: 'dbname', host: 'server.example.com', password: 'secret', }); conn.on('query', (sql) => { console.log(`proxying query: ${sql}`); remote.query(sql, function (err) { // overloaded args, either (err, result :object) // or (err, rows :array, columns :array) if (Array.isArray(arguments[1])) { // response to a 'select', 'show' or similar const rows = arguments[1], columns = arguments[2]; console.log('rows', rows); console.log('columns', columns); conn.writeTextResult(rows, columns); } else { // response to an 'insert', 'update' or 'delete' const result = arguments[1]; console.log('result', result); conn.writeOk(result); } }); }); conn.on('end', remote.end.bind(remote)); });","s":"MySQL Proxy","u":"/node-mysql2/docs/examples/tests/mysql-proxy","h":"","p":277},{"i":280,"t":"index.js 'use strict'; const pool = require('mysql2').createPool({ host: 'localhost', user: 'root', database: 'test', password: 'root', }); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.query((err, rows, fields) => { console.log(rows, fields); // Connection is automatically released once query resolves }); } }, 1000); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.getConnection((err, db) => { db.query('select sleep(0.5) as qqq', (err, rows, fields) => { console.log(rows, fields); db.release(); }); }); } }, 1000);","s":"Pool","u":"/node-mysql2/docs/examples/tests/pool","h":"","p":279},{"i":282,"t":"index.js 'use strict'; const mysql = require('mysql2'); const flags = require('mysql2/lib/constants/client.js'); const auth = require('mysql2/lib/auth_41.js'); function authenticate(params, cb) { console.log(params); const doubleSha = auth.doubleSha1('pass123'); const isValid = auth.verifyToken( params.authPluginData1, params.authPluginData2, params.authToken, doubleSha ); if (isValid) { cb(null); } else { // for list of codes lib/constants/errors.js cb(null, { message: 'wrong password dude', code: 1045 }); } } const server = mysql.createServer(); server.listen(3333); server.on('connection', (conn) => { // we can deny connection here: // conn.writeError({ message: 'secret', code: 123 }); // conn.close(); conn.serverHandshake({ protocolVersion: 10, serverVersion: '5.6.10', // 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, // capabilityFlags: 0xffffff, // capabilityFlags: -2113931265, capabilityFlags: 2181036031, authCallback: authenticate, }); conn.on('field_list', (table, fields) => { console.log('FIELD LIST:', table, fields); conn.writeEof(); }); conn.on('query', (query) => { conn.writeColumns([ { catalog: 'def', schema: 'test', table: 'test_table', orgTable: 'test_table', name: 'beta', orgName: 'beta', characterSet: 33, columnLength: 384, columnType: 253, flags: 0, decimals: 0, }, ]); conn.writeTextRow(['test тест テスト փորձարկում পরীক্ষা kiểm tra ']); conn.writeTextRow(['ტესტი પરીક્ષણ מבחן פּרובירן اختبار परीक्षण']); conn.writeEof(); conn.close(); }); });","s":"Server","u":"/node-mysql2/docs/examples/tests/server","h":"","p":281},{"i":284,"t":"index.ts db.ts /** * The types are explicity for learning purpose */ import { PoolOptions } from 'mysql2/promise'; import { MySQL } from './db.js'; interface User extends RowDataPacket { id: number; name: string; } const access: PoolOptions = { host: '', user: '', password: '', database: '', }; (async () => { const mysql = new MySQL(access); /** Deleting the `users` table, if it exists */ await mysql.queryResult('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await mysql.queryResult( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await mysql.executeResult( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await mysql.queryRows( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user: User) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await mysql.connection.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */ /** * The types are explicity for learning purpose */ import { createPool, PoolOptions, Pool, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; export class MySQL { private conn: Pool; private credentials: PoolOptions; constructor(credentials: PoolOptions) { this.credentials = credentials; this.conn = createPool(this.credentials); } /** A random method to simulate a step before to get the class methods */ private ensureConnection() { if (!this?.conn) this.conn = createPool(this.credentials); } /** For `SELECT` and `SHOW` */ get queryRows() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get queryRowsAsArray() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get queryResult() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get queryResults() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` */ get executeRows() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get executeRowsAsArray() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get executeResult() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get executeResults() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** Expose the Pool Connection */ get connection() { return this.conn; } }","s":"Basic Custom Class","u":"/node-mysql2/docs/examples/typescript/basic-custom-class","h":"","p":283},{"i":286,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user.id); console.log('name:', user.name); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet","u":"/node-mysql2/docs/examples/typescript/procedure-call/index","h":"","p":285},{"i":288,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/docs/examples/typescript/procedure-call/row-as-array","h":"","p":287},{"i":290,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet","u":"/node-mysql2/docs/examples/typescript/row-data/index","h":"","p":289},{"i":292,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements)","u":"/node-mysql2/docs/examples/typescript/row-data/multi-statements","h":"","p":291},{"i":294,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Row as Array)","u":"/node-mysql2/docs/examples/typescript/row-data/row-as-array","h":"","p":293},{"i":296,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/docs/examples/typescript/row-data/row-as-array-multi-statements","h":"","p":295},{"i":298,"t":"This section provides answers to commonly asked questions about MySQL2. tip To explore the FAQs, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Frequently Asked Questions","u":"/node-mysql2/docs/faq","h":"","p":297},{"i":300,"t":"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.","s":"How to handle errors?","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"","p":299},{"i":302,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors by adding an error event listener: const mysql = require('mysql2'); connection = mysql.createConnection({ host: '', user: '', database: '', }); connection.addListener('error', (err) => { if (err instanceof Error) { console.log(`createConnection error:`, err); } }); createPool 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const pool = mysql.createPool({ host: '', user: '', database: '', }); pool.getConnection((err, connection) => { if (err instanceof Error) { console.log('pool.getConnection error:', err); return; } }); createPoolCluster 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); poolCluster.getConnection('NodeI', (err, connection) => { if (err instanceof Error) { console.log('poolCluster.getConnection error:', err); return; } }); execute 2Stable This solution has been tested. Handling execute errors through callback's err parameter: connection.execute('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('execute error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through callback's err parameter: connection.query('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('query error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using callbacks","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":299},{"i":304,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: '', user: '', database: '', }); } catch (err) { if (err instanceof Error) { console.log(err); } } createPool 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const pool = mysql.createPool({ host: '', user: '', database: '', }); try { const connection = await pool.getConnection(); } catch (err) { if (err instanceof Error) { console.log(err); } } createPoolCluster 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); try { await poolCluster.getConnection('NodeI'); } catch (err) { if (err instanceof Error) { console.log('createConnection error:', err); } } execute 2Stable This solution has been tested. Handling execute errors through try-catch block: try { const [rows] = await connection.execute('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('execute error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through try-catch block: try { const [rows] = await connection.query('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('query error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using promises","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#using-promises","p":299},{"i":306,"t":"Discussions #1998 #2282","s":"Related Links","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#related-links","p":299},{"i":308,"t":"MySQL2 project is a continuation of MySQL-Native. Protocol parser code was rewritten from scratch and api changed to match popular Node MySQL. MySQL2 team is working together with Node MySQL team to factor out shared code and move it under mysqljs organization. MySQL2 is mostly API compatible with Node MySQL and supports majority of features. MySQL2 also offers these additional features: Faster / Better Performance Prepared Statements MySQL Binary Log Protocol MySQL Server Extended support for Encoding and Collation Promise Wrapper Compression SSL and Authentication Switch Custom Streams Pooling","s":"History and Why MySQL2","u":"/node-mysql2/docs/history-and-why-mysq2","h":"","p":307},{"i":310,"t":"The Stability Badges are indications of a section's stability. The stability indices are as follows: 0Deprecated The feature might generate warnings and does not assure backward compatibility. Experimental: These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged. Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features. Experimental features are classified into stages: 1Experimental Experimental features at this stage are currently in development and prone to considerable changes. 1.1Early Development Experimental features at this stage are approaching minimum viability. 1.2Release Candidate Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification. 2Stable Compatibility with the MySQL ecosystem is a high priority. 3Legacy This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available. Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed.","s":"Stability Badges","u":"/node-mysql2/docs/stability-badges","h":"","p":309}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/2",[0,4.512,1,3.687,2,5.936,3,5.936,4,1.437,5,4.837,6,5.936,7,1.871,8,3.687,9,5.936,10,2.61,11,5.936,12,4.837,13,5.936,14,3.687,15,3.087,16,5.274,17,4.295,18,4.837,19,5.936,20,5.936,21,1.492,22,0.537,23,4.512,24,3.849,25,4.251,26,3.687,27,5.274,28,3.187,29,5.936]],["t/4",[4,1.495,14,4.826,24,3.457,26,3.312,30,2.127,31,4.737,32,4.345,33,4.345,34,6.902,35,4.345,36,1.786,37,1.558,38,1.903,39,5.332,40,2.773,41,4.737,42,1.862,43,4.737,44,5.332,45,2.032,46,4.737,47,5.332,48,4.737,49,4.345,50,5.332,51,4.737,52,5.332,53,4.737,54,2.539,55,4.737,56,5.332,57,1.75,58,5.332,59,2.286,60,6.194,61,4.345,62,3.312,63,5.332,64,3.819,65,4.737,66,5.332]],["t/6",[1,4.125,4,1.278,15,3.454,23,5.048,28,3.566,67,4.515,68,6.642,69,3.819,70,4.757,71,3.163,72,3.078,73,4.757,74,6.642,75,5.901,76,5.048,77,5.413,78,6.642,79,4.515]],["t/8",[5,4.907,30,3.283,54,2.868,62,3.74,80,6.021,81,4.907,82,6.553,83,6.021,84,6.021,85,6.021,86,5.35,87,5.35,88,5.35,89,6.142,90,5.892,91,6.253,92,5.35,93,5.35,94,4.576,95,2.06,96,3.905]],["t/10",[4,0.85,21,1.227,22,0.867,28,2.372,37,0.987,42,2.665,45,1.684,59,1.213,71,1.347,72,1.311,79,1.923,95,1.511,97,2.026,98,1.182,99,2.305,100,1.923,101,3.892,102,1.57,103,1.835,104,0.777,105,1.01,106,2.047,107,1.975,108,0.999,109,1.214,110,1.722,111,1.722,112,2.54,113,1.044,114,2.297,115,1.392,116,2.574,117,1.168,118,1.687,119,3.665,120,2.925,121,2.015,122,2.771,123,2.701,124,3.297,125,2.57,126,2.394,127,1.45,128,1.286,129,1.722,130,1.722,131,1.762,132,1.576,133,1.611,134,1.191,135,1.322,136,1.083,137,0.716,138,3.357,139,0.988]],["t/12",[0,3.23,4,1.013,7,0.849,21,1.194,22,0.843,30,1.695,37,0.949,42,2.528,45,1.026,59,1.822,69,2.443,71,3.905,72,3.476,79,1.83,91,2.047,95,1.453,97,1.928,98,1.252,99,2.194,100,1.83,102,1.495,103,1.746,104,1.168,105,0.961,106,1.969,107,1.922,108,0.896,109,0.949,110,1.657,111,1.657,112,2.443,113,1.004,114,2.21,115,1.339,116,1.55,117,0.712,118,1.642,120,2.024,121,1.394,123,1.869,125,1.778,126,2.33,127,1.394,128,1.237,129,1.657,130,1.657,131,1.695,132,1.516,133,1.55,134,0.726,135,0.915,136,0.66,138,2.047,139,0.941,140,2.392,141,2.693,142,2.536,143,2.888,144,3.043,145,1.4,146,2.693,147,1.746,148,2.392,149,2.693,150,2.693,151,2.693,152,1.1,153,1.74,154,2.194,155,1.746,156,3.463,157,0.902,158,3.23,159,2.281,160,4.249,161,3.23,162,4.249,163,4.249,164,1.672,165,2.194,166,2.392,167,2.047,168,1.928,169,2.392]],["t/14",[4,0.879,10,3.568,21,1.739,22,0.826,36,1.772,37,0.487,45,0.831,49,1.777,51,1.938,54,2.518,59,0.935,79,1.482,95,1.226,97,1.562,98,0.879,99,1.777,100,1.482,102,2.534,103,2.961,104,0.599,105,0.778,106,2.451,107,1.153,108,0.876,109,1.02,111,1.398,112,2.062,113,0.847,114,1.865,115,1.13,117,0.577,118,1.453,120,1.708,127,1.177,128,0.635,134,0.588,135,0.983,136,0.535,137,0.74,139,0.762,142,2.725,143,1.482,145,1.865,155,1.414,170,1.938,171,1.938,172,2.181,173,2.181,174,2.181,175,2.181,176,1.938,177,1.482,178,1.482,179,1.938,180,2.181,181,2.181,182,1.938,183,2.181,184,1.171,185,0.795,186,1.577,187,1.809,188,4.5,189,1.925,190,3.586,191,2.268,192,5.288,193,3.429,194,3.586,195,3.586,196,5.288,197,3.586,198,5.288,199,3.586,200,3.586,201,3.586,202,2.75,203,3.586,204,3.586,205,1.355,206,2.181,207,2.181,208,2.181,209,1.134,210,1.938,211,1.938,212,2.181,213,2.181,214,4.31,215,4.698,216,3.185,217,3.185,218,2.863,219,3.185,220,2.181,221,1.658,222,2.181,223,2.181,224,1.465,225,1.414,226,3.185,227,2.922,228,1.99,229,1.99,230,3.586,231,1.482,232,2.181,233,2.181,234,0.85,235,1.938]],["t/16",[4,1.12,10,2.796,16,2.282,21,1.474,22,0.853,24,1.666,28,1.379,30,2.537,45,2.219,70,1.84,73,1.84,98,0.982,102,4.626,104,1.599,105,1.461,106,2.946,107,2.285,108,1.14,109,1.513,110,1.99,111,2.27,112,3.347,113,1.375,114,3.027,115,1.834,116,1.493,118,1.599,120,1.949,121,1.343,123,1.8,127,1.675,133,0.937,137,1.031,139,0.897,142,1.533,159,2.198,188,1.84,189,1.379,224,1.672,234,1.002,236,1.533,237,2.569,238,2.569,239,2.569,240,2.934,241,3.637,242,4.094,243,4.094,244,2.282,245,2.569,246,3.637,247,2.093,248,6.358,249,2.093,250,3.336,251,2.569,252,2.282,253,2.569,254,1.84,255,2.569,256,2.569,257,2.569,258,1.215,259,1.533,260,2.569,261,2.282,262,1.19,263,2.569,264,1.596]],["t/18",[4,0.634,7,1.565,14,2.048,21,0.992,22,0.822,42,2.493,45,1.256,46,4.413,59,1.414,62,2.048,95,1.128,98,1.444,102,2.757,103,3.221,107,1.597,108,0.896,109,1.11,110,1.937,111,1.937,112,2.856,113,1.174,114,2.583,115,1.565,116,2.18,117,0.872,118,1.828,121,1.082,125,2.078,129,1.937,134,0.889,135,1.069,136,0.809,142,1.967,170,4.413,186,1.45,187,1.663,191,2.853,224,2.029,227,4.048,234,2.33,247,2.686,258,1.775,265,2.929,266,2.686,267,4.836,268,2.929,269,3.297,270,3.297,271,2.686,272,5.702,273,2.563,274,2.929,275,5.057,276,4.314,277,4.967,278,1.967,279,2.241,280,2.686,281,2.929,282,3.297,283,3.297,284,4.048,285,3.297,286,3.297,287,2.506]],["t/20",[30,2.83,59,3.041,147,4.599,179,6.3,226,6.3,247,5.779,288,7.092,289,3.2,290,7.092,291,5.079]],["t/22",[1,3.398,4,1.659,10,2.406,14,4.886,15,2.845,23,4.158,24,3.548,28,2.937,30,2.829,34,4.86,54,2.605,59,2.346,60,4.86,61,4.458,62,3.398,69,3.146,70,3.918,71,2.605,72,2.535,76,4.158,77,4.458,79,3.719,102,3.037,128,1.593,144,3.918,205,3.398,284,4.458,292,5.471,293,4.458,294,5.471,295,4.86,296,3.918,297,3.398,298,5.389,299,4.458,300,3.918,301,4.158]],["t/24",[30,2.981,59,3.204,95,2.555,147,4.845]],["t/26",[22,0.664,25,5.256,35,4.704,37,1.29,38,2.619,40,3.817,53,5.128,88,5.128,104,1.586,147,3.743,155,3.743,191,2.475,205,3.585,279,3.924,302,7.339,303,5.772,304,4.074,305,5.772,306,5.128,307,5.772,308,5.128,309,5.772,310,4.387,311,5.772,312,5.128,313,3.445,314,2.458,315,5.772,316,5.772,317,5.772]],["t/28",[1,4.681,4,1.659,14,5.11,27,5.35,28,4.417,32,4.907,67,4.093,71,2.868,72,2.79,81,6.142,94,4.576,128,1.753,271,4.907,318,6.021,319,5.35,320,6.021,321,6.021,322,7.537,323,7.537,324,6.021]],["t/30",[4,1.342,14,4.331,90,4.995,95,2.385,117,1.844,325,6.974,326,6.716,327,8.773,328,6.196]],["t/32",[0,1.662,17,1.257,21,1.058,22,0.834,24,1.418,28,2.456,36,0.733,37,1.307,45,2.534,61,2.928,69,1.257,95,0.748,102,1.214,103,1.418,107,1.155,108,0.877,110,1.401,113,0.849,115,1.132,121,1.179,128,1.542,132,2.372,135,0.471,137,0.583,143,1.486,157,1.204,158,4.026,184,1.174,187,1.813,191,0.938,205,1.358,214,1.782,221,1.662,224,1.468,234,0.853,280,1.782,297,1.358,300,2.573,301,3.476,306,1.943,310,2.731,313,2.73,314,1.96,329,2.187,330,2.187,331,2.187,332,4.316,333,4.064,334,3.727,335,2.94,336,2.187,337,5.658,338,4.191,339,3.727,340,2.187,341,2.187,342,1.943,343,2.187,344,4.574,345,6.647,346,1.662,347,3.192,348,1.943,349,2.187,350,2.187,351,2.187,352,1.782,353,1.633,354,2.187,355,2.187,356,4.574,357,2.187,358,3.192,359,2.39,360,3.192,361,2.187,362,2.187,363,4.506,364,3.593,365,3.192,366,4.064,367,2.928,368,1.782,369,1.782,370,3.593,371,3.593,372,3.593,373,1.662,374,4.574,375,3.593,376,1.566,377,1.566,378,2.187,379,5.297,380,1.782,381,2.187,382,2.187,383,2.187,384,1.943,385,2.187,386,1.782,387,2.187,388,1.782,389,1.782,390,2.187,391,2.187,392,2.187,393,3.593,394,1.943,395,1.662,396,1.358,397,1.662,398,2.187,399,2.187,400,1.943,401,2.33,402,2.187,403,1.566,404,1.943,405,1.943,406,1.943]],["t/34",[21,0.743,22,0.85,28,1.998,37,1.752,45,2.989,107,1.197,108,0.558,110,1.451,113,1.284,121,1.221,126,1.451,128,1.083,132,1.939,137,0.603,152,1.52,165,3.033,214,3.033,221,2.828,224,1.52,297,3.375,300,5.056,301,2.828,313,2.221,314,1.247,332,5.232,333,3.306,334,3.033,337,4.429,338,3.892,339,3.033,358,3.306,359,2.897,360,3.306,401,2.413,403,3.892,404,3.306,405,3.306,407,3.721,408,5.704,409,3.721,410,3.033,411,3.721,412,3.721,413,3.306,414,1.877,415,6.42,416,6.42,417,3.721,418,3.721,419,3.721,420,3.721,421,5.435,422,3.721,423,7.842,424,3.721,425,3.721,426,3.721,427,3.721,428,3.721]],["t/36",[137,1.16,414,3.608,429,6.817,430,7.152,431,5.829,432,7.152,433,7.152,434,5.436]],["t/38",[67,4.946,82,5.53,279,4.946,328,6.465,435,7.277,436,7.277,437,7.277]],["t/40",[14,3.572,22,0.364,30,2.678,54,1.917,55,3.576,59,2.466,82,4.372,86,3.576,87,3.576,90,5.244,94,4.372,95,1.377,96,2.61,106,1.865,114,2.991,128,1.675,176,3.576,184,2.161,205,2.5,287,3.059,291,5.244,314,1.927,326,5.469,413,3.576,429,6.564,431,3.28,434,3.059,438,5.752,439,5.752,440,4.025,441,5.962,442,4.025,443,5.752,444,5.752,445,4.025,446,4.025,447,5.752,448,4.025,449,5.752,450,4.025,451,4.025,452,4.025,453,5.11,454,4.025,455,2.61,456,4.025,457,4.025,458,4.025,459,4.025,460,3.576,461,3.576,462,5.752,463,4.025,464,4.025,465,4.025,466,3.576,467,3.576,468,4.025,469,4.025,470,4.025,471,3.059,472,4.025,473,4.025,474,4.025,475,4.025,476,3.576,477,3.576,478,3.28]],["t/42",[94,4.512,106,2.751,130,2.314,137,0.962,274,5.274,287,4.512,298,4.512,304,3.295,431,4.837,460,5.274,471,4.512,479,5.854,480,5.936,481,5.274,482,7.262,483,5.274,484,5.274,485,6.087,486,5.936,487,5.936,488,6.636,489,5.936,490,5.936,491,5.274,492,5.936,493,3.687,494,5.936]],["t/44",[22,0.805,40,2.922,95,1.921,104,1.544,120,2.675,164,3.489,314,1.882,396,5.221,455,5.867,479,5.166,485,4.578,495,6.389,496,5.618,497,4.991,498,4.578,499,5.618,500,5.618,501,5.618,502,4.991,503,5.878,504,4.578,505,5.618]],["t/46",[22,0.77,54,2.768,79,3.951,95,1.988,104,1.597,133,2.12,164,3.61,202,3.023,258,1.726,273,2.493,275,4.418,314,1.947,414,2.932,479,4.163,485,4.737,503,6.597,504,4.737,506,7.563,507,5.164,508,5.813,509,5.813,510,7.371,511,5.813,512,5.813,513,5.813,514,4.399]],["t/48",[17,3.487,22,0.747,26,3.767,95,2.074,100,4.122,104,1.666,122,2.737,137,0.983,164,3.767,471,5.754,479,5.422,482,6.726,488,6.726,491,5.388,504,4.943,515,7.904,516,6.065,517,6.065,518,4.943,519,5.388]],["t/50",[22,0.805,95,2.254,104,1.811,520,8.564,521,6.59,522,6.59,523,6.59,524,6.59,525,6.59,526,6.59,527,6.59,528,6.59,529,6.59,530,6.59]],["t/52",[41,7.06,62,4.076,64,3.486,90,6.122,106,2.255,115,1.534,147,4.815,153,1.417,268,4.324,284,6.476,304,2.702,326,6.966,353,1.263,429,3.966,471,3.699,479,3.486,531,6.563,532,5.83,533,6.563,534,4.867,535,4.867,536,7.947,537,7.947,538,4.324,539,4.867,540,4.867,541,6.563,542,6.563,543,6.563,544,4.867,545,3.486,546,4.324,547,4.867]],["t/55",[22,0.626,48,6.144,106,3.205,128,2.014,142,4.128,254,4.953,548,6.916,549,6.916,550,5.256,551,3.976,552,6.916,553,6.916,554,6.916]],["t/57",[21,1.714,184,4.011,555,7.471]],["t/59",[1,3.059,22,0.676,28,3.551,36,1.65,42,2.311,76,3.743,98,0.948,103,3.193,118,2.052,119,2.939,127,2.171,128,1.434,142,2.939,267,3.059,291,3.527,363,3.527,366,5.877,367,6.087,497,4.375,545,3.527,550,3.743,556,4.924,557,4.013,558,4.013,559,4.013,560,5.39,561,4.013,562,4.013,563,4.924,564,7.094,565,4.924,566,4.924,567,3.347,568,6.615,569,3.347,570,4.375,571,4.924,572,6.615,573,4.924,574,7.469,575,4.924,576,4.924,577,4.924,578,4.924]],["t/61",[8,3.023,17,2.798,21,0.972,28,2.613,33,3.966,37,1.775,38,2.836,40,2.531,59,2.087,118,1.337,128,1.911,178,3.308,188,5.942,297,3.023,339,5.348,377,3.486,400,4.324,545,5.692,550,4.988,564,7.371,570,5.83,579,6.563,580,5.348,581,4.867,582,4.867,583,4.324,584,4.867,585,4.867,586,4.867,587,4.867,588,4.867,589,4.867,590,4.867,591,4.867,592,4.867,593,3.486,594,4.867,595,4.867,596,4.867,597,4.867,598,4.867]],["t/64",[0,3.515,22,0.871,42,2.848,49,3.769,69,2.659,71,3.019,72,3.352,116,2.312,119,2.76,127,2.08,135,0.996,137,0.75,144,3.313,158,3.515,159,2.483,168,5.838,178,3.144,205,2.873,258,2.31,377,3.313,410,3.769,599,3.769,600,4.109,601,4.625,602,4.625,603,4.625,604,3.313,605,4.625,606,4.109,607,3.515,608,4.109,609,4.625]],["t/66",[1,2.512,21,1.344,22,0.856,33,3.296,40,2.103,42,2.016,71,2.749,72,3.739,96,3.743,103,2.623,115,1.819,127,1.327,135,1.242,137,1.19,140,3.593,145,2.103,155,2.623,167,3.074,168,2.897,177,2.749,178,3.923,182,3.593,184,2.171,205,3.585,236,2.414,244,3.593,266,5.484,267,3.585,273,2.475,275,3.074,279,2.749,334,3.296,414,2.04,608,5.128,610,5.772,611,4.045,612,4.045,613,5.772,614,4.045,615,4.045,616,4.045,617,4.045,618,3.593,619,4.045,620,4.045,621,4.045,622,4.045,623,4.045,624,4.045,625,4.045,626,3.593,627,4.045,628,2.512]],["t/68",[22,0.606,72,3.727,137,1.086,167,5.088,168,6.175,178,4.551,188,4.795,293,5.456,314,2.243,394,5.948,629,6.695,630,6.695,631,6.695,632,6.695]],["t/70",[4,1.074,8,3.466,22,0.828,36,1.869,40,2.902,42,1.949,45,2.127,81,4.547,153,1.625,191,2.393,202,2.902,234,2.8,258,1.657,312,6.38,347,4.958,353,1.448,478,4.547,583,4.958,633,5.58,634,4.958,635,6.38,636,5.58,637,5.58,638,4.241,639,5.58,640,4.958,641,5.58,642,7.182,643,7.182,644,5.58]],["t/72",[22,0.859,30,1.722,71,3.32,72,2.8,98,0.83,116,2.542,118,2.264,127,2.704,135,1.501,136,1.71,152,1.763,153,1.256,154,3.517,155,2.798,156,4.924,157,1.446,159,3.743,258,2.361,414,4.011,606,3.834,635,6.194,645,4.898,646,7.553,647,7.553]],["t/74",[54,3.496,59,3.148,71,3.496,72,3.401,95,2.511,96,4.76]],["t/77",[1,2,4,0.62,8,3.66,22,0.869,28,1.729,36,2.203,37,0.72,70,2.307,71,1.534,72,1.492,98,0.939,116,2.398,121,2.158,127,2.319,128,0.938,135,1.415,137,0.791,138,4.997,142,1.922,143,4.006,152,1.994,153,1.421,177,2.189,187,1.625,191,1.381,234,1.256,258,2.506,267,3.031,273,1.381,308,2.861,313,1.922,314,1.079,348,2.861,401,3.165,414,1.625,599,3.977,648,2.625,649,3.221,650,5.893,651,3.221,652,2.625,653,4.336,654,3.221,655,7.956,656,4.881,657,8.146,658,3.221,659,4.336,660,2.861]],["t/79",[7,1.819,22,0.853,36,2.844,42,2.564,108,0.865,116,2.105,118,2.333,135,1.242,161,4.387,191,2.475,252,5.128,267,4.558,272,4.387,276,3.743,314,1.934,466,5.128,661,5.772,662,5.772,663,5.772]],["t/81",[4,0.608,7,1.835,8,2.988,21,0.961,22,0.84,32,2.575,37,1.301,45,1.833,98,1.121,107,1.016,108,1.05,110,1.232,113,0.747,115,2.208,118,1.322,119,3.476,120,2.774,128,0.92,132,2.323,137,0.512,139,1.104,152,1.291,184,1.696,187,2.427,205,1.963,275,2.402,278,1.886,287,5.61,291,2.263,297,1.963,314,1.951,342,5.785,353,1.248,363,2.263,367,3.92,369,2.575,396,1.963,403,2.263,441,7.027,467,6.557,519,4.274,660,2.807,664,4.81,665,3.777,666,7.381,667,3.16,668,3.16,669,6.511,670,2.807,671,1.696,672,2.263,673,5.825,674,4.81,675,2.871,676,3.16,677,3.16,678,3.16,679,3.16,680,3.16,681,3.16,682,3.16,683,2.807,684,2.807,685,3.16,686,3.16,687,3.16]],["t/83",[4,1.046,10,2.823,21,1.5,22,0.832,42,1.3,45,2.447,95,1.273,107,1.747,108,1.244,110,1.451,111,2.119,112,2.14,113,1.284,115,2.023,133,1.357,137,1.041,139,1.898,184,3.447,185,1.357,189,1.998,193,2.413,246,3.306,272,2.828,279,2.529,296,2.665,297,2.311,314,1.247,359,2.897,376,2.665,386,3.033,388,3.033,403,2.665,551,3.125,626,3.306,659,3.306,665,4.869,688,3.306,689,3.721,690,3.721,691,3.721,692,3.721,693,3.721,694,3.721,695,3.721,696,3.721,697,3.721,698,2.14,699,3.721,700,5.435,701,3.033,702,3.721,703,4.828,704,4.13,705,2.828,706,3.306,707,5.435,708,3.721,709,2.311,710,3.721,711,1.387,712,3.721,713,2.828,714,3.721]],["t/85",[18,5.829,24,4.638,102,3.97,250,5.829,297,4.442,299,5.829,715,7.152,716,4.269,717,7.152]],["t/87",[4,1.239,8,2.938,10,2.83,21,0.945,22,0.866,37,1.057,73,3.387,98,0.91,102,2.625,108,1.097,118,1.3,136,1.16,142,2.823,143,4.375,215,4.202,235,4.202,261,4.202,272,4.892,353,1.227,368,3.854,532,4.202,604,4.61,706,5.718,711,2.399,718,4.73,719,4.73,720,3.854,721,4.73,722,6.437,723,5.718,724,4.73,725,4.73,726,4.73,727,4.73,728,4.73,729,4.73,730,4.73]],["t/89",[4,1.268,10,2.153,22,0.847,43,4.349,45,2.511,107,2.118,108,1.246,109,1.857,110,1.909,115,2.076,118,1.345,127,1.607,153,1.425,189,2.628,216,5.853,224,2,240,3.788,264,3.041,273,2.825,414,2.47,698,2.815,720,5.369,731,4.895,732,4.349,733,4.895,734,4.349,735,4.349,736,5.853,737,4.349,738,4.895,739,4.895,740,4.895,741,4.349]],["t/91",[4,1.067,22,0.842,95,1.896,107,1.782,108,1.254,109,1.238,113,1.31,114,2.883,127,1.819,139,1.936,161,4.213,191,2.377,193,3.595,262,2.569,352,6.451,645,3.595,648,4.517,742,6.353,743,4.925,744,4.925,745,5.543,746,4.925,747,4.925,748,4.925,749,4.925,750,4.925,751,4.925,752,5.543]],["t/94",[30,3.048,57,2.02,67,4.183,82,5.807,89,6.226,90,5.472,91,5.807,92,5.467,93,6.788,137,0.998,403,4.408,406,5.467,580,5.015,665,3.991,688,5.467,753,6.154,754,6.154,755,6.154,756,6.154,757,4.677,758,4.408,759,6.154]],["t/96",[4,1.672,22,0.691,30,3.315,104,2.455,105,2.726,187,3.854,191,2.639,211,5.467,265,5.467,314,2.559,638,4.677,760,7.64,761,7.64]],["t/98",[4,1.258,22,0.836,30,2.609,104,1.797,107,2.102,108,1.189,113,1.545,115,2.499,224,2.671,671,3.51,762,3.884,763,4.24]],["t/100",[4,1.258,22,0.836,30,2.609,104,1.797,107,2.102,108,1.189,113,1.545,115,2.499,224,2.671,671,3.51,764,4,765,6.538]],["t/102",[22,0.872,95,1.735,98,0.976,101,3.634,115,2.547,127,2.761,147,3.29,155,3.29,221,3.856,258,2.399,273,2.894,279,3.448,304,3.746,723,4.507,732,4.507,766,4.587,767,4.191,768,3.623,769,2.126,770,3.634]],["t/105",[4,0.991,22,0.881,30,2.055,37,0.773,95,1.183,104,1.415,107,1.656,108,0.772,110,2.008,113,1.217,115,2.738,116,2.244,120,2.453,127,2.726,137,0.561,191,2.209,224,2.104,258,2.024,262,3.158,267,2.149,273,2.923,276,3.34,314,1.159,514,2.065,766,4.633,768,2.765,771,3.46,772,3.34,773,5.151,774,3.46,775,3.46,776,2.065]],["t/107",[4,0.937,7,1.534,22,0.874,30,1.942,98,0.937,104,1.337,107,1.565,108,0.984,110,1.898,113,1.15,115,2.694,116,2.393,127,2.154,137,0.789,191,2.814,224,1.988,258,1.949,262,2.255,273,3.184,314,1.63,401,3.156,514,2.905,766,3.308,768,2.613,776,2.905,777,4.256,778,4.867]],["t/109",[4,0.843,7,1.381,22,0.846,30,1.749,42,2.134,57,1.438,59,2.619,104,1.204,107,1.409,108,0.916,110,1.709,113,1.036,115,1.925,125,1.834,137,0.99,177,4.152,187,2.211,202,4.159,218,2.992,224,1.79,258,1.814,273,1.88,314,1.468,373,4.642,395,4.642,396,2.722,455,2.842,495,3.331,514,2.616,567,4.152,569,2.979,607,4.642,758,3.139,766,2.979,769,2.215,779,3.572,780,3.894,781,4.642,782,4.375,783,1.978,784,2.147,785,2.031,786,3.894,787,4.383,788,3.139,789,3.139,790,3.139]],["t/111",[4,0.802,7,1.313,22,0.858,30,1.662,42,2.059,57,1.934,104,1.144,107,1.339,108,0.883,110,1.624,113,0.984,115,1.857,125,1.743,137,0.675,187,2.973,191,2.527,193,2.701,202,4.587,224,1.701,258,1.75,273,2.933,396,2.587,401,2.701,455,2.701,495,3.166,514,2.486,567,4.006,569,4.006,758,2.983,766,2.831,769,2.343,777,3.822,779,3.394,782,4.221,783,1.88,784,2.041,785,1.93,786,3.701,788,4.221,789,4.221,790,4.221,791,3.701,792,4.165]],["t/113",[4,0.689,7,1.128,22,0.849,30,1.428,37,1.18,42,2.192,54,1.704,57,1.174,59,1.534,69,3.036,95,1.224,98,1.016,104,0.983,106,2.447,107,1.151,108,0.792,110,1.395,113,0.845,115,1.664,116,1.305,125,1.497,137,0.856,158,4.77,164,2.222,187,3.166,188,2.563,191,1.534,202,3.843,224,1.462,227,2.916,258,1.568,259,2.136,273,2.691,293,2.916,380,2.916,396,2.222,401,2.32,455,2.32,495,2.72,514,2.136,567,2.432,569,2.432,672,2.563,758,2.563,766,2.432,768,1.921,769,2.437,770,4.495,772,2.32,777,2.32,779,2.916,782,2.563,783,1.615,784,1.753,788,2.563,789,2.563,790,2.563,791,3.179,793,6.302,794,3.578,795,3.578,796,3.578,797,6.276,798,2.916,799,3.578,800,3.578,801,5.28]],["t/115",[59,3.016,137,1.14,177,4.78,218,3.445,373,5.345,395,5.345,607,5.345,769,2.216,780,6.248,781,5.345,802,6.248]],["t/117",[12,4.345,17,3.065,30,2.782,89,4.345,95,1.824,106,2.471,137,1.449,147,5.038,701,4.345,716,5.235,768,4.709,769,2.197,770,4.994,777,4.521,803,5.332,804,5.332,805,5.332,806,4.869,807,6.902,808,5.332]],["t/119",[59,2.99,95,2.385,97,4.995,137,1.131,164,4.331,671,3.744,809,6.196,810,6.196,811,6.196,812,6.196,813,6.196,814,6.196]],["t/121",[4,1.754,7,1.832,21,1.473,28,3.957,128,2.357,137,1.195,483,5.164,634,5.164,703,7.191,815,5.813,816,5.813,817,5.813,818,5.813,819,5.813,820,7.371,821,5.813,822,5.813,823,7.371,824,5.813,825,5.813,826,5.813]],["t/123",[54,3.406,57,2.347,59,3.067,71,3.406,72,3.314,95,2.446,98,1.61,101,5.122]],["t/125",[4,1.406,21,1.46,22,0.857,38,2.046,104,1.575,105,2.046,108,1.206,109,1.281,110,2.849,117,1.516,134,1.545,135,1.573,136,1.792,139,2.003,827,5.733,828,1.736,829,1.736,830,6.492,831,3.718]],["t/127",[4,1.283,21,1.332,22,0.862,104,1.369,105,1.778,107,2.144,108,1.126,109,1.113,110,2.599,111,2.599,112,3.833,113,1.575,114,3.467,115,2.101,117,1.318,134,1.343,135,1.435,136,1.635,139,1.741,359,3.009,551,3.833,709,4.141,762,2.441,828,1.509,829,1.509,831,3.231,832,3.569]],["t/129",[4,1.347,21,1.399,22,0.866,104,1.474,105,1.915,108,1.168,109,1.199,110,2.73,117,1.419,134,1.446,135,1.507,136,1.717,139,1.874,713,5.321,762,2.629,828,1.625,829,1.625,831,3.479,832,3.843,833,4.373,834,4.373,835,5.706,836,4.373]],["t/131",[4,1.224,15,3.309,21,1.271,22,0.869,54,2.215,104,1.278,105,1.66,108,1.087,109,1.039,110,2.481,117,1.23,134,1.254,135,1.37,136,1.561,139,1.625,335,3.532,762,2.278,828,1.408,829,1.408,831,3.016,832,3.331,837,3.79,838,5.552,839,6.356,840,5.186,841,3.798,842,3.798,843,5.186,844,3.79]],["t/133",[4,1.248,15,3.933,21,1.296,22,0.854,36,1.269,37,0.846,38,1.352,45,1.444,104,1.041,105,1.352,108,1.067,109,1.449,110,2.147,111,2.147,115,1.735,117,1.456,134,1.484,135,1.628,136,1.746,137,0.893,139,1.323,296,2.713,353,0.983,376,2.713,604,3.943,762,1.856,828,1.147,829,1.147,831,2.457,832,2.713,838,2.575,841,2.261,842,3.286,845,4.839,846,4.839,847,3.087,848,3.087,849,3.087,850,4.487,851,4.487,852,4.487,853,3.087,854,4.487,855,4.487,856,5.506,857,4.487,858,3.087,859,1.125]],["t/135",[15,3.224,17,3.565,22,0.754,26,3.851,62,3.851,64,4.44,254,4.44,338,4.44,346,4.712,757,4.712,784,3.76,841,4.581,842,3.7,845,5.217,846,5.217,860,5.052,861,5.052,862,5.052,863,5.052,864,5.052,865,5.052]],["t/137",[4,1.036,21,1.075,22,0.868,37,1.567,45,1.4,108,1.209,110,2.098,115,1.157,118,2.145,127,2.091,135,1.78,136,1.832,139,1.88,184,2.89,258,1.09,262,2.952,353,1.653,551,3.095,599,5.192,645,3.49,665,3.49,704,5.332,705,4.091,709,3.343,762,1.799,831,3.49,832,2.63,859,1.892,866,2.993,867,2.993,868,4.386,869,2.993,870,2.993,871,2.993,872,4.386]],["t/140",[186,3.345,762,3.727]],["t/142",[4,1.283,7,1.57,22,0.839,25,3.569,73,3.569,108,1.126,111,2.599,118,1.369,137,0.808,139,1.741,202,2.591,249,4.061,258,1.98,359,2.248,363,3.569,377,3.569,518,4.061,551,2.865,675,2.974,735,5.923,772,3.231,873,3.787,874,3.569,875,4.983,876,4.983,877,4.983,878,4.983,879,4.983,880,4.427,881,7.514,882,4.983,883,4.983,884,4.983,885,4.983,886,4.983,887,4.983,888,4.983,889,4.983,890,4.983,891,4.983,892,4.983]],["t/144",[54,3.406,57,2.347,59,3.067,71,3.406,72,3.314,95,2.446,98,1.61,101,5.122]],["t/146",[4,1.278,10,2.92,21,1.497,22,0.856,37,1.107,38,1.768,98,1.278,104,1.361,105,1.768,108,1.2,109,1.107,117,1.31,134,1.335,135,1.612,136,1.629,137,0.803,139,1.73,145,2.576,218,2.427,225,3.212,228,2.75,229,2.75,231,3.367,353,1.285,828,1.5,829,1.5,859,1.471,893,4.953,894,6.641,895,4.307,896,2.75,897,3.548]],["t/148",[4,1.158,10,2.647,21,1.389,22,0.863,37,0.959,98,1.158,104,1.18,105,1.532,107,1.936,108,1.13,109,0.959,111,2.347,112,3.461,113,1.422,114,3.131,115,1.897,117,1.136,134,1.157,135,1.497,136,1.477,137,0.696,139,1.5,145,2.233,189,3.232,218,2.103,225,2.784,228,2.383,229,2.383,231,2.918,353,1.114,359,2.717,551,3.461,709,3.739,764,2.166,828,1.3,829,1.3,859,1.275,895,3.997,896,2.383,897,3.075,898,3.075]],["t/150",[4,1.211,10,2.767,21,1.437,22,0.866,37,1.022,98,1.211,104,1.257,105,1.632,108,1.161,109,1.022,117,1.21,134,1.233,135,1.548,136,1.543,137,0.742,139,1.598,145,2.379,189,3.378,218,2.241,225,2.966,228,2.539,229,2.539,231,3.109,353,1.187,713,4.782,764,2.308,828,1.385,829,1.385,833,3.728,834,3.728,835,5.127,836,3.728,859,1.358,895,4.135,896,2.539,897,3.276,898,3.276]],["t/152",[4,1.111,10,2.538,15,3.002,21,1.344,22,0.868,37,0.904,54,1.926,98,1.111,104,1.111,105,1.443,108,1.1,109,0.904,117,1.07,134,1.09,135,1.448,136,1.416,137,0.656,139,1.413,145,2.103,189,3.099,218,1.981,225,2.623,228,2.245,229,2.245,231,2.749,335,3.204,353,1.05,764,2.04,828,1.225,829,1.225,837,3.296,838,5.274,839,5.98,840,4.703,841,3.445,842,3.445,843,4.703,844,3.296,859,1.201,895,3.869,896,2.245,897,2.897,898,2.897]],["t/154",[4,1.167,10,2.224,15,3.75,21,1.345,22,0.856,36,1.131,37,1.13,38,1.205,45,1.287,98,0.973,104,0.928,105,1.205,108,1.081,109,1.355,111,1.972,115,1.594,117,1.338,134,1.363,135,1.629,136,1.652,137,0.983,139,1.179,145,1.756,189,2.715,218,1.654,225,2.189,228,1.874,229,1.874,231,2.295,296,2.418,353,1.312,376,2.418,604,3.622,741,4.493,764,1.703,828,1.022,829,1.022,838,2.295,841,2.015,842,3.018,845,4.577,846,4.577,847,2.751,848,2.751,849,2.751,850,4.121,851,4.121,852,4.121,853,2.751,854,4.121,855,4.121,857,4.121,858,2.751,859,1.502,895,3.486,896,1.874,897,2.418,898,2.418]],["t/156",[15,3.224,17,3.565,22,0.754,26,3.851,62,3.851,64,4.44,254,4.44,338,4.44,346,4.712,757,4.712,784,3.76,841,4.581,842,3.7,845,5.217,846,5.217,860,5.052,861,5.052,862,5.052,863,5.052,864,5.052,865,5.052]],["t/158",[4,1.077,10,2.462,22,0.863,37,1.608,45,1.477,108,1.229,115,1.221,118,2.185,127,2.156,135,1.712,136,1.612,139,1.955,184,3.005,189,3.005,258,1.151,262,3.045,353,1.705,551,3.219,645,3.63,665,3.63,704,5.469,705,4.255,709,3.477,764,1.955,859,1.951,866,3.159,867,3.159,868,4.562,869,3.159,870,3.159,871,3.159,872,4.562,898,2.776,899,6.571]],["t/161",[186,3.697,314,2.417,762,4.118,764,4.241,806,4.004]],["t/163",[54,3.406,57,2.347,59,3.067,71,3.406,72,3.314,95,2.446,98,1.61,101,5.122]],["t/165",[4,1.22,21,1.445,22,0.86,37,1.033,38,2.262,45,1.763,98,1.22,104,1.271,105,1.65,108,1.166,109,1.033,117,1.223,134,1.247,135,1.557,136,1.555,137,0.75,139,1.616,145,2.405,218,2.266,228,2.567,229,2.567,353,1.2,828,1.401,829,1.401,830,5.632,859,1.373,895,4.159,896,2.567,900,3.144,901,4.625,902,3.937,903,3.937,904,4.309,905,4.309,906,4.54]],["t/167",[4,1.111,21,1.344,22,0.868,37,0.904,38,1.443,45,1.542,98,1.111,104,1.111,105,1.443,107,1.856,108,1.1,109,0.904,111,2.25,112,3.318,113,1.364,114,3.002,115,1.819,117,1.07,134,1.09,135,1.448,136,1.416,137,0.656,139,1.413,145,2.103,218,1.981,228,2.245,229,2.245,313,2.414,353,1.05,359,2.604,551,3.318,709,3.585,764,2.04,828,1.225,829,1.225,859,1.201,895,3.869,896,2.245,900,2.749,902,3.585,903,3.585,904,3.923,905,3.923,906,4.134]],["t/169",[4,1.158,21,1.389,22,0.871,37,0.959,38,1.532,45,1.636,98,1.158,104,1.18,105,1.532,108,1.13,109,0.959,117,1.136,134,1.157,135,1.497,136,1.477,137,0.696,139,1.5,145,2.233,218,2.103,228,2.383,229,2.383,313,2.562,353,1.114,713,4.576,764,2.166,828,1.3,829,1.3,833,3.499,834,3.499,835,4.906,836,3.499,859,1.275,895,3.997,896,2.383,900,2.918,902,3.739,903,3.739,904,4.092,905,4.092,906,4.312]],["t/171",[4,1.067,15,2.882,21,1.302,22,0.871,37,0.854,38,1.364,45,1.457,54,1.821,98,1.067,104,1.05,105,1.364,108,1.072,109,0.854,117,1.011,134,1.031,135,1.403,136,1.359,137,0.62,139,1.335,145,1.988,218,1.873,228,2.122,229,2.122,313,2.282,335,3.077,353,0.992,764,1.929,828,1.158,829,1.158,837,3.116,838,5.159,839,5.827,840,4.517,841,3.308,842,3.308,843,4.517,844,3.116,859,1.135,895,3.749,896,2.122,900,2.599,902,3.442,903,3.442,904,3.767,905,3.767,906,3.97]],["t/173",[4,1.134,15,3.675,21,1.314,22,0.861,36,1.079,37,1.09,38,1.742,45,1.86,98,0.939,104,0.885,105,1.149,108,1.059,109,1.317,111,1.903,115,1.538,117,1.291,134,1.316,135,1.6,136,1.613,137,0.955,139,1.125,145,1.675,218,1.578,228,1.788,229,1.788,296,2.307,313,1.922,353,1.267,376,2.307,604,3.495,764,1.625,828,0.975,829,0.975,838,2.189,841,1.922,842,2.913,845,4.469,846,4.469,847,2.625,848,2.625,849,2.625,850,3.977,851,3.977,852,3.977,853,2.625,854,3.977,855,3.977,857,3.977,858,2.625,859,1.449,895,3.388,896,1.788,900,2.189,902,3.031,903,3.031,904,3.317,905,3.317,906,3.495,907,4.881]],["t/175",[15,3.224,17,3.565,22,0.754,26,3.851,62,3.851,64,4.44,254,4.44,338,4.44,346,4.712,757,4.712,784,3.76,841,4.581,842,3.7,845,5.217,846,5.217,860,5.052,861,5.052,862,5.052,863,5.052,864,5.052,865,5.052]],["t/177",[4,1.01,22,0.868,37,1.542,38,1.266,45,1.352,108,1.254,115,1.118,118,2.118,127,2.049,135,1.659,136,1.532,139,1.833,184,2.817,258,1.053,262,2.894,313,2.117,353,1.621,551,3.017,645,3.403,665,3.403,704,5.244,705,3.988,709,3.259,764,1.79,859,1.854,866,2.891,867,2.891,868,4.276,869,2.891,870,2.891,871,2.891,872,4.276,900,2.412,902,3.259,903,3.259,904,3.567,905,3.567,908,5.247,909,5.247,910,6.244]],["t/180",[186,3.697,314,2.417,762,4.118,764,4.241,806,4.004]],["t/182",[22,0.647,30,2.212,54,2.64,69,3.187,71,4.123,72,3.876,91,4.213,95,1.896,98,1.376,116,2.021,142,3.308,143,3.768,144,3.97,152,2.264,153,2.082,154,4.517,155,3.595,156,5.827,157,1.857,164,3.443,165,4.517,166,4.925,167,4.213,168,3.97,169,4.925,289,2.501,783,2.501,784,2.716,785,2.569,911,5.543,912,5.543,913,4.925]],["t/184",[4,0.724,7,0.729,10,1.655,21,0.462,22,0.858,45,0.882,96,1.5,102,1.284,107,1.21,108,1.1,109,1.586,110,1.467,113,1.124,114,1.203,115,1.726,117,0.612,118,1.034,121,0.759,127,1.561,134,0.624,135,1.179,136,0.567,137,0.61,161,2.86,184,2.941,189,1.242,191,2.039,193,1.5,240,2.163,241,2.055,249,1.885,258,0.687,262,1.744,291,3.924,337,1.885,352,3.876,353,0.6,359,1.698,368,1.885,369,3.066,377,2.695,396,1.437,434,1.758,461,2.055,477,2.055,478,1.885,481,2.055,484,2.055,502,2.055,545,1.657,551,2.734,640,4.867,645,1.5,648,3.876,672,2.695,683,2.055,698,2.734,709,2.954,720,3.066,734,4.225,736,2.055,737,3.343,742,3.343,743,2.055,744,2.055,746,3.343,747,2.055,748,5.356,749,2.055,750,2.055,751,3.343,874,2.695,914,3.763,915,2.313,916,2.313,917,3.763,918,3.763,919,2.055,920,2.313,921,3.763,922,2.313,923,2.313,924,4.756,925,4.225,926,5.479,927,6.028,928,5.479,929,3.763,930,2.313,931,2.313,932,2.313,933,3.763,934,2.313,935,4.756,936,2.313,937,3.763,938,2.313,939,2.313,940,2.313,941,2.313,942,2.313,943,2.313,944,2.313,945,2.313,946,2.313,947,2.313,948,2.313]],["t/187",[7,1.851,21,0.828,22,0.844,36,2.624,37,0.926,38,1.479,42,2.383,57,1.36,98,0.798,108,1.174,109,0.926,113,1.387,117,1.096,118,1.874,121,1.927,122,2.65,125,2.457,126,2.29,128,1.207,129,2.29,130,1.616,131,1.654,132,1.479,133,1.511,134,1.117,135,1.468,136,1.44,137,0.672,152,1.693,153,1.71,157,1.388,185,1.511,209,3.054,234,1.616,258,1.744,289,1.87,353,1.076,711,1.545,769,1.306,785,2.721,828,1.255,829,1.255,859,1.231,949,3.15,950,4.463,951,2.877,952,1.734,953,1.654,954,1.616]],["t/189",[7,2.282,21,0.785,22,0.859,36,2.426,37,0.878,42,2.313,57,1.29,98,0.756,108,1.15,109,0.878,113,1.336,117,1.04,118,1.82,121,1.856,122,2.552,125,2.366,126,2.205,128,1.144,129,2.205,130,1.533,131,1.568,132,1.403,133,1.433,134,1.06,135,1.426,136,1.387,137,0.637,152,1.606,153,1.646,157,1.317,159,3.036,185,1.433,209,2.941,234,1.533,258,1.679,289,1.774,314,1.894,353,1.02,711,1.465,769,1.239,785,2.62,828,1.19,829,1.19,859,1.167,951,2.77,952,1.645,953,1.568,954,1.533,955,2.441,956,1.645]],["t/191",[7,2.268,21,0.774,22,0.862,36,2.557,37,0.866,42,2.295,57,1.272,98,0.746,108,1.144,109,0.866,113,1.323,117,1.025,118,1.805,121,1.837,122,2.526,125,2.342,126,2.183,128,1.129,129,2.183,130,1.511,131,1.547,132,1.383,133,1.413,134,1.045,135,1.414,136,1.373,137,0.628,152,1.583,153,1.63,157,1.298,159,3.005,185,1.413,209,2.911,234,1.511,258,1.662,289,1.749,314,1.875,353,1.006,711,1.445,769,1.221,785,2.594,828,1.174,829,1.174,859,1.151,951,2.742,952,1.622,953,1.547,954,1.511,955,2.408,956,1.622]],["t/194",[186,3.345,769,2.397]],["t/196",[186,3.345,956,3.183]],["t/199",[7,1.812,21,0.804,22,0.847,36,2.778,37,0.899,38,1.436,42,2.344,57,1.321,98,0.775,108,1.161,109,0.899,117,1.065,118,1.844,122,2.595,123,2.529,124,3.088,125,2.407,126,2.242,128,1.172,129,2.242,130,1.569,131,1.606,132,1.436,133,1.468,134,1.085,135,1.445,136,1.411,137,0.653,152,1.644,153,1.675,157,1.348,185,1.468,234,1.569,289,1.816,353,1.045,711,1.5,769,1.268,783,2.595,828,1.219,829,1.219,859,1.195,949,3.059,950,4.372,951,2.818,952,1.684,953,1.606,954,1.569,957,3.088,958,2.665,959,4.119]],["t/201",[7,2.253,21,0.764,22,0.861,36,2.652,37,0.854,42,2.277,57,1.255,98,0.736,108,1.138,109,0.854,117,1.011,118,1.791,122,2.501,123,2.437,124,2.976,125,2.319,126,2.161,128,1.113,129,2.161,130,1.491,131,1.525,132,1.364,133,1.394,134,1.031,135,1.403,136,1.359,137,0.62,152,1.562,153,1.614,157,1.281,159,2.976,185,1.394,234,1.491,289,1.725,314,1.857,353,0.992,711,1.425,769,1.205,783,2.501,828,1.158,829,1.158,859,1.135,951,2.715,952,1.6,953,1.525,954,1.491,955,2.375,956,1.6,957,2.976,958,2.568,959,3.97]],["t/203",[7,2.239,21,0.753,22,0.863,36,2.724,37,0.843,42,2.26,57,1.238,98,0.726,108,1.132,109,0.843,117,0.998,118,1.778,122,2.476,123,2.413,124,2.946,125,2.296,126,2.14,128,1.098,129,2.14,130,1.47,131,1.505,132,1.346,133,1.375,134,1.017,135,1.392,136,1.346,137,0.611,152,1.541,153,1.598,157,1.263,159,2.946,185,1.375,234,1.47,289,1.702,314,1.838,353,0.979,711,1.406,769,1.188,783,2.476,828,1.142,829,1.142,859,1.12,951,2.688,952,1.578,953,1.505,954,1.47,955,2.343,956,1.578,957,2.946,958,2.543,959,3.93]],["t/206",[186,3.345,769,2.397]],["t/208",[186,3.345,956,3.183]],["t/211",[7,1.838,21,0.82,22,0.859,36,2.614,37,1.303,38,1.465,57,1.347,98,0.79,108,1.17,109,0.917,113,1.378,116,2.127,117,1.085,118,1.864,121,1.914,122,2.632,123,2.564,124,3.131,126,2.274,127,2.561,128,1.195,129,2.274,130,1.6,131,1.637,132,1.465,133,1.497,134,1.106,135,1.46,136,1.43,137,0.665,153,1.195,157,1.375,185,1.497,262,2.702,353,1.065,711,1.53,828,1.243,829,1.243,859,1.219,949,3.119,950,4.432,952,1.717,953,1.637,954,1.6]],["t/213",[7,2.273,21,0.778,22,0.868,36,2.416,37,1.255,57,1.278,98,0.749,108,1.146,109,0.87,113,1.327,116,2.048,117,1.03,118,1.81,121,1.843,122,2.535,123,2.47,124,3.015,126,2.19,127,2.509,128,1.134,129,2.19,130,1.518,131,1.554,132,1.39,133,1.42,134,1.05,135,1.418,136,1.378,137,0.631,153,1.134,157,1.305,159,3.015,185,1.42,262,2.603,314,1.882,353,1.011,711,1.452,828,1.179,829,1.179,859,1.156,952,1.629,953,1.554,954,1.518,955,2.419,956,1.629]],["t/215",[7,2.258,21,0.767,22,0.869,36,2.547,37,1.242,57,1.26,98,0.739,108,1.14,109,0.858,113,1.314,116,2.028,117,1.016,118,1.796,121,1.825,122,2.509,123,2.445,124,2.985,126,2.168,127,2.495,128,1.118,129,2.168,130,1.497,131,1.532,132,1.371,133,1.401,134,1.035,135,1.407,136,1.364,137,0.623,153,1.118,157,1.287,159,2.985,185,1.401,262,2.577,314,1.863,353,0.997,711,1.432,828,1.163,829,1.163,859,1.14,952,1.607,953,1.532,954,1.497,955,2.385,956,1.607]],["t/218",[186,3.345,956,3.183]],["t/221",[7,1.788,21,0.789,22,0.851,36,2.575,37,0.882,38,1.409,42,2.32,57,1.296,98,0.76,108,1.153,109,0.882,113,1.341,117,1.045,118,1.825,121,1.862,123,2.495,125,2.374,126,2.212,128,1.15,129,2.212,130,1.54,131,1.576,132,1.409,133,1.44,134,1.065,135,1.429,136,1.392,137,0.64,152,1.613,153,1.652,157,1.323,185,1.44,187,2.862,209,2.951,234,1.54,258,1.685,289,1.782,353,1.025,711,1.472,769,1.244,784,2.78,828,1.196,829,1.196,859,1.173,949,3.002,950,4.312,951,2.78,952,1.652,953,1.576,954,1.54,958,2.629,960,4.064]],["t/223",[7,2.234,21,0.75,22,0.863,36,2.375,37,0.839,42,2.254,57,1.232,98,0.722,108,1.13,109,0.839,113,1.292,117,0.993,118,1.773,121,1.795,123,2.405,125,2.289,126,2.133,128,1.093,129,2.133,130,1.464,131,1.498,132,1.34,133,1.369,134,1.012,135,1.389,136,1.342,137,0.609,152,1.534,153,1.593,157,1.258,159,2.937,185,1.369,187,2.759,209,2.845,234,1.464,258,1.624,289,1.694,314,1.832,353,0.974,711,1.399,769,1.183,784,2.68,828,1.137,829,1.137,859,1.115,951,2.68,952,1.571,953,1.498,954,1.464,955,2.332,956,1.571,958,2.535,960,3.918]],["t/225",[7,2.22,21,0.74,22,0.865,36,2.511,37,0.828,42,2.237,57,1.216,98,0.713,108,1.124,109,0.828,113,1.28,117,0.98,118,1.759,121,1.778,123,2.382,125,2.267,126,2.112,128,1.079,129,2.112,130,1.444,131,1.478,132,1.322,133,1.351,134,0.999,135,1.378,136,1.329,137,0.601,152,1.513,153,1.577,157,1.241,159,2.908,185,1.351,187,2.733,209,2.817,234,1.444,258,1.608,289,1.672,314,1.815,353,0.961,711,1.381,769,1.167,784,2.654,828,1.122,829,1.122,859,1.1,951,2.654,952,1.55,953,1.478,954,1.444,955,2.301,956,1.55,958,2.51,960,3.88]],["t/228",[186,3.345,769,2.397]],["t/230",[186,3.345,956,3.183]],["t/232",[8,4.192,22,0.61,54,3.214,57,2.215,59,2.894,71,3.214,72,3.127,95,2.764,96,4.376,116,2.461,138,5.129,783,3.045,784,3.306,785,3.127,913,5.996]],["t/234",[95,2.533,153,2.156,157,2.481,236,4.42,961,5.628]],["t/236",[7,1.925,21,0.876,22,0.834,37,0.979,38,1.564,42,2.456,57,1.438,98,1.175,108,1.054,109,0.979,113,1.443,117,1.159,118,1.932,121,2.004,122,2.756,125,2.556,126,2.381,128,1.276,129,2.381,130,1.709,131,1.749,132,1.564,133,1.598,134,1.182,135,1.513,136,1.498,137,0.711,152,1.79,153,1.276,157,1.468,185,1.598,209,3.177,234,1.709,258,1.814,289,1.978,353,1.138,593,3.139,711,1.634,769,1.381,785,2.83,828,1.327,829,1.327,859,1.301,951,2.992,952,1.834,953,1.749,954,1.709,962,4.642]],["t/238",[7,2.333,21,0.824,22,0.855,37,0.921,42,2.376,57,1.353,98,1.126,108,1.02,109,0.921,113,1.383,117,1.091,118,1.869,119,3.493,121,1.92,122,2.641,125,2.449,126,2.282,128,1.201,129,2.282,130,1.608,131,1.646,132,1.472,133,1.504,134,1.112,135,1.464,136,1.435,137,0.669,152,1.685,153,1.201,157,1.382,185,1.504,209,3.044,234,1.608,258,1.738,289,1.861,314,1.96,353,1.07,711,1.537,769,1.3,785,2.712,828,1.249,829,1.249,859,1.225,951,2.867,952,1.726,953,1.646,954,1.608,956,1.726,963,2.954]],["t/241",[186,3.345,769,2.397]],["t/243",[186,3.345,956,3.183]],["t/245",[95,2.533,153,2.156,157,2.481,236,4.42,961,5.628]],["t/247",[7,1.911,21,0.867,22,0.821,36,2.031,37,0.969,38,1.548,42,2.442,57,1.424,98,1.167,108,1.048,109,0.969,117,1.147,118,1.921,122,2.736,123,2.667,124,3.256,125,2.537,126,2.364,128,1.263,129,2.364,130,1.691,131,1.731,132,1.548,133,1.582,134,1.169,135,1.505,136,1.487,137,0.703,152,1.772,153,1.263,157,1.453,185,1.582,234,1.691,289,1.957,353,1.126,593,3.107,711,1.617,769,1.367,783,2.736,828,1.314,829,1.314,859,1.288,951,2.971,952,1.815,953,1.731,954,1.691,957,3.256,958,2.81,959,4.343,962,4.609]],["t/249",[7,2.323,21,0.816,22,0.849,36,1.947,37,0.912,42,2.363,57,1.34,98,1.118,108,1.014,109,0.912,117,1.08,118,1.859,119,3.468,122,2.622,123,2.556,124,3.12,125,2.432,126,2.266,128,1.189,129,2.266,130,1.592,131,1.629,132,1.457,133,1.489,134,1.101,135,1.456,136,1.425,137,0.662,152,1.668,153,1.189,157,1.368,185,1.489,234,1.592,289,1.843,314,1.947,353,1.06,711,1.522,769,1.287,783,2.622,828,1.237,829,1.237,859,1.213,951,2.847,952,1.709,953,1.629,954,1.592,956,1.709,957,3.12,958,2.693,959,4.162,963,2.925]],["t/252",[186,3.345,769,2.397]],["t/254",[186,3.345,956,3.183]],["t/256",[95,2.533,153,2.156,157,2.481,236,4.42,961,5.628]],["t/258",[7,1.925,21,0.876,22,0.85,37,1.365,38,1.564,57,1.438,98,1.175,108,1.054,109,0.979,113,1.443,116,2.227,117,1.159,118,1.932,121,2.004,122,2.756,123,2.686,124,3.279,126,2.381,127,2.624,128,1.276,129,2.381,130,1.709,131,1.749,132,1.564,133,1.598,134,1.182,135,1.513,136,1.498,137,0.711,157,1.468,185,1.598,262,2.83,353,1.138,593,3.139,711,1.634,828,1.327,829,1.327,859,1.301,952,1.834,953,1.749,954,1.709,962,4.642]],["t/260",[7,2.333,21,0.824,22,0.863,37,1.307,57,1.353,98,1.126,108,1.02,109,0.921,113,1.383,116,2.134,117,1.091,118,1.869,119,3.493,121,1.92,122,2.641,123,2.573,124,3.142,126,2.282,127,2.565,128,1.201,129,2.282,130,1.608,131,1.646,132,1.472,133,1.504,134,1.112,135,1.464,136,1.435,137,0.669,157,1.382,185,1.504,262,2.712,314,1.96,353,1.07,711,1.537,828,1.249,829,1.249,859,1.225,952,1.726,953,1.646,954,1.608,956,1.726,963,2.954]],["t/262",[7,2.307,21,0.804,22,0.861,37,1.285,57,1.321,98,1.107,108,1.006,109,0.899,113,1.359,116,2.097,117,1.065,118,1.844,119,3.433,121,1.887,122,2.595,123,2.529,124,3.088,126,2.242,127,2.542,128,1.172,129,2.242,130,1.569,131,1.606,132,1.436,133,1.468,134,1.085,135,1.445,136,1.411,137,0.653,157,1.348,185,1.468,191,2.466,262,2.665,267,2.5,276,3.73,314,1.927,353,1.045,711,1.5,828,1.219,829,1.219,859,1.195,952,1.684,953,1.606,954,1.569,956,1.684,963,2.883]],["t/265",[186,3.345,956,3.183]],["t/267",[95,2.533,153,2.156,157,2.481,236,4.42,961,5.628]],["t/269",[7,1.87,21,0.84,22,0.838,37,0.94,38,1.501,42,2.402,57,1.381,98,1.142,108,1.031,109,0.94,113,1.402,117,1.113,118,1.889,121,1.948,123,2.61,125,2.483,126,2.314,128,1.225,129,2.314,130,1.64,131,1.679,132,1.501,133,1.534,134,1.134,135,1.48,136,1.456,137,0.682,152,1.719,153,1.225,157,1.409,185,1.534,187,2.994,209,3.087,234,1.64,258,1.762,289,1.898,353,1.092,593,3.013,711,1.568,769,1.326,784,2.908,828,1.274,829,1.274,859,1.249,951,2.908,952,1.76,953,1.679,954,1.64,958,2.75,960,4.251,962,4.511]],["t/271",[7,2.292,21,0.793,22,0.856,37,0.886,42,2.326,57,1.302,98,1.096,108,0.998,109,0.886,113,1.345,117,1.049,118,1.829,119,3.398,121,1.868,123,2.503,125,2.382,126,2.22,128,1.155,129,2.22,130,1.547,131,1.583,132,1.416,133,1.447,134,1.07,135,1.433,136,1.396,137,0.643,152,1.621,153,1.155,157,1.329,185,1.447,187,2.872,209,2.961,234,1.547,258,1.69,289,1.791,314,1.907,353,1.03,711,1.479,769,1.25,784,2.789,828,1.202,829,1.202,859,1.178,951,2.789,952,1.66,953,1.583,954,1.547,956,1.66,958,2.638,960,4.077,963,2.842]],["t/274",[186,3.345,769,2.397]],["t/276",[186,3.345,956,3.183]],["t/278",[4,0.692,7,1.669,22,0.858,42,2.198,45,1.37,67,2.443,98,0.692,107,1.155,108,1.161,110,1.401,111,1.401,113,0.849,114,1.869,116,1.31,118,1.455,120,2.523,127,2.065,128,1.046,135,1.354,137,0.583,139,1.255,193,2.33,224,1.468,234,1.401,266,5.658,267,3.29,273,1.541,359,1.622,363,3.794,410,2.928,498,2.928,557,2.928,558,2.928,559,2.928,560,2.928,561,2.928,562,2.928,772,2.33,783,1.622,784,1.76,785,1.665,873,2.731,874,2.574,919,3.193,964,3.594,965,3.193,966,3.193,967,3.594,968,3.193,969,3.193,970,3.193,971,3.193,972,3.193,973,3.193,974,3.594,975,3.193,976,3.193,977,3.193,978,3.594,979,3.594,980,3.594,981,3.193,982,3.193,983,3.594,984,3.594,985,3.594,986,3.594,987,3.594,988,5.297,989,3.594,990,3.594,991,3.594,992,3.594,993,3.594,994,3.594,995,3.594,996,3.594]],["t/280",[10,2.068,21,0.94,22,0.873,98,0.905,107,1.512,108,0.705,111,1.834,112,2.704,113,1.111,114,3.335,115,1.482,118,2.153,127,2.104,135,1.012,137,0.763,202,3.335,217,4.178,218,2.304,219,4.178,262,2.971,359,2.122,600,5.697,645,3.05,873,3.575,874,3.368,925,4.178,997,4.703,998,6.412,999,4.703,1000,4.703,1001,6.412,1002,4.178,1003,4.703,1004,4.703,1005,4.703]],["t/282",[4,0.603,17,3.334,21,0.627,22,0.869,25,3.426,35,2.556,45,1.195,67,2.132,96,2.034,98,0.603,108,1.103,115,0.988,118,1.314,120,2.761,121,1.029,128,0.913,137,0.508,139,1.096,193,2.034,202,2.487,224,1.281,273,1.345,300,2.246,332,2.556,359,1.415,386,2.556,388,3.898,498,3.898,503,3.898,557,2.556,558,2.556,559,2.556,560,2.556,561,3.898,562,4.725,618,2.786,873,2.384,874,2.246,880,2.786,965,2.786,966,2.786,968,2.786,969,2.786,970,2.786,971,2.786,972,2.786,973,2.786,975,2.786,976,2.786,977,4.249,981,2.786,982,2.786,1006,3.136,1007,3.136,1008,3.136,1009,4.783,1010,3.136,1011,4.783,1012,3.136,1013,3.136,1014,3.136,1015,3.136,1016,3.136,1017,3.136,1018,3.136,1019,3.136,1020,3.136,1021,3.136,1022,3.136,1023,4.783,1024,3.136,1025,3.136,1026,3.136,1027,3.136,1028,3.136,1029,3.136,1030,3.136,1031,4.783,1032,3.136,1033,4.783,1034,3.136,1035,3.136,1036,3.136,1037,3.136,1038,3.136,1039,3.136,1040,3.136,1041,3.136,1042,3.136,1043,3.136]],["t/284",[4,0.801,10,1.831,12,2.624,21,0.643,22,0.877,36,0.642,37,1.528,38,0.684,40,0.997,104,1.144,105,1.149,106,1.492,107,0.616,108,0.732,109,1.216,111,0.747,113,1.716,116,1.984,120,2.324,121,2.056,157,1.079,184,1.029,185,0.699,191,2.093,224,0.783,240,1.102,250,1.562,258,0.569,259,1.922,273,0.822,278,1.144,304,1.788,335,1.064,359,0.865,401,2.088,414,0.967,493,2,546,1.703,628,1.19,671,1.029,675,3.738,698,1.102,716,1.144,758,3.495,764,2.745,767,1.19,768,1.729,769,0.604,772,3.165,776,1.922,777,2.088,783,2.967,784,2.391,785,0.888,806,1.064,807,2.861,957,1.029,958,1.492,1044,1.243,1045,1.917,1046,2.088,1047,2.088,1048,1.917,1049,1.917,1050,1.917,1051,1.243,1052,1.917,1053,1.243,1054,1.243,1055,1.243,1056,1.243,1057,1.917,1058,2.088,1059,2.088,1060,2.088,1061,1.243,1062,1.243,1063,1.917,1064,1.243,1065,1.243,1066,1.243,1067,1.457,1068,1.243,1069,1.457,1070,1.917,1071,1.917,1072,4.165,1073,3.22,1074,1.917,1075,1.917,1076,4.165,1077,3.22,1078,1.917,1079,1.917,1080,1.917,1081,1.917,1082,1.917,1083,1.917,1084,6.575,1085,3.22,1086,1.917,1087,3.22,1088,3.22,1089,1.917,1090,3.22,1091,1.917,1092,3.22,1093,3.22]],["t/286",[4,0.434,22,0.875,36,0.756,37,0.824,38,0.806,40,1.174,57,0.741,69,1.298,98,0.434,104,0.62,105,0.806,106,2.502,107,0.726,108,0.957,109,1.571,111,0.88,113,1.768,116,1.345,120,2.571,121,2.212,127,1.21,132,2.124,137,0.366,153,0.657,202,1.174,224,0.922,234,0.88,240,1.298,258,0.67,259,3.222,264,1.402,273,0.968,278,1.347,304,1.253,310,1.716,335,2.596,359,1.019,389,1.84,414,1.139,493,1.402,567,1.534,569,1.534,628,1.402,638,1.716,671,1.212,672,1.617,675,4.022,698,2.121,716,2.201,762,1.807,763,1.464,767,1.402,768,2.51,769,1.473,770,1.617,772,1.464,776,2.201,782,1.617,783,2.436,785,1.709,788,1.617,789,1.617,790,1.617,793,4.4,798,1.84,806,2.047,957,1.212,958,1.709,1044,1.464,1046,1.464,1047,1.464,1051,1.464,1053,1.464,1054,1.464,1055,1.464,1056,1.464,1058,2.392,1059,2.392,1060,2.392,1061,1.464,1062,1.464,1064,1.464,1065,1.464,1066,1.464,1067,1.716,1068,1.464,1069,1.716,1094,2.005,1095,2.005,1096,2.005,1097,2.507,1098,2.507,1099,1.534,1100,4.797,1101,3.277,1102,2.005,1103,2.005,1104,2.005,1105,2.005,1106,2.005,1107,2.005,1108,2.005,1109,2.005]],["t/288",[4,0.425,22,0.876,36,0.74,37,0.81,38,0.789,40,1.149,57,0.725,69,1.27,98,0.425,104,0.607,105,0.789,106,2.47,107,0.711,108,0.948,109,1.557,111,0.862,113,1.755,116,1.322,120,2.539,121,2.191,127,1.189,132,2.1,137,0.358,153,0.643,191,0.948,202,1.885,224,0.903,234,0.862,240,1.27,258,1.076,259,3.181,264,1.372,273,0.948,276,1.433,278,1.319,304,1.227,310,1.679,335,2.558,359,0.997,389,1.801,414,1.115,493,1.372,567,1.502,569,1.502,628,1.372,638,1.679,671,1.186,672,1.583,675,3.985,698,2.084,716,2.163,762,1.775,763,1.433,767,1.372,768,2.474,769,1.452,770,1.583,772,1.433,776,2.163,782,1.583,783,2.405,785,1.679,788,1.583,789,1.583,790,1.583,793,4.344,798,1.801,806,2.012,957,1.186,958,1.679,1044,1.433,1046,1.433,1047,1.433,1051,1.433,1053,1.433,1054,1.433,1055,1.433,1056,1.433,1058,2.35,1059,2.35,1060,2.35,1061,1.433,1062,1.433,1064,1.433,1065,1.433,1066,1.433,1068,1.433,1094,1.963,1095,1.963,1096,1.963,1097,2.463,1098,2.463,1099,1.502,1100,4.736,1101,3.22,1102,1.963,1103,1.963,1104,1.963,1105,1.963,1106,1.963,1107,1.963,1108,1.963,1109,1.963,1110,1.801,1111,1.801]],["t/290",[4,0.571,22,0.875,36,0.995,38,1.06,40,1.544,98,0.571,104,0.816,105,1.06,106,2.125,107,0.955,108,0.945,109,1.609,111,1.158,113,1.92,116,1.083,120,3.002,121,2.463,137,0.481,153,0.865,224,1.213,240,1.707,258,0.882,259,2.737,264,1.844,273,1.273,278,1.772,304,1.648,335,1.648,359,1.34,414,1.498,493,1.844,628,1.844,671,1.594,675,4.48,698,1.707,716,2.737,762,2.247,763,1.926,767,1.844,768,3.009,769,0.936,776,2.737,783,2.844,785,1.376,806,2.546,957,1.594,958,2.125,1044,1.926,1046,1.926,1047,1.926,1051,1.926,1053,1.926,1054,1.926,1055,1.926,1056,1.926,1058,2.974,1059,2.974,1060,2.974,1061,1.926,1062,1.926,1064,1.926,1065,1.926,1066,1.926,1067,2.257,1068,1.926,1069,2.257,1097,2.018,1098,2.018,1099,2.018,1112,2.257]],["t/292",[4,0.532,22,0.875,36,0.926,38,0.986,40,1.437,98,0.532,104,0.759,105,0.986,106,2.01,107,0.889,108,0.909,109,1.562,111,1.078,113,1.882,116,1.582,120,2.888,121,2.484,127,0.907,137,0.448,153,0.805,191,1.185,209,2.256,224,1.129,240,1.589,258,0.821,259,2.589,264,1.717,273,2.6,278,1.649,304,1.534,335,1.534,359,1.247,414,1.394,493,1.717,628,2.694,671,1.484,675,4.363,698,1.589,716,2.589,762,2.125,763,1.792,767,1.717,768,2.874,769,0.871,776,2.589,777,1.792,783,2.736,785,1.281,806,2.408,957,1.484,958,2.01,1044,1.792,1046,1.792,1047,1.792,1051,1.792,1053,1.792,1054,1.792,1055,1.792,1056,1.792,1058,2.813,1059,2.813,1060,2.813,1061,1.792,1062,1.792,1064,2.813,1065,1.792,1066,1.792,1067,2.101,1068,1.792,1069,2.101,1097,1.879,1098,1.879,1099,1.879,1112,2.101,1113,2.455,1114,2.455,1115,2.455]],["t/294",[4,0.556,22,0.876,36,0.967,38,1.03,40,1.502,98,0.556,104,0.793,105,1.03,106,2.08,107,0.928,108,0.931,109,1.591,111,1.126,113,1.906,116,1.053,120,2.957,121,2.438,137,0.468,153,0.841,191,1.238,202,1.502,224,1.18,240,1.66,258,1.333,259,2.679,264,1.794,273,1.238,276,1.872,278,1.723,304,1.603,335,1.603,359,1.303,414,1.457,493,1.794,628,1.794,671,1.55,675,4.435,698,1.66,716,2.679,762,2.199,763,1.872,767,1.794,768,2.956,769,0.91,776,2.679,783,2.802,785,1.338,806,2.491,957,1.55,958,2.08,1044,1.872,1046,1.872,1047,1.872,1051,1.872,1053,1.872,1054,1.872,1055,1.872,1056,1.872,1058,2.91,1059,2.91,1060,2.91,1061,1.872,1062,1.872,1064,1.872,1065,1.872,1066,1.872,1068,1.872,1097,1.963,1098,1.963,1099,1.963,1110,2.353,1111,2.353,1112,2.195]],["t/296",[4,0.518,22,0.876,36,0.902,38,0.961,40,1.4,98,0.518,104,0.74,105,0.961,106,1.969,107,0.866,108,0.896,109,1.545,111,1.05,113,1.868,116,1.55,120,2.846,121,2.462,127,0.884,137,0.437,153,0.784,191,1.822,202,1.4,209,2.21,224,1.1,240,1.548,258,1.262,259,2.536,264,1.672,273,2.563,276,1.746,278,1.607,304,1.495,335,1.495,359,1.215,414,1.358,493,1.672,628,2.639,671,1.446,675,4.32,698,1.548,716,2.536,762,2.082,763,1.746,767,1.672,768,2.826,769,0.849,776,2.536,777,1.746,783,2.697,785,1.248,806,2.359,957,1.446,958,1.969,1044,1.746,1046,1.746,1047,1.746,1051,1.746,1053,1.746,1054,1.746,1055,1.746,1056,1.746,1058,2.755,1059,2.755,1060,2.755,1061,1.746,1062,1.746,1064,2.755,1065,1.746,1066,1.746,1068,1.746,1097,1.83,1098,1.83,1099,1.83,1110,2.194,1111,2.194,1112,2.047,1113,2.392,1114,2.392,1115,2.392]],["t/298",[30,2.629,59,2.826,97,4.72,100,4.479,137,1.068,152,2.692,164,4.093,280,5.37,281,5.854,515,5.854,671,3.538,809,5.854,810,5.854,811,5.854,812,5.854,813,5.854,814,5.854,1116,5.37,1117,6.59]],["t/300",[30,2.65,98,1.278,100,4.515,153,1.934,157,2.225,185,2.422,289,2.997,353,2.077,397,5.048,711,2.476,954,2.59,1118,6.642,1119,6.642,1120,6.642,1121,6.642,1122,6.642,1123,6.642]],["t/302",[4,1.028,8,3.759,10,1.211,21,1.511,22,0.861,37,1.352,98,0.832,107,1.718,108,0.986,110,1.074,111,2.083,113,1.262,115,2.073,127,1.42,135,1.889,139,1.866,153,1.26,185,1.948,189,1.479,236,2.582,258,1.797,262,2.005,353,2.242,397,4.999,514,3.926,550,2.094,580,2.245,711,1.991,831,1.786,859,1.953,902,1.711,903,1.711,953,2.415,954,2.083,1002,2.447,1116,2.245,1124,5.844,1125,2.447,1126,2.447,1127,2.755,1128,2.755,1129,6.053,1130,2.755,1131,2.447,1132,2.447,1133,2.755,1134,2.447,1135,2.447,1136,3.843,1137,2.447,1138,2.447]],["t/304",[4,0.996,10,1.154,21,1.432,22,0.863,98,0.801,104,1.422,105,1.847,107,1.665,108,1.025,109,1.436,110,1.024,111,2.018,113,1.223,115,2.025,117,2.075,127,1.367,134,2.115,135,1.78,136,1.022,153,1.213,185,1.888,189,1.409,225,1.702,236,2.486,258,1.75,262,1.93,353,2.146,397,4.884,514,3.835,518,5.237,711,1.93,859,1.908,902,1.631,903,1.631,953,2.564,954,2.018,1116,2.139,1124,5.709,1125,2.332,1126,2.332,1131,2.332,1132,2.332,1134,2.332,1135,2.332,1136,3.7,1137,2.332,1138,2.332,1139,2.625]],["t/306",[148,6.697,1140,7.538,1141,7.538]],["t/308",[1,3.998,4,1.631,5,3.854,10,2.08,14,4.545,15,2.46,17,3.701,22,0.428,23,3.595,24,4.174,26,2.938,30,3.134,31,4.202,69,2.719,70,4.61,71,2.252,72,2.192,75,4.202,76,3.595,77,3.854,102,2.625,128,1.377,144,3.387,236,2.823,295,4.202,297,2.938,298,4.892,299,3.854,300,3.387,301,3.595,319,4.202,365,4.202,384,4.202,408,4.202,455,3.067,652,3.854,665,3.067,701,3.854,781,3.595,806,2.625,1142,4.73,1143,4.73,1144,4.73,1145,4.73,1146,6.437,1147,4.73,1148,4.73,1149,4.73,1150,4.73,1151,4.73,1152,4.73,1153,4.73,1154,4.73]],["t/310",[4,1.003,18,2.867,25,2.52,26,3.859,65,3.126,73,2.52,104,0.967,113,1.232,115,1.109,133,1.283,137,1.114,171,3.126,177,2.391,178,2.391,210,3.126,218,1.723,271,2.867,298,6.696,314,1.179,373,2.674,380,2.867,395,2.674,396,3.239,434,2.674,453,4.633,455,4.456,476,3.126,506,6.105,507,3.126,514,2.1,538,3.126,545,2.52,607,3.963,652,2.867,653,4.633,670,4.633,684,4.633,781,2.674,802,3.126,896,1.953,1155,3.518,1156,3.518,1157,5.215,1158,7.955,1159,3.518,1160,5.215,1161,3.518,1162,3.518,1163,3.518,1164,3.518,1165,3.518,1166,3.518,1167,3.518,1168,3.518,1169,5.215,1170,6.214,1171,3.518,1172,3.518,1173,3.518,1174,3.518,1175,3.518,1176,3.518,1177,3.518,1178,3.518,1179,3.518,1180,3.518,1181,5.215,1182,3.518,1183,3.518,1184,3.518,1185,3.518,1186,5.215,1187,3.518,1188,3.518,1189,3.518,1190,3.518,1191,3.518,1192,5.215,1193,3.518,1194,3.518,1195,3.518,1196,3.518,1197,3.518,1198,3.518,1199,3.518]]],"invertedIndex":[["",{"_index":22,"t":{"2":{"position":[[216,1]]},"10":{"position":[[125,2],[179,2],[233,1],[317,3],[321,2],[350,1],[376,1],[410,1],[438,1],[457,1],[463,2],[488,2],[553,2],[616,1],[630,1],[650,1],[652,2],[678,1],[696,1],[730,1],[758,1],[760,1],[772,1],[774,3],[791,2],[816,1],[830,1],[850,1],[852,2],[882,1],[903,2],[957,1],[1035,3],[1039,2],[1090,1],[1118,1],[1137,1],[1176,1],[1200,2],[1265,2],[1328,1],[1330,2],[1333,2],[1381,1],[1409,1],[1411,1],[1423,1],[1425,3],[1467,1],[1491,1],[1493,2]]},"12":{"position":[[415,1],[450,1],[645,1],[647,2],[701,1],[785,3],[789,2],[863,1],[899,1],[927,1],[929,1],[941,1],[943,3],[966,2],[991,2],[1056,2],[1119,1],[1133,1],[1153,1],[1167,1],[1188,2],[1242,1],[1320,3],[1324,2],[1402,1],[1430,1],[1432,1],[1444,1],[1446,3],[1502,1],[1526,2],[1591,2],[1654,1],[1656,2]]},"14":{"position":[[433,2],[519,1],[651,2],[747,2],[881,3],[897,1],[918,2],[1004,1],[1136,2],[1232,2],[1366,3],[1604,1],[1606,2],[1665,1],[1716,2],[1776,1],[1790,1],[1810,1],[1812,2],[1921,1],[1923,2],[1983,3],[2122,2],[2171,1],[2201,2],[2257,3],[2261,4],[2266,2],[2353,2],[2431,1],[2433,2],[2483,3],[2487,4],[2492,2],[2579,3]]},"16":{"position":[[135,1],[137,2],[179,1],[263,3],[267,2],[306,1],[342,1],[370,1],[372,1],[384,1],[386,3],[404,2],[407,1],[528,2],[582,2],[671,2],[742,1],[845,3],[849,2],[888,1],[924,1],[952,1],[954,1],[966,1],[968,3],[986,2],[1163,1],[1165,2],[1195,1],[1267,3],[1271,2],[1340,1],[1358,2],[1412,1],[1451,1],[1582,1],[1603,2],[1639,1],[1717,3],[1779,2],[1782,1],[1803,2],[1835,2]]},"18":{"position":[[424,1],[527,3],[542,1],[639,3],[677,1],[703,1],[781,3],[807,2],[913,2],[937,1],[951,1],[971,1],[985,1],[1044,2],[1079,1],[1103,2],[1209,2],[1233,1],[1235,2]]},"26":{"position":[[254,1],[278,1]]},"32":{"position":[[837,1],[941,1],[968,2],[980,2],[983,1],[1014,1],[1051,2],[1054,1],[1071,1],[1109,2],[1173,2],[1189,2],[1192,1],[1194,2],[1259,3],[1263,2],[1266,2],[1269,2],[1272,3],[1687,1],[1806,2],[1832,2],[1839,1],[1856,3],[1876,1],[1898,2],[1901,1],[1918,1],[1946,2],[1993,2],[2085,3],[2089,1],[2096,1],[2108,1],[2175,2],[2188,1],[2205,1],[2207,2],[2210,3]]},"34":{"position":[[523,1],[674,1],[676,2],[689,3],[727,2],[740,2],[743,1],[780,1],[836,2],[839,2],[867,2],[880,2],[883,1],[920,1],[976,2],[979,2],[1007,2],[1020,2],[1023,1],[1060,1],[1116,2],[1119,2],[1122,2],[1125,3]]},"40":{"position":[[632,1]]},"44":{"position":[[122,1],[132,1],[191,1],[246,2],[249,2],[252,2]]},"46":{"position":[[49,1],[61,1],[123,2],[170,2]]},"48":{"position":[[7,1],[13,1],[68,1]]},"50":{"position":[[7,1],[27,1],[216,2],[385,2]]},"55":{"position":[[69,1]]},"59":{"position":[[107,2],[255,2],[497,1]]},"64":{"position":[[60,1],[62,1],[64,1],[66,1],[100,2],[103,1],[105,2],[114,1],[116,1],[129,1],[131,1],[133,2],[157,1],[159,1],[161,1],[163,1],[243,3],[247,2],[287,1],[289,1],[291,1],[293,1],[359,1],[361,1],[363,1],[365,1]]},"66":{"position":[[165,1],[167,1],[169,1],[199,2],[202,1],[204,2],[266,3],[295,2],[395,1],[407,2],[423,2],[489,2],[492,1],[494,2],[498,1],[500,1],[502,1],[513,1],[515,1],[517,3],[521,2],[573,2],[683,3]]},"68":{"position":[[22,1]]},"70":{"position":[[63,1],[81,1],[96,1],[114,1],[155,1],[187,1],[230,1],[250,1]]},"72":{"position":[[105,1],[140,1],[201,1],[211,1],[256,2],[259,1],[333,1],[343,1],[388,2],[391,1],[466,1],[476,1],[528,1],[538,1],[583,2],[586,1],[620,1],[622,2],[625,1],[627,2],[630,1],[632,2]]},"77":{"position":[[162,1],[462,1],[500,1],[512,1],[525,2],[540,2],[543,1],[545,2],[578,1],[580,1],[582,1],[621,2],[639,1],[641,1],[648,1],[650,1],[652,3],[686,1],[698,1],[705,2],[720,2],[723,1],[725,2],[735,1],[737,1],[739,1],[767,3],[799,1],[811,1],[818,2],[833,2],[836,1],[838,2],[856,1],[865,3],[869,2],[973,1],[975,1],[977,1],[1006,2],[1009,1],[1011,2],[1029,1],[1038,3]]},"79":{"position":[[14,1],[16,1],[68,2],[112,2],[115,1],[117,2],[170,2],[241,2],[244,4],[249,2],[252,3]]},"81":{"position":[[453,2],[562,1],[590,2],[593,2],[619,1],[693,1],[727,1],[776,1],[798,2],[801,2],[816,2],[898,1],[927,1],[965,1],[1052,2],[1055,1],[1057,2],[1096,1],[1149,1],[1238,3],[1242,3],[1246,2],[1249,1],[1285,2],[1288,3],[1379,2]]},"83":{"position":[[10,1],[40,1],[73,1],[111,1],[226,2],[255,3],[592,1],[635,1],[668,1],[759,1],[777,1],[800,1],[834,2],[837,1],[869,1],[871,2],[895,2],[898,3]]},"87":{"position":[[0,2],[18,2],[33,1],[62,2],[136,2],[191,2],[194,2],[210,2],[271,2],[312,1],[356,2],[483,2],[486,1],[498,1],[563,2],[581,2],[584,1],[617,2],[633,2],[636,1],[656,2],[714,3]]},"89":{"position":[[26,1],[40,1],[80,1],[128,3],[153,1],[182,3],[222,1],[250,1],[264,1],[304,1],[340,3],[344,2],[480,3],[534,1]]},"91":{"position":[[12,1],[42,1],[72,2],[75,1],[85,1],[164,3],[179,1],[287,1],[299,4],[319,3]]},"96":{"position":[[233,1],[266,1]]},"98":{"position":[[14,1],[34,1],[83,1],[85,1],[119,2],[133,1]]},"100":{"position":[[14,1],[28,1],[71,1],[73,1],[107,2],[121,1]]},"102":{"position":[[37,1],[67,2],[70,1],[72,3],[76,1],[85,1],[87,1],[97,1],[99,1],[101,2],[104,3],[131,1],[161,2],[164,1],[166,3],[170,1],[179,1],[181,1],[191,1],[193,1],[195,2],[198,3]]},"105":{"position":[[68,1],[84,1],[112,1],[171,3],[175,2],[223,1],[253,2],[256,1],[277,3],[281,1],[290,1],[292,1],[302,1],[304,1],[306,2],[309,3],[313,2],[390,2],[393,1],[414,3],[418,1],[427,1],[429,1],[454,1],[456,1],[458,2],[461,3],[513,1],[529,1],[557,1],[635,3],[639,2],[688,1],[703,1],[731,2],[734,1],[755,3],[759,1],[768,1],[770,1],[777,1],[779,1],[781,2],[784,1],[786,2],[789,2],[866,2],[869,1],[890,3],[894,1],[903,1],[905,1],[914,1],[916,1],[918,2],[921,3]]},"107":{"position":[[85,1],[101,1],[129,1],[214,3],[228,1],[230,1],[241,1],[263,1],[276,2],[327,2],[330,1],[351,3],[355,1],[364,1],[366,1],[368,1],[378,1],[380,2],[383,1],[385,1],[395,1],[397,1],[399,1],[401,2],[404,3]]},"109":{"position":[[322,1],[340,1],[368,1],[427,3],[441,1],[443,1],[452,1],[457,2],[508,2],[511,1],[534,3],[538,1],[565,1],[618,3],[672,1],[674,2],[677,3]]},"111":{"position":[[173,1],[191,1],[219,1],[304,3],[318,1],[320,1],[329,1],[341,1],[346,2],[400,2],[403,1],[427,3],[431,1],[443,1],[461,1],[514,3],[569,2],[588,1],[641,3],[695,1],[697,1],[699,2],[702,3]]},"113":{"position":[[280,1],[319,1],[347,1],[406,3],[410,3],[430,2],[485,3],[505,2],[565,1],[577,1],[586,3],[590,3],[614,2],[627,1],[720,2],[723,1],[746,3],[750,1],[777,1],[830,3],[884,1],[886,2],[889,3],[1065,3],[1106,2]]},"125":{"position":[[103,1],[122,1],[198,2],[201,1],[215,1],[235,1],[249,1],[287,1],[357,2],[398,2],[401,1],[421,3]]},"127":{"position":[[107,1],[126,1],[210,2],[225,2],[238,3],[242,3],[246,1],[260,1],[280,1],[294,1],[332,1],[410,2],[425,2],[438,3],[442,3],[484,2],[487,1],[507,3]]},"129":{"position":[[107,1],[126,1],[159,2],[162,3],[243,2],[246,3],[250,1],[264,1],[284,1],[298,1],[336,1],[363,2],[366,3],[448,3],[490,2],[493,1],[513,3]]},"131":{"position":[[125,1],[144,1],[177,2],[180,3],[189,1],[191,2],[242,2],[338,2],[341,3],[345,1],[359,1],[379,1],[393,1],[431,1],[458,2],[461,3],[470,1],[472,2],[523,2],[619,2],[622,3],[664,2],[667,1],[687,3]]},"133":{"position":[[294,1],[313,1],[346,2],[349,3],[420,3],[424,1],[438,1],[458,1],[472,1],[486,1],[589,1],[603,1],[623,1],[637,1],[675,1],[702,2],[705,3],[776,3],[818,2],[821,1],[841,3],[924,1],[970,1],[998,1],[1018,3]]},"135":{"position":[[13,1],[77,1],[129,1]]},"137":{"position":[[66,1],[109,1],[148,1],[183,3],[204,1],[251,3],[293,2],[296,1],[316,3],[332,1],[375,1],[414,1],[468,2],[471,1],[513,3],[517,2],[520,3],[562,2],[565,1],[585,3],[666,2],[669,1],[697,1],[725,1],[754,3],[825,2],[828,1],[856,1],[884,1],[913,3],[984,2],[987,1],[1015,1],[1043,1],[1072,3]]},"142":{"position":[[35,1],[71,1],[113,1],[157,2],[217,2],[350,2],[355,1],[377,3],[430,2],[433,1],[461,2],[464,2]]},"146":{"position":[[97,1],[110,1],[192,1],[222,2],[225,3],[262,1],[276,1],[296,1],[310,1],[342,1],[453,1],[481,1],[509,1],[511,2],[514,3],[551,3]]},"148":{"position":[[95,1],[108,1],[180,2],[195,2],[208,3],[212,3],[233,1],[263,2],[266,3],[303,1],[317,1],[337,1],[351,1],[383,1],[455,2],[470,2],[483,3],[487,3],[537,1],[565,1],[593,1],[595,2],[598,3],[635,3]]},"150":{"position":[[95,1],[108,1],[129,2],[132,3],[213,2],[216,3],[237,1],[267,2],[270,3],[307,1],[321,1],[341,1],[355,1],[387,1],[408,2],[411,3],[493,3],[543,1],[571,1],[599,1],[601,2],[604,3],[641,3]]},"152":{"position":[[113,1],[126,1],[147,2],[150,3],[159,1],[161,2],[212,2],[308,2],[311,3],[332,1],[362,2],[365,3],[402,1],[416,1],[436,1],[450,1],[482,1],[503,2],[506,3],[515,1],[517,2],[568,2],[664,2],[667,3],[717,1],[745,1],[773,1],[775,2],[778,3],[815,3]]},"154":{"position":[[282,1],[295,1],[316,2],[319,3],[390,3],[411,1],[441,2],[444,3],[481,1],[495,1],[515,1],[529,1],[543,1],[640,1],[654,1],[674,1],[688,1],[720,1],[741,2],[744,3],[815,3],[865,1],[893,1],[921,1],[923,2],[926,3],[963,3],[1046,1],[1086,1],[1114,1],[1134,3]]},"156":{"position":[[13,1],[77,1],[129,1]]},"158":{"position":[[54,1],[97,1],[136,1],[171,3],[186,1],[227,3],[243,1],[286,1],[319,1],[367,2],[370,1],[412,3],[416,2],[419,3],[494,2],[497,1],[525,1],[553,1],[582,3],[647,2],[650,1],[678,1],[706,1],[735,3],[800,2],[803,1],[831,1],[859,1],[888,3]]},"165":{"position":[[105,1],[125,1],[228,2],[259,7],[284,1],[331,2],[334,3],[371,1],[385,1],[405,1],[419,1],[458,1],[561,2],[592,7],[665,1],[693,1],[721,1],[723,2],[726,3],[763,3]]},"167":{"position":[[103,1],[123,1],[180,1],[233,2],[248,2],[261,3],[265,3],[269,2],[300,7],[325,1],[372,2],[375,3],[412,1],[426,1],[446,1],[460,1],[499,1],[556,1],[609,2],[624,2],[637,3],[641,3],[645,2],[676,7],[749,1],[777,1],[805,1],[807,2],[810,3],[847,3]]},"169":{"position":[[103,1],[123,1],[180,1],[182,2],[185,3],[266,2],[269,3],[273,2],[304,7],[329,1],[376,2],[379,3],[416,1],[430,1],[450,1],[464,1],[503,1],[560,1],[562,2],[565,3],[647,3],[651,2],[682,7],[755,1],[783,1],[811,1],[813,2],[816,3],[853,3]]},"171":{"position":[[121,1],[141,1],[198,1],[200,2],[203,3],[212,1],[214,2],[265,2],[361,2],[364,3],[368,2],[399,7],[424,1],[471,2],[474,3],[511,1],[525,1],[545,1],[559,1],[598,1],[655,1],[657,2],[660,3],[669,1],[671,2],[722,2],[818,2],[821,3],[825,2],[856,7],[929,1],[957,1],[985,1],[987,2],[990,3],[1027,3]]},"173":{"position":[[290,1],[310,1],[367,1],[369,2],[372,3],[443,3],[447,2],[478,7],[503,1],[550,2],[553,3],[590,1],[604,1],[624,1],[638,1],[652,1],[756,1],[770,1],[790,1],[804,1],[843,1],[900,1],[902,2],[905,3],[976,3],[980,2],[1011,7],[1084,1],[1112,1],[1140,1],[1142,2],[1145,3],[1182,3],[1265,1],[1312,1],[1340,1],[1360,3]]},"175":{"position":[[13,1],[77,1],[129,1]]},"177":{"position":[[62,1],[105,1],[144,1],[179,3],[201,1],[258,1],[280,3],[284,2],[315,7],[343,1],[385,1],[428,1],[468,1],[525,1],[554,2],[557,1],[599,3],[603,2],[606,3],[610,2],[641,7],[669,1],[779,2],[782,1],[810,1],[838,1],[867,3],[941,2],[944,1],[972,1],[1000,1],[1029,3],[1103,2],[1106,1],[1134,1],[1162,1],[1191,3]]},"182":{"position":[[105,1],[140,1]]},"184":{"position":[[63,1],[114,1],[124,1],[238,3],[290,1],[348,1],[371,1],[413,1],[425,1],[464,1],[647,1],[759,2],[762,2],[878,2],[889,1],[953,1],[1055,3],[1155,1],[1267,2],[1270,2],[1323,1],[1379,1],[1397,2],[1400,1],[1423,2],[1439,2],[1442,1],[1483,3],[1513,1],[1551,1],[1581,2],[1584,1],[1594,1],[1678,3],[1693,1],[1801,1],[1813,4],[1833,2],[1851,2],[1854,1],[1877,2],[1902,1],[1933,3],[1937,1],[1983,1],[1985,1],[2050,3],[2085,1],[2130,2],[2141,2],[2154,3],[2192,1],[2216,1],[2218,1]]},"187":{"position":[[63,1],[75,1],[111,1],[113,1],[138,1],[173,1],[256,1],[270,1],[290,1],[302,1],[338,1],[340,1],[365,1],[431,2],[434,1],[462,1],[490,1],[534,3]]},"189":{"position":[[58,1],[70,1],[106,1],[108,1],[133,1],[168,1],[210,2],[213,3],[231,3],[277,1],[291,1],[311,1],[323,1],[359,1],[361,1],[386,1],[418,1],[433,2],[436,3],[454,2],[479,2],[482,1],[510,1],[538,1],[582,1],[584,2]]},"191":{"position":[[73,1],[85,1],[121,1],[123,1],[148,1],[183,1],[211,1],[218,2],[221,3],[239,2],[249,2],[294,1],[308,1],[328,1],[340,1],[376,1],[378,1],[403,1],[435,1],[442,2],[445,3],[463,2],[496,2],[499,1],[527,1],[555,1],[599,1],[601,2]]},"199":{"position":[[63,1],[75,1],[120,3],[124,3],[128,7],[149,1],[200,1],[283,1],[297,1],[317,1],[329,1],[374,3],[378,3],[382,7],[403,1],[485,2],[488,1],[516,1],[544,1],[588,3]]},"201":{"position":[[58,1],[70,1],[115,3],[119,3],[123,7],[144,1],[195,1],[237,2],[240,3],[258,3],[304,1],[318,1],[338,1],[350,1],[395,3],[399,3],[403,7],[424,1],[472,1],[487,2],[490,3],[508,2],[533,2],[536,1],[564,1],[592,1],[636,1],[638,2]]},"203":{"position":[[73,1],[85,1],[130,3],[134,3],[138,7],[159,1],[210,1],[238,1],[245,2],[248,3],[266,2],[276,2],[321,1],[335,1],[355,1],[367,1],[412,3],[416,3],[420,7],[441,1],[489,1],[496,2],[499,3],[517,2],[550,2],[553,1],[581,1],[609,1],[653,1],[655,2]]},"211":{"position":[[63,1],[75,1],[85,1],[113,1],[115,1],[127,1],[129,3],[146,1],[183,1],[264,1],[278,1],[298,1],[310,1],[320,1],[348,1],[350,1],[362,1],[364,3],[381,1],[449,2],[452,1],[480,1],[508,1],[550,3]]},"213":{"position":[[58,1],[70,1],[80,1],[108,1],[110,1],[122,1],[124,3],[141,1],[178,1],[220,2],[223,3],[241,3],[285,1],[299,1],[319,1],[331,1],[341,1],[369,1],[371,1],[383,1],[385,3],[402,1],[438,1],[453,2],[456,3],[474,2],[497,2],[500,1],[528,1],[556,1],[598,1],[600,2]]},"215":{"position":[[73,1],[85,1],[95,1],[123,1],[125,1],[137,1],[139,3],[156,1],[193,1],[221,1],[228,2],[231,3],[249,2],[259,2],[302,1],[316,1],[336,1],[348,1],[358,1],[386,1],[388,1],[400,1],[402,3],[419,1],[455,1],[462,2],[465,3],[483,2],[514,2],[517,1],[545,1],[573,1],[615,1],[617,2]]},"221":{"position":[[63,1],[75,1],[103,1],[105,1],[120,1],[122,1],[147,1],[186,1],[269,1],[283,1],[303,1],[315,1],[343,1],[345,1],[360,1],[362,1],[387,1],[457,2],[460,1],[488,1],[516,1],[560,3]]},"223":{"position":[[58,1],[70,1],[98,1],[100,1],[115,1],[117,1],[142,1],[181,1],[223,2],[226,3],[244,3],[290,1],[304,1],[324,1],[336,1],[364,1],[366,1],[381,1],[383,1],[408,1],[444,1],[459,2],[462,3],[480,2],[505,2],[508,1],[536,1],[564,1],[608,1],[610,2]]},"225":{"position":[[73,1],[85,1],[113,1],[115,1],[130,1],[132,1],[157,1],[196,1],[224,1],[231,2],[234,3],[252,2],[262,2],[307,1],[321,1],[341,1],[353,1],[381,1],[383,1],[398,1],[400,1],[425,1],[461,1],[468,2],[471,3],[489,2],[522,2],[525,1],[553,1],[581,1],[625,1],[627,2]]},"232":{"position":[[45,1]]},"236":{"position":[[46,1],[58,1],[94,1],[136,1],[209,1],[223,1],[243,1],[255,1],[291,1],[354,2],[357,1],[385,1],[413,1],[457,3]]},"238":{"position":[[56,1],[68,1],[104,1],[146,1],[178,2],[181,3],[199,3],[245,1],[259,1],[279,1],[291,1],[327,1],[364,1],[371,2],[374,3],[392,2],[417,2],[420,1],[448,1],[476,1],[520,1],[522,2]]},"247":{"position":[[46,1],[58,1],[155,1],[228,1],[242,1],[262,1],[274,1],[392,2],[395,1],[423,1],[451,1],[495,3]]},"249":{"position":[[56,1],[68,1],[165,1],[197,2],[200,3],[218,3],[264,1],[278,1],[298,1],[310,1],[402,1],[409,2],[412,3],[430,2],[455,2],[458,1],[486,1],[514,1],[558,1],[560,2]]},"258":{"position":[[46,1],[58,1],[68,1],[96,1],[115,1],[143,1],[214,1],[228,1],[248,1],[260,1],[270,1],[298,1],[317,1],[366,2],[369,1],[397,1],[425,1],[467,3]]},"260":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[185,2],[188,3],[206,3],[250,1],[264,1],[284,1],[296,1],[306,1],[334,1],[353,1],[378,1],[385,2],[388,3],[406,2],[429,2],[432,1],[460,1],[488,1],[530,1],[532,2]]},"262":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[204,2],[207,3],[225,3],[269,1],[283,1],[303,1],[315,1],[325,1],[353,1],[372,1],[397,1],[423,2],[426,3],[444,2],[467,2],[470,1],[498,1],[526,1],[568,1],[570,2]]},"269":{"position":[[46,1],[58,1],[86,1],[104,1],[146,1],[219,1],[233,1],[253,1],[265,1],[293,1],[311,1],[374,2],[377,1],[405,1],[433,1],[477,3]]},"271":{"position":[[56,1],[68,1],[96,1],[114,1],[156,1],[188,2],[191,3],[209,3],[255,1],[269,1],[289,1],[301,1],[329,1],[347,1],[384,1],[391,2],[394,3],[412,2],[437,2],[440,1],[468,1],[496,1],[540,1],[542,2]]},"278":{"position":[[35,1],[74,1],[132,1],[208,2],[211,1],[395,1],[419,3],[461,2],[464,1],[526,3],[543,1],[652,3],[679,2],[682,1],[756,1],[758,2],[807,2],[881,1],[883,2],[939,1],[963,1],[1076,1],[1083,1],[1085,2],[1147,1],[1216,1],[1218,3],[1222,3],[1267,3]]},"280":{"position":[[34,1],[136,3],[155,2],[158,1],[171,1],[178,1],[188,1],[221,2],[224,1],[253,2],[313,3],[317,1],[319,2],[344,2],[347,1],[360,1],[367,1],[377,1],[408,2],[411,1],[470,2],[473,1],[516,3],[520,3],[524,1],[526,2]]},"282":{"position":[[35,1],[68,1],[124,1],[194,1],[233,1],[277,1],[373,2],[389,1],[401,1],[408,1],[410,2],[464,1],[509,3],[513,1],[515,1],[530,1],[606,2],[609,1],[611,2],[643,2],[693,3],[697,2],[783,2],[856,2],[886,2],[976,3],[1018,2],[1021,1],[1083,3],[1112,2],[1115,1],[1137,1],[1324,2],[1327,3],[1356,4],[1361,3],[1365,10],[1376,7],[1393,4],[1424,7],[1432,4],[1437,8],[1446,6],[1453,11],[1496,3],[1500,3]]},"284":{"position":[[15,3],[19,1],[66,2],[76,1],[90,1],[122,1],[130,1],[185,1],[213,1],[241,1],[243,1],[251,3],[261,3],[275,3],[289,3],[293,2],[303,2],[306,2],[309,1],[323,1],[344,3],[389,2],[450,3],[484,2],[606,2],[609,3],[634,2],[654,1],[723,4],[728,4],[733,6],[775,2],[827,3],[845,2],[862,1],[895,1],[932,2],[962,2],[965,1],[991,3],[1012,2],[1058,3],[1092,5],[1098,3],[1109,1],[1111,1],[1125,1],[1139,1],[1147,1],[1161,1],[1175,1],[1183,1],[1196,1],[1210,1],[1218,1],[1231,1],[1245,1],[1253,1],[1267,2],[1270,3],[1274,1],[1321,2],[1331,1],[1396,1],[1440,1],[1534,1],[1553,1],[1578,1],[1610,1],[1612,3],[1683,2],[1713,1],[1742,1],[1774,1],[1776,3],[1804,2],[1823,1],[1907,1],[1909,3],[1965,2],[1991,1],[2077,1],[2079,3],[2112,2],[2133,1],[2217,1],[2219,3],[2297,2],[2319,1],[2405,1],[2407,3],[2435,2],[2456,1],[2542,1],[2544,3],[2600,2],[2628,1],[2716,1],[2718,3],[2751,2],[2774,1],[2860,1],[2862,3],[2940,2],[2964,1],[3052,1],[3054,3],[3085,2],[3105,1],[3125,1],[3127,1]]},"286":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[329,1],[355,1],[398,2],[401,1],[413,2],[428,3],[467,1],[469,1],[569,2],[596,2],[613,2],[623,2],[626,2],[629,1],[663,1],[665,1],[673,3],[683,3],[697,3],[711,3],[715,2],[729,1],[769,3],[814,2],[885,3],[919,2],[1051,2],[1054,3],[1079,2],[1099,1],[1178,4],[1183,4],[1188,6],[1230,2],[1282,3],[1334,2],[1409,3],[1451,2],[1531,1],[1567,3],[1571,3],[1589,2],[1616,1],[1716,2],[1719,1],[1721,3],[1823,2],[1856,1],[1887,3],[1942,1],[1949,1],[1972,2],[1975,1],[2006,3],[2027,2],[2073,3],[2077,1],[2079,3],[2101,5],[2107,3],[2118,1],[2120,1],[2134,1],[2153,1],[2161,1],[2175,1],[2194,1],[2202,1],[2215,1],[2234,1],[2242,1],[2255,1],[2274,1],[2282,1],[2296,1],[2315,1],[2334,2]]},"288":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[303,3],[310,2],[324,3],[333,2],[347,1],[373,1],[416,2],[419,1],[431,2],[446,3],[485,1],[487,1],[587,2],[614,2],[631,2],[641,2],[644,2],[647,1],[681,1],[683,1],[691,3],[701,3],[715,3],[729,3],[752,2],[766,1],[806,3],[851,2],[922,3],[956,2],[1088,2],[1091,3],[1116,2],[1136,1],[1215,4],[1220,4],[1225,6],[1267,2],[1319,3],[1371,2],[1446,3],[1488,2],[1568,1],[1604,3],[1608,3],[1626,2],[1653,1],[1753,2],[1756,1],[1758,3],[1860,2],[1893,1],[1924,3],[1979,1],[1986,1],[2009,2],[2012,1],[2043,3],[2064,2],[2108,3],[2112,1],[2114,3],[2136,5],[2142,3],[2153,1],[2155,1],[2169,1],[2188,1],[2196,1],[2210,1],[2229,1],[2237,1],[2250,1],[2269,1],[2277,1],[2290,1],[2309,1],[2317,1],[2331,1],[2350,1],[2369,2]]},"290":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[409,2],[423,1],[463,3],[508,2],[579,3],[613,2],[745,2],[748,3],[773,2],[793,1],[872,4],[877,4],[882,6],[924,2],[976,3],[994,2],[1011,1],[1047,1],[1084,2],[1108,2],[1111,1],[1137,3],[1158,2],[1204,3],[1226,5],[1232,3],[1243,1],[1245,1],[1259,1],[1273,1],[1281,1],[1295,1],[1309,1],[1317,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1401,2]]},"292":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[435,2],[449,1],[489,3],[534,2],[605,3],[639,2],[771,2],[774,3],[799,2],[819,1],[898,4],[903,4],[908,6],[950,2],[1002,3],[1020,2],[1036,1],[1066,1],[1076,1],[1130,1],[1194,2],[1197,2],[1221,2],[1224,1],[1247,2],[1250,1],[1276,3],[1297,2],[1343,3],[1347,3],[1369,5],[1375,3],[1386,1],[1388,1],[1402,1],[1416,1],[1424,1],[1438,1],[1452,1],[1460,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1544,2]]},"294":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[446,2],[460,1],[500,3],[545,2],[616,3],[650,2],[782,2],[785,3],[810,2],[830,1],[909,4],[914,4],[919,6],[961,2],[1013,3],[1031,2],[1048,1],[1084,1],[1121,2],[1145,2],[1148,1],[1174,3],[1195,2],[1239,3],[1261,5],[1267,3],[1278,1],[1280,1],[1294,1],[1308,1],[1316,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1400,1],[1414,1],[1422,1],[1436,2]]},"296":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[472,2],[486,1],[526,3],[571,2],[642,3],[676,2],[808,2],[811,3],[836,2],[856,1],[935,4],[940,4],[945,6],[987,2],[1039,3],[1057,2],[1073,1],[1103,1],[1113,1],[1167,1],[1231,2],[1234,2],[1258,2],[1261,1],[1284,2],[1287,1],[1313,3],[1334,2],[1378,3],[1382,3],[1404,5],[1410,3],[1421,1],[1423,1],[1437,1],[1451,1],[1459,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1543,1],[1557,1],[1565,1],[1579,2]]},"302":{"position":[[166,1],[198,1],[231,3],[241,3],[255,3],[259,3],[301,2],[304,1],[332,1],[379,1],[381,3],[508,1],[540,1],[567,3],[577,3],[591,3],[595,3],[636,2],[639,1],[667,1],[724,1],[726,3],[860,1],[899,1],[953,1],[961,3],[971,3],[985,3],[989,3],[1046,2],[1049,1],[1077,1],[1141,1],[1143,3],[1280,1],[1298,2],[1301,1],[1329,1],[1375,1],[1396,3],[1613,1],[1631,2],[1634,1],[1662,1],[1706,1],[1727,3]]},"304":{"position":[[184,1],[203,1],[242,3],[252,3],[266,3],[270,3],[274,1],[288,1],[316,1],[336,1],[338,1],[489,1],[516,3],[526,3],[540,3],[544,3],[552,1],[571,1],[601,1],[615,1],[643,1],[663,1],[665,1],[830,1],[884,1],[892,3],[902,3],[916,3],[920,3],[928,1],[972,1],[986,1],[1014,1],[1061,1],[1063,1],[1165,1],[1180,1],[1216,1],[1242,1],[1256,1],[1284,1],[1322,1],[1324,1],[1508,1],[1523,1],[1557,1],[1583,1],[1597,1],[1625,1],[1661,1],[1663,1]]},"308":{"position":[[398,1]]}}}],["0",{"_index":202,"t":{"14":{"position":[[829,2],[878,2],[1314,2],[1363,2]]},"46":{"position":[[256,2]]},"70":{"position":[[121,2]]},"109":{"position":[[579,2],[596,2],[609,2],[654,2],[670,1]]},"111":{"position":[[475,2],[492,2],[505,2],[551,2],[567,1],[602,2],[619,2],[632,2],[677,2],[693,1]]},"113":{"position":[[791,2],[808,2],[821,2],[866,2],[882,1]]},"142":{"position":[[291,2]]},"280":{"position":[[173,2],[362,2]]},"282":{"position":[[1308,2],[1321,2]]},"286":{"position":[[2332,1]]},"288":{"position":[[313,2],[2367,1]]},"294":{"position":[[292,2]]},"296":{"position":[[292,2]]}}}],["0deprec",{"_index":802,"t":{"115":{"position":[[0,11]]},"310":{"position":[[101,11]]}}}],["0xffffff",{"_index":973,"t":{"278":{"position":[[386,8]]},"282":{"position":[[876,9]]}}}],["1",{"_index":258,"t":{"16":{"position":[[1446,4],[1752,3]]},"18":{"position":[[208,1],[737,1],[1000,1]]},"46":{"position":[[259,2]]},"64":{"position":[[58,1],[155,1],[285,1],[357,1]]},"70":{"position":[[135,1]]},"72":{"position":[[189,3],[222,3],[321,3],[454,3],[516,3]]},"77":{"position":[[517,2],[703,1],[760,3],[764,2],[816,1],[854,1],[858,1],[986,3],[990,3],[1027,1],[1031,1]]},"102":{"position":[[35,1],[39,1],[129,1],[133,1]]},"105":{"position":[[221,1],[225,1],[686,1],[690,1]]},"107":{"position":[[239,1],[243,1]]},"109":{"position":[[449,2],[454,2]]},"111":{"position":[[326,2],[331,2]]},"113":{"position":[[562,2],[567,2]]},"137":{"position":[[448,2]]},"142":{"position":[[347,2],[353,1]]},"158":{"position":[[347,2]]},"177":{"position":[[534,2]]},"184":{"position":[[2138,2]]},"187":{"position":[[121,3],[348,3]]},"189":{"position":[[116,3],[369,3]]},"191":{"position":[[131,3],[386,3]]},"221":{"position":[[130,3],[370,3]]},"223":{"position":[[125,3],[391,3]]},"225":{"position":[[140,3],[408,3]]},"236":{"position":[[109,3],[306,3]]},"238":{"position":[[119,3],[342,3]]},"269":{"position":[[119,3],[326,3]]},"271":{"position":[[129,3],[362,3]]},"284":{"position":[[1216,1]]},"286":{"position":[[2240,1]]},"288":{"position":[[336,2],[2275,1]]},"290":{"position":[[1350,1]]},"292":{"position":[[1493,1]]},"294":{"position":[[315,2],[1385,1]]},"296":{"position":[[315,2],[1528,1]]},"302":{"position":[[1278,1],[1282,3],[1611,1],[1615,3]]},"304":{"position":[[1214,1],[1218,4],[1555,1],[1559,4]]}}}],["1+1",{"_index":696,"t":{"83":{"position":[[284,3]]}}}],["1+:toadd",{"_index":749,"t":{"91":{"position":[[269,8]]},"184":{"position":[[1783,8]]}}}],["1,2",{"_index":658,"t":{"77":{"position":[[608,5]]}}}],["1.0.0",{"_index":502,"t":{"44":{"position":[[202,8]]},"184":{"position":[[2026,8]]}}}],["1.1",{"_index":512,"t":{"46":{"position":[[262,4]]}}}],["1.1earli",{"_index":1174,"t":{"310":{"position":[[756,8]]}}}],["1.2",{"_index":513,"t":{"46":{"position":[[267,4]]}}}],["1.2releas",{"_index":1178,"t":{"310":{"position":[[848,10]]}}}],["10",{"_index":193,"t":{"14":{"position":[[634,3],[647,3],[1119,3],[1132,3]]},"83":{"position":[[237,2]]},"91":{"position":[[296,2]]},"111":{"position":[[532,3]]},"184":{"position":[[1810,2]]},"278":{"position":[[280,3]]},"282":{"position":[[754,3]]}}}],["1000",{"_index":1001,"t":{"280":{"position":[[322,6],[529,6]]}}}],["1045",{"_index":1019,"t":{"282":{"position":[[504,4]]}}}],["1080",{"_index":710,"t":{"83":{"position":[[864,4]]}}}],["12",{"_index":602,"t":{"64":{"position":[[126,2]]}}}],["120",{"_index":887,"t":{"142":{"position":[[335,4]]}}}],["123",{"_index":880,"t":{"142":{"position":[[152,4]]},"282":{"position":[[689,3]]}}}],["1234",{"_index":971,"t":{"278":{"position":[[330,5]]},"282":{"position":[[817,5]]}}}],["137",{"_index":162,"t":{"12":{"position":[[956,5],[1459,5]]}}}],["14",{"_index":243,"t":{"16":{"position":[[400,3],[982,3]]}}}],["16000",{"_index":632,"t":{"68":{"position":[[86,5]]}}}],["18.x",{"_index":436,"t":{"38":{"position":[[60,5]]}}}],["19",{"_index":959,"t":{"199":{"position":[[160,3],[414,3]]},"201":{"position":[[155,3],[435,3]]},"203":{"position":[[170,3],[452,3]]},"247":{"position":[[112,4],[328,4]]},"249":{"position":[[122,4],[364,4]]}}}],["1998",{"_index":1140,"t":{"306":{"position":[[12,5]]}}}],["1experiment",{"_index":538,"t":{"52":{"position":[[144,13]]},"310":{"position":[[642,13]]}}}],["2",{"_index":273,"t":{"18":{"position":[[220,1],[749,1],[1012,1]]},"46":{"position":[[272,1]]},"66":{"position":[[293,1],[464,3]]},"77":{"position":[[523,1]]},"89":{"position":[[195,3],[199,4]]},"102":{"position":[[95,1],[189,1]]},"105":{"position":[[300,1],[701,1],[705,1],[772,2]]},"107":{"position":[[261,1],[265,1],[376,1]]},"109":{"position":[[636,2]]},"111":{"position":[[338,2],[343,2],[659,2]]},"113":{"position":[[574,2],[579,2],[848,2]]},"278":{"position":[[349,2]]},"282":{"position":[[836,2]]},"284":{"position":[[1181,1]]},"286":{"position":[[2200,1]]},"288":{"position":[[2235,1]]},"290":{"position":[[1315,1]]},"292":{"position":[[1117,4],[1171,1],[1180,4],[1458,1]]},"294":{"position":[[1350,1]]},"296":{"position":[[1154,4],[1208,1],[1217,4],[1493,1]]}}}],["2+3",{"_index":929,"t":{"184":{"position":[[785,3],[1292,3]]}}}],["2.0",{"_index":668,"t":{"81":{"position":[[238,3]]}}}],["2.rds.amazonaws.com",{"_index":852,"t":{"133":{"position":[[379,21],[735,21]]},"154":{"position":[[349,21],[774,21]]},"173":{"position":[[402,21],[935,21]]}}}],["20",{"_index":960,"t":{"221":{"position":[[149,4],[389,4]]},"223":{"position":[[144,4],[410,4]]},"225":{"position":[[159,4],[427,4]]},"269":{"position":[[88,2],[295,2]]},"271":{"position":[[98,2],[331,2]]}}}],["2113931265",{"_index":1025,"t":{"282":{"position":[[907,11]]}}}],["2119",{"_index":862,"t":{"135":{"position":[[71,5]]},"156":{"position":[[71,5]]},"175":{"position":[[71,5]]}}}],["2130",{"_index":860,"t":{"135":{"position":[[7,5]]},"156":{"position":[[7,5]]},"175":{"position":[[7,5]]}}}],["2131",{"_index":865,"t":{"135":{"position":[[123,5]]},"156":{"position":[[123,5]]},"175":{"position":[[123,5]]}}}],["2181036031",{"_index":1026,"t":{"282":{"position":[[936,11]]}}}],["2282",{"_index":1141,"t":{"306":{"position":[[18,5]]}}}],["253",{"_index":1039,"t":{"282":{"position":[[1296,4]]}}}],["2stabl",{"_index":514,"t":{"46":{"position":[[289,7],[297,7]]},"105":{"position":[[0,7]]},"107":{"position":[[0,7]]},"109":{"position":[[0,7]]},"111":{"position":[[0,7]]},"113":{"position":[[0,7]]},"302":{"position":[[17,7],[396,7],[748,7],[1155,7],[1492,7]]},"304":{"position":[[17,7],[351,7],[685,7],[1073,7],[1418,7]]},"310":{"position":[[1114,7]]}}}],["3",{"_index":414,"t":{"34":{"position":[[292,3]]},"36":{"position":[[39,2]]},"46":{"position":[[278,2]]},"66":{"position":[[511,1]]},"72":{"position":[[232,3],[354,3],[364,3],[549,3],[559,3]]},"77":{"position":[[646,1]]},"89":{"position":[[388,1]]},"284":{"position":[[1251,1]]},"286":{"position":[[2280,1]]},"288":{"position":[[2315,1]]},"290":{"position":[[1385,1]]},"292":{"position":[[1528,1]]},"294":{"position":[[1420,1]]},"296":{"position":[[1563,1]]}}}],["33",{"_index":1035,"t":{"282":{"position":[[1261,3]]}}}],["3306",{"_index":709,"t":{"83":{"position":[[829,4]]},"127":{"position":[[219,5],[419,5]]},"137":{"position":[[178,4],[508,4]]},"148":{"position":[[189,5],[464,5]]},"158":{"position":[[166,4],[407,4]]},"167":{"position":[[242,5],[618,5]]},"177":{"position":[[174,4],[594,4]]},"184":{"position":[[163,5],[980,5],[1633,5]]}}}],["384",{"_index":1037,"t":{"282":{"position":[[1279,4]]}}}],["3legaci",{"_index":1188,"t":{"310":{"position":[[1181,7]]}}}],["4",{"_index":776,"t":{"105":{"position":[[775,1]]},"107":{"position":[[393,1]]},"284":{"position":[[1123,1],[1145,1]]},"286":{"position":[[2132,1],[2159,1]]},"288":{"position":[[2167,1],[2194,1]]},"290":{"position":[[1257,1],[1279,1]]},"292":{"position":[[1400,1],[1422,1]]},"294":{"position":[[1292,1],[1314,1]]},"296":{"position":[[1435,1],[1457,1]]}}}],["4.5.2",{"_index":759,"t":{"94":{"position":[[224,8]]}}}],["45",{"_index":124,"t":{"10":{"position":[[459,3],[787,3],[1139,4],[1438,4]]},"199":{"position":[[172,4],[426,4]]},"201":{"position":[[167,4],[447,4]]},"203":{"position":[[182,4],[464,4]]},"211":{"position":[[157,4],[392,4]]},"213":{"position":[[152,4],[413,4]]},"215":{"position":[[167,4],[430,4]]},"247":{"position":[[126,5],[342,5]]},"249":{"position":[[136,5],[378,5]]},"258":{"position":[[117,4],[319,4]]},"260":{"position":[[127,4],[355,4]]},"262":{"position":[[127,4],[374,4]]}}}],["5",{"_index":600,"t":{"64":{"position":[[80,3]]},"280":{"position":[[180,2],[369,2]]}}}],["5.6.10",{"_index":1024,"t":{"282":{"position":[[773,9]]}}}],["53",{"_index":163,"t":{"12":{"position":[[962,3],[1465,4]]}}}],["6",{"_index":601,"t":{"64":{"position":[[84,3]]}}}],["6.9.0",{"_index":948,"t":{"184":{"position":[[2207,8]]}}}],["60000",{"_index":198,"t":{"14":{"position":[[740,6],[811,5],[1225,6],[1296,5]]}}}],["8",{"_index":972,"t":{"278":{"position":[[366,2]]},"282":{"position":[[853,2]]}}}],["8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":834,"t":{"129":{"position":[[193,43]]},"150":{"position":[[163,43]]},"169":{"position":[[216,43]]}}}],["_err",{"_index":766,"t":{"102":{"position":[[54,6],[148,6]]},"105":{"position":[[240,6],[377,6],[718,6],[853,6]]},"107":{"position":[[314,6]]},"109":{"position":[[493,6]]},"111":{"position":[[384,6]]},"113":{"position":[[705,6]]}}}],["a,b,c,d",{"_index":661,"t":{"79":{"position":[[31,7]]}}}],["a.j",{"_index":866,"t":{"137":{"position":[[44,4]]},"158":{"position":[[32,4]]},"177":{"position":[[40,4]]}}}],["abov",{"_index":215,"t":{"14":{"position":[[1638,5],[1844,5],[2154,5],[2385,5]]},"87":{"position":[[708,5]]}}}],["accept",{"_index":712,"t":{"83":{"position":[[976,6]]}}}],["access",{"_index":671,"t":{"81":{"position":[[357,6]]},"98":{"position":[[57,7]]},"100":{"position":[[51,7]]},"119":{"position":[[77,6]]},"284":{"position":[[221,7]]},"286":{"position":[[637,7]]},"288":{"position":[[655,7]]},"290":{"position":[[331,7]]},"292":{"position":[[331,7]]},"294":{"position":[[349,7]]},"296":{"position":[[349,7]]},"298":{"position":[[145,6]]}}}],["accord",{"_index":398,"t":{"32":{"position":[[2435,9]]}}}],["accordingli",{"_index":354,"t":{"32":{"position":[[760,12]]}}}],["ack",{"_index":624,"t":{"66":{"position":[[641,3]]}}}],["acquir",{"_index":222,"t":{"14":{"position":[[2044,9]]}}}],["action",{"_index":536,"t":{"52":{"position":[[101,7],[238,7],[335,7],[530,7]]}}}],["activ",{"_index":1190,"t":{"310":{"position":[[1289,6]]}}}],["ad",{"_index":1127,"t":{"302":{"position":[[122,6]]}}}],["add(group",{"_index":900,"t":{"165":{"position":[[0,10]]},"167":{"position":[[0,10]]},"169":{"position":[[0,10]]},"171":{"position":[[0,10]]},"173":{"position":[[0,10]]},"177":{"position":[[0,10]]}}}],["addit",{"_index":297,"t":{"22":{"position":[[228,10]]},"32":{"position":[[599,10]]},"34":{"position":[[245,10],[296,10]]},"61":{"position":[[251,8]]},"81":{"position":[[3,8]]},"83":{"position":[[905,8]]},"85":{"position":[[3,8]]},"308":{"position":[[370,10]]}}}],["addition",{"_index":232,"t":{"14":{"position":[[2583,13]]}}}],["address",{"_index":1199,"t":{"310":{"position":[[1520,10]]}}}],["advanc",{"_index":804,"t":{"117":{"position":[[80,8]]}}}],["affect",{"_index":1109,"t":{"286":{"position":[[2317,8]]},"288":{"position":[[2352,8]]}}}],["affectedrow",{"_index":567,"t":{"59":{"position":[[222,13]]},"109":{"position":[[242,12],[582,13]]},"111":{"position":[[478,13],[605,13]]},"113":{"position":[[794,13]]},"286":{"position":[[485,15]]},"288":{"position":[[503,15]]}}}],["ag",{"_index":123,"t":{"10":{"position":[[451,5],[766,5],[1131,5],[1417,5]]},"12":{"position":[[935,5],[1438,5]]},"16":{"position":[[378,5],[960,5]]},"199":{"position":[[106,6],[360,6]]},"201":{"position":[[101,6],[381,6]]},"203":{"position":[[116,6],[398,6]]},"211":{"position":[[121,5],[356,5]]},"213":{"position":[[116,5],[377,5]]},"215":{"position":[[131,5],[394,5]]},"221":{"position":[[97,5],[337,5]]},"223":{"position":[[92,5],[358,5]]},"225":{"position":[[107,5],[375,5]]},"247":{"position":[[89,6],[305,6]]},"249":{"position":[[99,6],[341,6]]},"258":{"position":[[109,5],[311,5]]},"260":{"position":[[119,5],[347,5]]},"262":{"position":[[119,5],[366,5]]},"269":{"position":[[80,5],[287,5]]},"271":{"position":[[90,5],[323,5]]}}}],["again",{"_index":165,"t":{"12":{"position":[[1693,6]]},"34":{"position":[[396,6]]},"182":{"position":[[245,6]]}}}],["aim",{"_index":292,"t":{"22":{"position":[[7,4]]}}}],["algorithm",{"_index":402,"t":{"32":{"position":[[2592,9]]}}}],["algoritm",{"_index":417,"t":{"34":{"position":[[502,9]]}}}],["allow",{"_index":486,"t":{"42":{"position":[[181,6]]}}}],["alongsid",{"_index":499,"t":{"44":{"position":[[90,9]]}}}],["altern",{"_index":220,"t":{"14":{"position":[[1987,14]]}}}],["alway",{"_index":310,"t":{"26":{"position":[[192,6]]},"32":{"position":[[1488,6],[2239,6]]},"286":{"position":[[1793,6]]},"288":{"position":[[1830,6]]}}}],["amazon",{"_index":845,"t":{"133":{"position":[[56,6],[113,6],[406,7],[762,7]]},"135":{"position":[[36,6],[138,6]]},"154":{"position":[[44,6],[101,6],[376,7],[801,7]]},"156":{"position":[[36,6],[138,6]]},"173":{"position":[[52,6],[109,6],[429,7],[962,7]]},"175":{"position":[[36,6],[138,6]]}}}],["anoth",{"_index":340,"t":{"32":{"position":[[372,7]]}}}],["answer",{"_index":1116,"t":{"298":{"position":[[22,7]]},"302":{"position":[[84,7]]},"304":{"position":[[84,7]]}}}],["api",{"_index":24,"t":{"2":{"position":[[240,3]]},"4":{"position":[[17,3]]},"16":{"position":[[28,4]]},"22":{"position":[[76,3]]},"32":{"position":[[1303,3]]},"85":{"position":[[79,3]]},"308":{"position":[[102,3],[279,3]]}}}],["appli",{"_index":46,"t":{"4":{"position":[[233,7]]},"18":{"position":[[291,8],[339,8]]}}}],["approach",{"_index":1175,"t":{"310":{"position":[[817,11]]}}}],["arg",{"_index":986,"t":{"278":{"position":[[772,5]]}}}],["argument",{"_index":48,"t":{"4":{"position":[[252,10]]},"55":{"position":[[89,9]]}}}],["arguments[1",{"_index":988,"t":{"278":{"position":[[941,13],[1149,13]]}}}],["arguments[2",{"_index":989,"t":{"278":{"position":[[965,13]]}}}],["array",{"_index":267,"t":{"18":{"position":[[80,5],[844,5],[853,6],[875,5],[1140,5],[1149,6],[1171,5]]},"59":{"position":[[536,5]]},"66":{"position":[[230,5],[318,5]]},"77":{"position":[[398,5],[942,5]]},"79":{"position":[[139,5],[148,6]]},"105":{"position":[[11,5]]},"262":{"position":[[614,5]]},"278":{"position":[[824,7],[840,7]]}}}],["array.isarray(arguments[1",{"_index":987,"t":{"278":{"position":[[851,29]]}}}],["asc",{"_index":1064,"t":{"284":{"position":[[926,5]]},"286":{"position":[[1558,4]]},"288":{"position":[[1595,4]]},"290":{"position":[[1078,5]]},"292":{"position":[[1107,3],[1161,3]]},"294":{"position":[[1115,5]]},"296":{"position":[[1144,3],[1198,3]]}}}],["ascertain",{"_index":1182,"t":{"310":{"position":[[1045,9]]}}}],["ask",{"_index":280,"t":{"18":{"position":[[1262,3]]},"32":{"position":[[43,3]]},"298":{"position":[[42,5]]}}}],["assur",{"_index":1156,"t":{"310":{"position":[[162,6]]}}}],["async",{"_index":240,"t":{"16":{"position":[[64,5],[113,5],[1141,5]]},"89":{"position":[[0,5],[224,5]]},"184":{"position":[[92,5],[1962,5]]},"284":{"position":[[296,6]]},"286":{"position":[[616,6]]},"288":{"position":[[634,6]]},"290":{"position":[[310,6]]},"292":{"position":[[310,6]]},"294":{"position":[[328,6]]},"296":{"position":[[328,6]]}}}],["asynchron",{"_index":351,"t":{"32":{"position":[[703,14]]}}}],["attach",{"_index":594,"t":{"61":{"position":[[499,6]]}}}],["attack",{"_index":151,"t":{"12":{"position":[[302,7]]}}}],["auth",{"_index":332,"t":{"32":{"position":[[83,4],[801,4],[952,6],[1869,6]]},"34":{"position":[[702,5],[842,5],[982,5]]},"282":{"position":[[119,4]]}}}],["auth.doublesha1('pass123",{"_index":1010,"t":{"282":{"position":[[235,27]]}}}],["auth.verifytoken",{"_index":1012,"t":{"282":{"position":[[279,17]]}}}],["authcallback",{"_index":1027,"t":{"282":{"position":[[948,13]]}}}],["authent",{"_index":300,"t":{"22":{"position":[[285,14]]},"32":{"position":[[211,14],[610,14]]},"34":{"position":[[34,14],[159,14],[256,14],[412,14]]},"282":{"position":[[962,13]]},"308":{"position":[[558,14]]}}}],["authenticate(param",{"_index":1007,"t":{"282":{"position":[[169,20]]}}}],["authentication::native41",{"_index":399,"t":{"32":{"position":[[2448,24]]}}}],["authnextfactor",{"_index":409,"t":{"34":{"position":[[90,14]]}}}],["author",{"_index":944,"t":{"184":{"position":[[2144,9]]}}}],["authplugin",{"_index":333,"t":{"32":{"position":[[103,11],[928,12],[2480,11]]},"34":{"position":[[661,12]]}}}],["authswitchhandl",{"_index":374,"t":{"32":{"position":[[1318,17],[1778,18],[2508,17]]}}}],["authswitchrequest",{"_index":390,"t":{"32":{"position":[[2130,17]]}}}],["auto",{"_index":470,"t":{"40":{"position":[[709,4]]}}}],["auto_incr",{"_index":1054,"t":{"284":{"position":[[548,15]]},"286":{"position":[[993,15]]},"288":{"position":[[1030,15]]},"290":{"position":[[687,15]]},"292":{"position":[[713,15]]},"294":{"position":[[724,15]]},"296":{"position":[[750,15]]}}}],["automat",{"_index":217,"t":{"14":{"position":[[1733,13],[1940,13]]},"280":{"position":[[270,13]]}}}],["avail",{"_index":133,"t":{"10":{"position":[[606,9],[1318,9]]},"12":{"position":[[1109,9],[1644,9]]},"16":{"position":[[443,9]]},"46":{"position":[[238,9]]},"83":{"position":[[1080,10]]},"187":{"position":[[704,9]]},"189":{"position":[[753,9]]},"191":{"position":[[770,9]]},"199":{"position":[[758,9]]},"201":{"position":[[807,9]]},"203":{"position":[[824,9]]},"211":{"position":[[639,9]]},"213":{"position":[[688,9]]},"215":{"position":[[705,9]]},"221":{"position":[[730,9]]},"223":{"position":[[779,9]]},"225":{"position":[[796,9]]},"236":{"position":[[627,9]]},"238":{"position":[[691,9]]},"247":{"position":[[665,9]]},"249":{"position":[[729,9]]},"258":{"position":[[556,9]]},"260":{"position":[[620,9]]},"262":{"position":[[667,9]]},"269":{"position":[[647,9]]},"271":{"position":[[711,9]]},"310":{"position":[[1330,10]]}}}],["avg",{"_index":44,"t":{"4":{"position":[[212,5]]}}}],["avoid",{"_index":51,"t":{"4":{"position":[[292,5]]},"14":{"position":[[219,5]]}}}],["await",{"_index":109,"t":{"10":{"position":[[235,5],[378,5],[698,5]]},"12":{"position":[[703,5],[865,5]]},"14":{"position":[[1667,5],[2173,5],[2237,5]]},"16":{"position":[[70,6],[181,5],[308,5],[744,5],[890,5],[1414,5]]},"18":{"position":[[426,5],[705,5]]},"89":{"position":[[82,5],[155,5],[204,5],[398,5],[516,5]]},"91":{"position":[[356,5]]},"125":{"position":[[124,5]]},"127":{"position":[[128,5]]},"129":{"position":[[128,5]]},"131":{"position":[[146,5]]},"133":{"position":[[315,5],[488,5],[547,5]]},"146":{"position":[[194,5]]},"148":{"position":[[235,5]]},"150":{"position":[[239,5]]},"152":{"position":[[334,5]]},"154":{"position":[[413,5],[545,5],[604,5]]},"165":{"position":[[286,5]]},"167":{"position":[[327,5]]},"169":{"position":[[331,5]]},"171":{"position":[[426,5]]},"173":{"position":[[505,5],[654,5],[713,5]]},"184":{"position":[[126,5],[292,5],[373,5],[675,5],[930,5],[1183,5],[1364,5],[2007,7]]},"187":{"position":[[175,5]]},"189":{"position":[[170,5]]},"191":{"position":[[185,5]]},"199":{"position":[[202,5]]},"201":{"position":[[197,5]]},"203":{"position":[[212,5]]},"211":{"position":[[185,5]]},"213":{"position":[[180,5]]},"215":{"position":[[195,5]]},"221":{"position":[[188,5]]},"223":{"position":[[183,5]]},"225":{"position":[[198,5]]},"236":{"position":[[138,5]]},"238":{"position":[[148,5]]},"247":{"position":[[157,5]]},"249":{"position":[[167,5]]},"258":{"position":[[145,5]]},"260":{"position":[[155,5]]},"262":{"position":[[155,5]]},"269":{"position":[[148,5]]},"271":{"position":[[158,5]]},"284":{"position":[[392,5],[487,5],[656,5],[864,5],[1062,5]]},"286":{"position":[[731,5],[817,5],[922,5],[1101,5],[1337,5],[1454,5],[1618,5],[2083,5]]},"288":{"position":[[768,5],[854,5],[959,5],[1138,5],[1374,5],[1491,5],[1655,5],[2118,5]]},"290":{"position":[[425,5],[511,5],[616,5],[795,5],[1013,5],[1208,5]]},"292":{"position":[[451,5],[537,5],[642,5],[821,5],[1038,5],[1351,5]]},"294":{"position":[[462,5],[548,5],[653,5],[832,5],[1050,5],[1243,5]]},"296":{"position":[[488,5],[574,5],[679,5],[858,5],[1075,5],[1386,5]]},"304":{"position":[[205,5],[573,5],[930,5],[1182,5],[1525,5]]}}}],["await.j",{"_index":914,"t":{"184":{"position":[[0,8],[2062,11]]}}}],["b",{"_index":466,"t":{"40":{"position":[[622,1]]},"79":{"position":[[197,1]]}}}],["b.j",{"_index":867,"t":{"137":{"position":[[49,4]]},"158":{"position":[[37,4]]},"177":{"position":[[45,4]]}}}],["babel",{"_index":947,"t":{"184":{"position":[[2194,6]]}}}],["babelrc",{"_index":916,"t":{"184":{"position":[[15,8]]}}}],["back",{"_index":349,"t":{"32":{"position":[[659,4]]}}}],["backend",{"_index":820,"t":{"121":{"position":[[118,8],[166,8]]}}}],["backward",{"_index":1157,"t":{"310":{"position":[[169,8],[281,8]]}}}],["badg",{"_index":507,"t":{"46":{"position":[[18,6]]},"310":{"position":[[14,6]]}}}],["bar",{"_index":706,"t":{"83":{"position":[[730,6]]},"87":{"position":[[241,6],[528,6]]}}}],["base",{"_index":18,"t":{"2":{"position":[[170,5]]},"85":{"position":[[73,5]]},"310":{"position":[[983,5]]}}}],["basi",{"_index":66,"t":{"4":{"position":[[517,6]]}}}],["basic",{"_index":808,"t":{"117":{"position":[[608,5]]}}}],["befor",{"_index":546,"t":{"52":{"position":[[474,6]]},"284":{"position":[[1651,6]]}}}],["begin",{"_index":798,"t":{"113":{"position":[[552,5]]},"286":{"position":[[1518,5]]},"288":{"position":[[1555,5]]}}}],["behavior",{"_index":590,"t":{"61":{"position":[[363,8]]}}}],["below",{"_index":961,"t":{"234":{"position":[[13,5]]},"245":{"position":[[13,5]]},"256":{"position":[[13,5]]},"267":{"position":[[13,5]]}}}],["benchmark",{"_index":327,"t":{"30":{"position":[[63,10],[85,10],[115,10]]}}}],["beta",{"_index":1033,"t":{"282":{"position":[[1222,7],[1239,7]]}}}],["better",{"_index":144,"t":{"12":{"position":[[153,6],[1783,6]]},"22":{"position":[[170,6]]},"64":{"position":[[449,6]]},"182":{"position":[[335,6]]},"308":{"position":[[400,6]]}}}],["between",{"_index":406,"t":{"32":{"position":[[2648,7]]},"94":{"position":[[107,7]]}}}],["bin.000007",{"_index":885,"t":{"142":{"position":[[311,12]]}}}],["binari",{"_index":76,"t":{"6":{"position":[[102,6]]},"22":{"position":[[364,6]]},"59":{"position":[[584,6]]},"308":{"position":[[445,6]]}}}],["bind",{"_index":81,"t":{"8":{"position":[[27,8]]},"28":{"position":[[99,8],[173,8]]},"70":{"position":[[4,4]]}}}],["binlog",{"_index":324,"t":{"28":{"position":[[249,6]]}}}],["binlogpo",{"_index":886,"t":{"142":{"position":[[324,10]]}}}],["binlogstream",{"_index":877,"t":{"142":{"position":[[100,12]]}}}],["binlogstream.pip",{"_index":889,"t":{"142":{"position":[[381,18]]}}}],["blob",{"_index":383,"t":{"32":{"position":[[1607,4]]}}}],["block",{"_index":518,"t":{"48":{"position":[[177,6]]},"142":{"position":[[362,8]]},"304":{"position":[[137,6],[435,6],[769,6],[1154,6],[1497,6]]}}}],["bluebird",{"_index":248,"t":{"16":{"position":[[629,8],[645,8],[659,11],[705,8],[835,9]]}}}],["boolean",{"_index":583,"t":{"61":{"position":[[146,7]]},"70":{"position":[[105,7]]}}}],["both",{"_index":1136,"t":{"302":{"position":[[1417,4],[1748,4]]},"304":{"position":[[1343,4],[1682,4]]}}}],["bound",{"_index":1159,"t":{"310":{"position":[[230,5]]}}}],["branch",{"_index":445,"t":{"40":{"position":[[154,6]]}}}],["browser",{"_index":454,"t":{"40":{"position":[[399,7]]}}}],["buffer",{"_index":347,"t":{"32":{"position":[[630,8],[1667,8]]},"70":{"position":[[222,6]]}}}],["buffer.from",{"_index":833,"t":{"129":{"position":[[180,12]]},"150":{"position":[[150,12]]},"169":{"position":[[203,12]]}}}],["buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":836,"t":{"129":{"position":[[384,55]]},"150":{"position":[[429,55]]},"169":{"position":[[583,55]]}}}],["bug",{"_index":1198,"t":{"310":{"position":[[1488,4]]}}}],["build",{"_index":542,"t":{"52":{"position":[[266,5],[306,5]]}}}],["built",{"_index":430,"t":{"36":{"position":[[16,5]]}}}],["bun",{"_index":864,"t":{"135":{"position":[[119,3]]},"156":{"position":[[119,3]]},"175":{"position":[[119,3]]}}}],["byte",{"_index":586,"t":{"61":{"position":[[242,5]]}}}],["bytes/sec",{"_index":694,"t":{"83":{"position":[[240,9]]}}}],["c",{"_index":161,"t":{"12":{"position":[[954,1],[1457,1]]},"79":{"position":[[214,1]]},"91":{"position":[[83,1]]},"184":{"position":[[122,1],[1592,1]]}}}],["c.end",{"_index":751,"t":{"91":{"position":[[310,8]]},"184":{"position":[[936,8],[1824,8]]}}}],["c.execute('select",{"_index":748,"t":{"91":{"position":[[251,17]]},"184":{"position":[[484,17],[569,17],[695,17],[727,17],[1765,17]]}}}],["c.query('show",{"_index":746,"t":{"91":{"position":[[187,13]]},"184":{"position":[[298,13],[1701,13]]}}}],["c.query('som",{"_index":920,"t":{"184":{"position":[[379,13]]}}}],["ca",{"_index":842,"t":{"131":{"position":[[294,3],[575,3]]},"133":{"position":[[202,2],[214,2]]},"135":{"position":[[153,2]]},"152":{"position":[[264,3],[620,3]]},"154":{"position":[[190,2],[202,2]]},"156":{"position":[[153,2]]},"171":{"position":[[317,3],[774,3]]},"173":{"position":[[198,2],[210,2]]},"175":{"position":[[153,2]]}}}],["cach",{"_index":168,"t":{"12":{"position":[[1729,5]]},"64":{"position":[[215,6],[256,6],[322,5],[416,5],[480,5]]},"66":{"position":[[52,5]]},"68":{"position":[[36,6],[63,6],[173,5]]},"182":{"position":[[281,5]]}}}],["call",{"_index":158,"t":{"12":{"position":[[816,4],[1351,4]]},"32":{"position":[[520,4],[560,4],[1549,5],[2556,6]]},"64":{"position":[[209,5]]},"113":{"position":[[89,4],[629,5],[1033,5]]}}}],["callback",{"_index":103,"t":{"10":{"position":[[116,8]]},"12":{"position":[[596,8]]},"14":{"position":[[388,8],[1591,8],[2113,8]]},"18":{"position":[[404,8],[664,8]]},"32":{"position":[[1443,9]]},"59":{"position":[[453,9]]},"66":{"position":[[598,8]]}}}],["callback'",{"_index":1129,"t":{"302":{"position":[[470,10],[822,10],[1226,10],[1561,10]]}}}],["callback(nul",{"_index":385,"t":{"32":{"position":[[1646,14]]}}}],["callback.j",{"_index":829,"t":{"125":{"position":[[51,11]]},"127":{"position":[[55,11]]},"129":{"position":[[55,11]]},"131":{"position":[[55,11]]},"133":{"position":[[242,11]]},"146":{"position":[[45,11]]},"148":{"position":[[43,11]]},"150":{"position":[[43,11]]},"152":{"position":[[43,11]]},"154":{"position":[[230,11]]},"165":{"position":[[53,11]]},"167":{"position":[[51,11]]},"169":{"position":[[51,11]]},"171":{"position":[[51,11]]},"173":{"position":[[238,11]]},"187":{"position":[[47,11]]},"189":{"position":[[42,11]]},"191":{"position":[[57,11]]},"199":{"position":[[47,11]]},"201":{"position":[[42,11]]},"203":{"position":[[57,11]]},"211":{"position":[[47,11]]},"213":{"position":[[42,11]]},"215":{"position":[[57,11]]},"221":{"position":[[47,11]]},"223":{"position":[[42,11]]},"225":{"position":[[57,11]]},"236":{"position":[[30,11]]},"238":{"position":[[40,11]]},"247":{"position":[[30,11]]},"249":{"position":[[40,11]]},"258":{"position":[[30,11]]},"260":{"position":[[40,11]]},"262":{"position":[[40,11]]},"269":{"position":[[30,11]]},"271":{"position":[[40,11]]}}}],["candid",{"_index":1179,"t":{"310":{"position":[[859,9]]}}}],["capabilityflag",{"_index":562,"t":{"59":{"position":[[91,15]]},"278":{"position":[[369,16]]},"282":{"position":[[859,16],[889,16],[919,16]]}}}],["case",{"_index":376,"t":{"32":{"position":[[1461,5]]},"83":{"position":[[352,4]]},"133":{"position":[[148,4]]},"154":{"position":[[136,4]]},"173":{"position":[[144,4]]}}}],["catalog",{"_index":1029,"t":{"282":{"position":[[1139,8]]}}}],["catch",{"_index":134,"t":{"10":{"position":[[618,5],[818,5]]},"12":{"position":[[1121,5]]},"14":{"position":[[1778,5]]},"18":{"position":[[939,5]]},"125":{"position":[[203,5]]},"127":{"position":[[248,5]]},"129":{"position":[[252,5]]},"131":{"position":[[347,5]]},"133":{"position":[[426,5],[591,5]]},"146":{"position":[[264,5]]},"148":{"position":[[305,5]]},"150":{"position":[[309,5]]},"152":{"position":[[404,5]]},"154":{"position":[[483,5],[642,5]]},"165":{"position":[[373,5]]},"167":{"position":[[414,5]]},"169":{"position":[[418,5]]},"171":{"position":[[513,5]]},"173":{"position":[[592,5],[758,5]]},"184":{"position":[[415,5]]},"187":{"position":[[258,5]]},"189":{"position":[[279,5]]},"191":{"position":[[296,5]]},"199":{"position":[[285,5]]},"201":{"position":[[306,5]]},"203":{"position":[[323,5]]},"211":{"position":[[266,5]]},"213":{"position":[[287,5]]},"215":{"position":[[304,5]]},"221":{"position":[[271,5]]},"223":{"position":[[292,5]]},"225":{"position":[[309,5]]},"236":{"position":[[211,5]]},"238":{"position":[[247,5]]},"247":{"position":[[230,5]]},"249":{"position":[[266,5]]},"258":{"position":[[216,5]]},"260":{"position":[[252,5]]},"262":{"position":[[271,5]]},"269":{"position":[[221,5]]},"271":{"position":[[257,5]]},"304":{"position":[[131,5],[276,5],[429,5],[603,5],[763,5],[974,5],[1148,5],[1244,5],[1491,5],[1585,5]]}}}],["catch((err",{"_index":368,"t":{"32":{"position":[[1176,12]]},"87":{"position":[[620,12]]},"184":{"position":[[1426,12]]}}}],["catch(console.log",{"_index":263,"t":{"16":{"position":[[1806,19]]}}}],["catch(funct",{"_index":940,"t":{"184":{"position":[[1880,15]]}}}],["caus",{"_index":1193,"t":{"310":{"position":[[1407,5]]}}}],["caution",{"_index":476,"t":{"40":{"position":[[816,7]]},"310":{"position":[[387,7]]}}}],["cb",{"_index":386,"t":{"32":{"position":[[1835,3]]},"83":{"position":[[754,4]]},"282":{"position":[[190,3]]}}}],["cb(err",{"_index":392,"t":{"32":{"position":[[2196,8]]}}}],["cb(null",{"_index":388,"t":{"32":{"position":[[2065,8]]},"83":{"position":[[874,8]]},"282":{"position":[[391,9],[455,8]]}}}],["cd",{"_index":447,"t":{"40":{"position":[[189,2],[643,2]]}}}],["cert",{"_index":841,"t":{"131":{"position":[[245,5],[526,5]]},"133":{"position":[[217,4]]},"135":{"position":[[26,5],[156,4]]},"152":{"position":[[215,5],[571,5]]},"154":{"position":[[205,4]]},"156":{"position":[[26,5],[156,4]]},"171":{"position":[[268,5],[725,5]]},"173":{"position":[[213,4]]},"175":{"position":[[26,5],[156,4]]}}}],["cert.pem",{"_index":838,"t":{"131":{"position":[[76,8],[283,10],[326,11],[564,10],[607,11]]},"133":{"position":[[205,8]]},"152":{"position":[[64,8],[253,10],[296,11],[609,10],[652,11]]},"154":{"position":[[193,8]]},"171":{"position":[[72,8],[306,10],[349,11],[763,10],[806,11]]},"173":{"position":[[201,8]]}}}],["certs/ca",{"_index":837,"t":{"131":{"position":[[67,8]]},"152":{"position":[[55,8]]},"171":{"position":[[63,8]]}}}],["chang",{"_index":455,"t":{"40":{"position":[[420,7]]},"44":{"position":[[39,7],[106,8],[211,8],[227,6],[304,7],[344,7],[364,6]]},"109":{"position":[[24,7]]},"111":{"position":[[24,7]]},"113":{"position":[[24,7]]},"308":{"position":[[106,7]]},"310":{"position":[[301,7],[471,7],[747,8],[930,7]]}}}],["changedrow",{"_index":782,"t":{"109":{"position":[[148,11],[657,12]]},"111":{"position":[[554,12],[680,12]]},"113":{"position":[[869,12]]},"286":{"position":[[554,14]]},"288":{"position":[[572,14]]}}}],["changeus",{"_index":626,"t":{"66":{"position":[[749,13]]},"83":{"position":[[963,12]]}}}],["characterset",{"_index":561,"t":{"59":{"position":[[77,13]]},"278":{"position":[[352,13]]},"282":{"position":[[839,13],[1247,13]]}}}],["check",{"_index":147,"t":{"12":{"position":[[222,5]]},"20":{"position":[[44,5]]},"24":{"position":[[7,5]]},"26":{"position":[[57,5]]},"52":{"position":[[13,5],[119,5],[158,6]]},"102":{"position":[[374,5]]},"117":{"position":[[13,5],[372,8],[477,8]]}}}],["checkout",{"_index":465,"t":{"40":{"position":[[612,8]]}}}],["choos",{"_index":245,"t":{"16":{"position":[[475,6]]}}}],["ci",{"_index":449,"t":{"40":{"position":[[240,2],[679,2]]}}}],["clash",{"_index":269,"t":{"18":{"position":[[129,9]]}}}],["class",{"_index":12,"t":{"2":{"position":[[124,5]]},"117":{"position":[[628,5]]},"284":{"position":[[1428,5],[1669,5]]}}}],["classif",{"_index":1185,"t":{"310":{"position":[[1098,15]]}}}],["classifi",{"_index":1169,"t":{"310":{"position":[[618,10],[1354,10]]}}}],["clear",{"_index":541,"t":{"52":{"position":[[256,5],[292,5]]}}}],["cli",{"_index":461,"t":{"40":{"position":[[541,3]]},"184":{"position":[[2201,5]]}}}],["client",{"_index":28,"t":{"2":{"position":[[273,7]]},"6":{"position":[[6,6]]},"10":{"position":[[136,6],[863,6]]},"16":{"position":[[539,6]]},"22":{"position":[[384,6]]},"28":{"position":[[68,6],[143,7],[220,6]]},"32":{"position":[[51,6],[1577,6],[2656,6]]},"34":{"position":[[68,6]]},"59":{"position":[[276,6],[383,7]]},"61":{"position":[[318,7]]},"77":{"position":[[171,6]]},"121":{"position":[[237,6],[281,6]]}}}],["clientflag",{"_index":964,"t":{"278":{"position":[[62,11]]}}}],["clientflags.compress",{"_index":974,"t":{"278":{"position":[[397,21]]}}}],["clientplugindata(password1",{"_index":424,"t":{"34":{"position":[[789,27]]}}}],["clientplugindata(password2",{"_index":426,"t":{"34":{"position":[[929,27]]}}}],["clientplugindata(password3",{"_index":428,"t":{"34":{"position":[[1069,27]]}}}],["clone",{"_index":463,"t":{"40":{"position":[[557,5]]}}}],["close",{"_index":178,"t":{"14":{"position":[[138,7]]},"61":{"position":[[405,5]]},"64":{"position":[[250,5]]},"66":{"position":[[72,6],[635,5]]},"68":{"position":[[187,7]]},"310":{"position":[[895,5]]}}}],["co",{"_index":742,"t":{"91":{"position":[[39,2],[353,2]]},"184":{"position":[[1548,2],[2004,2]]}}}],["co(funct",{"_index":744,"t":{"91":{"position":[[59,12]]},"184":{"position":[[1568,12]]}}}],["co.j",{"_index":915,"t":{"184":{"position":[[9,5]]}}}],["code",{"_index":17,"t":{"2":{"position":[[165,4],[192,5]]},"32":{"position":[[821,4]]},"48":{"position":[[172,4]]},"61":{"position":[[230,4]]},"117":{"position":[[24,4]]},"135":{"position":[[98,4]]},"156":{"position":[[98,4]]},"175":{"position":[[98,4]]},"282":{"position":[[425,5],[498,5],[683,5]]},"308":{"position":[[66,4],[217,4]]}}}],["collat",{"_index":1154,"t":{"308":{"position":[[512,9]]}}}],["column",{"_index":266,"t":{"18":{"position":[[16,7]]},"66":{"position":[[239,6],[334,6],[480,8]]},"278":{"position":[[832,7],[955,7],[1029,9],[1066,9]]}}}],["columnlength",{"_index":1036,"t":{"282":{"position":[[1265,13]]}}}],["columntyp",{"_index":1038,"t":{"282":{"position":[[1284,11]]}}}],["come",{"_index":182,"t":{"14":{"position":[[250,5]]},"66":{"position":[[37,5]]}}}],["command",{"_index":545,"t":{"52":{"position":[[466,7]]},"59":{"position":[[203,8]]},"61":{"position":[[6,7],[162,7],[222,7],[291,8]]},"184":{"position":[[842,8]]},"310":{"position":[[547,7]]}}}],["commandcod",{"_index":584,"t":{"61":{"position":[[190,13]]}}}],["commit",{"_index":547,"t":{"52":{"position":[[495,7]]}}}],["commonli",{"_index":1117,"t":{"298":{"position":[[33,8]]}}}],["compat",{"_index":26,"t":{"2":{"position":[[250,10]]},"4":{"position":[[21,10]]},"48":{"position":[[188,10]]},"135":{"position":[[103,10]]},"156":{"position":[[103,10]]},"175":{"position":[[103,10]]},"308":{"position":[[283,10]]},"310":{"position":[[178,14],[290,10],[1122,13]]}}}],["compil",{"_index":483,"t":{"42":{"position":[[121,8]]},"121":{"position":[[101,9]]}}}],["complet",{"_index":460,"t":{"40":{"position":[[500,8]]},"42":{"position":[[52,8]]}}}],["complianc",{"_index":534,"t":{"52":{"position":[[49,10]]}}}],["compon",{"_index":479,"t":{"42":{"position":[[12,9],[165,11],[273,10]]},"44":{"position":[[12,9],[286,10]]},"46":{"position":[[204,10]]},"48":{"position":[[122,9],[230,10]]},"52":{"position":[[173,10]]}}}],["compress",{"_index":23,"t":{"2":{"position":[[218,10]]},"6":{"position":[[123,12]]},"22":{"position":[[352,11]]},"308":{"position":[[538,11]]}}}],["concept",{"_index":805,"t":{"117":{"position":[[89,9]]}}}],["config",{"_index":313,"t":{"26":{"position":[[239,6]]},"32":{"position":[[126,6],[345,6],[1347,6]]},"34":{"position":[[354,6]]},"77":{"position":[[75,6]]},"167":{"position":[[19,7]]},"169":{"position":[[19,7]]},"171":{"position":[[19,7]]},"173":{"position":[[19,7]]},"177":{"position":[[19,7]]}}}],["confirm",{"_index":1125,"t":{"302":{"position":[[59,9]]},"304":{"position":[[59,9]]}}}],["conn",{"_index":224,"t":{"14":{"position":[[2166,4],[2425,5]]},"16":{"position":[[1634,4],[1721,4]]},"18":{"position":[[419,4],[537,4]]},"32":{"position":[[832,4],[1682,4]]},"34":{"position":[[518,4]]},"89":{"position":[[75,4]]},"98":{"position":[[128,4]]},"100":{"position":[[116,4]]},"105":{"position":[[107,4],[552,4]]},"107":{"position":[[124,4]]},"109":{"position":[[363,4]]},"111":{"position":[[214,4]]},"113":{"position":[[342,4]]},"278":{"position":[[201,6]]},"282":{"position":[[599,6]]},"284":{"position":[[1450,5]]},"286":{"position":[[724,4]]},"288":{"position":[[761,4]]},"290":{"position":[[418,4]]},"292":{"position":[[444,4]]},"294":{"position":[[455,4]]},"296":{"position":[[481,4]]}}}],["conn.clos",{"_index":1023,"t":{"282":{"position":[[700,13],[1482,13]]}}}],["conn.end",{"_index":264,"t":{"16":{"position":[[1838,12]]},"89":{"position":[[210,11]]},"286":{"position":[[2089,11]]},"288":{"position":[[2124,11]]},"290":{"position":[[1214,11]]},"292":{"position":[[1357,11]]},"294":{"position":[[1249,11]]},"296":{"position":[[1392,11]]}}}],["conn.execute('select",{"_index":732,"t":{"89":{"position":[[161,20]]},"102":{"position":[[108,20]]}}}],["conn.execute>(sql",{"_index":799,"t":{"113":{"position":[[651,53]]}}}],["conn.query>('cal",{"_index":1102,"t":{"286":{"position":[[1624,45]]},"288":{"position":[[1661,45]]}}}],["conn.query('drop",{"_index":1097,"t":{"286":{"position":[[823,33],[1343,33]]},"288":{"position":[[860,33],[1380,33]]},"290":{"position":[[517,33]]},"292":{"position":[[543,33]]},"294":{"position":[[554,33]]},"296":{"position":[[580,33]]}}}],["conn.query(sql",{"_index":787,"t":{"109":{"position":[[460,32]]}}}],["conn.query(sql",{"_index":792,"t":{"111":{"position":[[349,34]]}}}],["conn.query('select",{"_index":771,"t":{"105":{"position":[[185,35]]}}}],["conn.query('show",{"_index":773,"t":{"105":{"position":[[321,33],[797,33]]}}}],["conn.query(sql",{"_index":778,"t":{"107":{"position":[[279,34]]}}}],["conn.query { const response = encrypt(key, password, pluginData); // continue handshake by sending response data return response; }) .catch((err) => { // throw error to propagate error to connect/changeUser handlers }); }; }, }, }); There is also a deprecated API where if a authSwitchHandler connection config option is set it must be a function that receives switch request data and responds via a callback. In this case, the first invocation always has a ({pluginName, pluginData}) signature, following calls - ({pluginData}). The client replies with an opaque blob matching the requested plugin via callback(null, data: Buffer). const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authSwitchHandler: function ({ pluginName, pluginData }, cb) { if (pluginName === 'ssh-key-auth') { getPrivateKey((key) => { const response = encrypt(key, pluginData); // continue handshake by sending response data // respond with error to propagate error to connect/changeUser handlers cb(null, response); }); } else { const err = new Error( `Unknown AuthSwitchRequest plugin name ${pluginName}` ); err.fatal = true; cb(err); } }, }); The initial handshake is always performed using mysql_native_password plugin. This will be possible to override in future versions. Note that if the mysql_native_password method is requested it will be handled internally according to Authentication::Native41 and no authPlugins function or the authSwitchHandler will be invoked. These MAY be called multiple times if the plugin algorithm requires multiple roundtrips of data exchange between client and server.","s":"Authentication Switch Request","u":"/node-mysql2/docs/documentation/authentication-switch","h":"","p":7},{"i":10,"t":"If the user requires multi-factor authentication in the server, the client will receive a AuthNextFactor request, which is similar in structure to the regular authentication switch request and contains the name and possible initial data for the additional authentication factor plugin (up to 3). Additional passwords can be provided using the connection config options - password2 and password3. Again, for each authentication factor, multiple roundtrips of data exchange can be required by the plugin algoritm. const conn = mysql.createConnection({ user: 'test_user', password: 'secret1', password2: 'secret2', password3: 'secret3', database: 'test_database', authPlugins: { // password1 === password 'auth-plugin1': function ({ password1 }) { return function (serverPluginData) { return clientPluginData(password1, serverPluginData); }; }, 'auth-plugin2': function ({ password2 }) { return function (serverPluginData) { return clientPluginData(password2, serverPluginData); }; }, 'auth-plugin3': function ({ password3 }) { return function (serverPluginData) { return clientPluginData(password3, serverPluginData); }; }, }, });","s":"Multi-factor authentication","u":"/node-mysql2/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":7},{"i":12,"t":"MySQL2 aims to be a drop in replacement for Node MySQL. note If you see any API incompatibilities with Node MySQL, please report via github issue. Not only MySQL2 offers better performance over Node MySQL, we also support these additional features: Prepared Statements Promise Wrapper Authentication Switch More Features MySQL Server Pooling SSL MySQL Compression Binary Log Protocol Client","s":"Documentation","u":"/node-mysql2/docs/documentation","h":"","p":11},{"i":14,"t":"Please check these examples for MySQL2.","s":"Examples","u":"/node-mysql2/docs/documentation","h":"#examples","p":11},{"i":16,"t":"zeroFill flag is ignored in type conversion. You need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you. DECIMAL and NEWDECIMAL types always returned as string unless you pass this config option: { decimalNumbers: true, } note This option could lose precision on the number as Javascript Number is a Float!","s":"Known incompatibilities with Node MySQL","u":"/node-mysql2/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":11},{"i":18,"t":"Wire protocol documentation Node MySQL - Most popular node.js mysql client library node-mariasql - Bindings to libmariasql. One of the fastest clients node-libmysqlclient - Bindings to libmysqlclient go-mysql - MySQL Go client (prepared statements, binlog protocol, server)","s":"Other Resources","u":"/node-mysql2/docs/documentation","h":"#other-resources","p":11},{"i":20,"t":"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b npm run benchmarks node-mysql-benchmarks try to run example benchmarks on your system","s":"Benchmarks","u":"/node-mysql2/docs/documentation","h":"#benchmarks","p":11},{"i":23,"t":"You can use named placeholders for parameters by setting namedPlaceholders config value or query/execute time option. Named placeholders are converted to unnamed ? on the client (mysql protocol does not support named parameters). If you reference parameter multiple times under the same name it is sent to server multiple times. Unnamed placeholders can still be used by providing the values as an array instead of an object. connection.config.namedPlaceholders = true; connection.execute('select :x + :y as z', { x: 1, y: 2 }, (err, rows) => { // statement prepared as \"select ? + ? as z\" and executed with [1,2] values // rows returned: [ { z: 3 } ] }); connection.execute('select :x + :x as z', { x: 1 }, (err, rows) => { // select ? + ? as z, execute with [1, 1] }); connection.query('select :x + :x as z', { x: 1 }, (err, rows) => { // query select 1 + 1 as z }); // unnamed placeholders are still valid if the values are provided in an array connection.query('select ? + ? as z', [1, 1], (err, rows) => { // query select 1 + 1 as z });","s":"Named placeholders","u":"/node-mysql2/docs/documentation/extras","h":"#named-placeholders","p":21},{"i":25,"t":"const options = { sql: 'select A,B,C,D from foo', rowsAsArray: true }; connection.query(options, (err, results) => { /* results will be an array of arrays like this now: [[ 'field A value', 'field B value', 'field C value', 'field D value', ], ...] */ });","s":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":21},{"i":27,"t":"In addition to sending local fs files you can send any stream using infileStreamFactory query option. If set, it has to be a function that return a readable stream. It gets file path from query as a parameter. Note: starting from version 2.0 infileStreamFactory is required parameter for LOAD DATA LOCAL INFILE. Response from server indicates that it wants access to a local file and no infileStreamFactory option is provided the query ends with error. // local file connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)', onInserted1 ); // local stream const sql = 'LOAD DATA LOCAL INFILE \"mystream\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)'; connection.query( { sql: sql, infileStreamFactory: function (path) { return getStream(); }, }, onInserted2 ); The infileStreamFactory option may also be set at a connection-level: const fs = require('fs'); const mysql = require('mysql2'); const connection = mysql.createConnection({ user: 'test', database: 'test', infileStreamFactory: (path) => { // Validate file path const validPaths = ['/tmp/data.csv']; if (!validPaths.includes(path)) { throw new Error( `invalid file path: ${path}: expected to be one of ${validPaths.join( ',' )}` ); } return fs.createReadStream(path); }, }); connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test', onInserted );","s":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":21},{"i":29,"t":"const net = require('net'); const mysql = require('mysql2'); const shape = require('shaper'); const connection = mysql.createConnection({ user: 'test', database: 'test', stream: net.connect('/tmp/mysql.sock').pipe(shape(10)), // emulate 10 bytes/sec link }); connection.query('SELECT 1+1 as test1', console.log); stream also can be a function. In that case function result has to be duplex stream, and it is used for connection transport. This is required if you connect pool using custom transport as new pooled connection needs new stream. Example connecting over socks5 proxy: const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ database: 'test', user: 'foo', password: 'bar', stream: function (cb) { const newStream = new SocksConnection( { host: 'remote.host', port: 3306 }, { host: 'localhost', port: 1080 } ); cb(null, newStream); }, }); In addition to password createConnection(), createPool() and changeUser() accept passwordSha1 option. This is useful when implementing proxies as plaintext password might be not available.","s":"Connecting using custom stream:","u":"/node-mysql2/docs/documentation/extras","h":"#connecting-using-custom-stream","p":21},{"i":32,"t":"createServer() - creates server instance Server.listen - listen port / unix socket (same arguments as net.Server.listen)","s":"Server","u":"/node-mysql2/docs/documentation/mysql-server","h":"#server","p":30},{"i":34,"t":"connect new incoming connection.","s":"Events","u":"/node-mysql2/docs/documentation/mysql-server","h":"#events","p":30},{"i":36,"t":"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags }) send server handshake initialisation packet, wait handshake response and start listening for commands writeOk({ affectedRows: num, insertId: num }) send OK packet to client writeEof(warnings, statusFlags) send EOF packet writeTextResult(rows, fields) write query result to client. Rows and fields are in the same format as in connection.query callback. writeColumns(fields) write fields + EOF packets. writeTextRow(row) write array (not hash!) of values as result row TODO: binary protocol","s":"Connection","u":"/node-mysql2/docs/documentation/mysql-server","h":"#connection","p":30},{"i":38,"t":"Every command packet received by the server will be emitted as a packet event with the parameters: packet: Packet The packet itself knownCommand: boolean is this command known to the server *commandCode: number the parsed command code (first byte) In addition special events are emitted for commands received from the client. If no listener is present a fallback behavior will be invoked. quit() Default: close the connection init_db(schemaName: string) Default: return OK query(sql: string) Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR field_list(table: string, fields: string) Default: return ER_WARN_DEPRECATED_SYNTAX ping() - Default: return OK","s":"Events","u":"/node-mysql2/docs/documentation/mysql-server","h":"#events-1","p":30},{"i":40,"t":"In addition to errback interface there is thin wrapper to expose Promise-based api","s":"Promise Wrappers","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"","p":39},{"i":42,"t":"/* eslint-env es6 */ const mysql = require('mysql2/promise'); // or require('mysql2').createConnectionPromise mysql .createConnection({ /* same parameters as for non-promise createConnection */ }) .then((conn) => conn.query('select foo from bar')) .then(([rows, fields]) => console.log(rows[0].foo)); const pool = require('mysql2/promise').createPool({}); // or require('mysql2').createPoolPromise({}) or require('mysql2').createPool({}).promise() pool .getConnection() .then((conn) => { const res = conn.query('select foo from bar'); conn.release(); return res; }) .then((result) => { console.log(result[0][0].foo); }) .catch((err) => { console.log(err); // any of connection time or query time errors from above });","s":"Basic Promise","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#basic-promise","p":39},{"i":44,"t":"async function example1() { const mysql = require('mysql2/promise'); const conn = await mysql.createConnection({ database: test }); const [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]); await conn.end(); } async function example2() { const mysql = require('mysql2/promise'); const pool = mysql.createPool({ database: test }); // execute in parallel, next console.log in 3 seconds await Promise.all([ pool.query('select sleep(2)'), pool.query('select sleep(3)'), ]); console.log('3 seconds after'); await pool.end(); }","s":"ES7 Async Await","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#es7-async-await","p":39},{"i":46,"t":"const mysql = require('mysql2'); const co = require('co'); co(function* () { const c = yield mysql.createConnectionPromise({ user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }); Examples in /examples/promise-co-await","s":"With CO","u":"/node-mysql2/docs/documentation/promise-wrapper","h":"#with-co","p":39},{"i":48,"t":"This website is built using Docusaurus 3, a modern static website generator.","s":"Website Contributing Guidelines","u":"/node-mysql2/docs/contributing/website","h":"","p":47},{"i":50,"t":"You will need these tools installed on your system: Node.js (18.x or higher)","s":"Environment","u":"/node-mysql2/docs/contributing/website","h":"#environment","p":47},{"i":52,"t":"Fork the MySQL2 repository. Download your forked repository locally. The website's workspace is the \"website\" directory in node-mysql2 root. Create a new branch from master (optional). Run cd website to enter the website workspace. Run npm ci to install the dependecies from package-lock.json. Run npm start to starting the local development. It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. For Docusaurus complete documentation, please see here. CLI example git clone https://github.com/sidorares/node-mysql2.git git checkout -b website # optional cd /path-to/node-mysql2/website npm ci npm start Documentation is auto-generated from MDX files placed in these directories: ./docs/documentation ./docs/examples ./docs/faq Caution Note that the website has its own package.json. Please, do not install dependencies for the website in node-mysql2 root.","s":"Development","u":"/node-mysql2/docs/contributing/website","h":"#development","p":47},{"i":54,"t":"Every extra component is thoroughly documented with complete typings descriptions. Docusaurus Markdown Features: The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences.","s":"Extras Components","u":"/node-mysql2/docs/contributing/website","h":"#extras-components","p":47},{"i":56,"t":"The History component displays version changes in a table format, listing version numbers alongside their changes. import { History } from '@site/src/components/History'; tip You can also utilize React components in the changes option. Example History Version Changes v1.0.0 Some change message.","s":"History","u":"/node-mysql2/docs/contributing/website","h":"#history","p":47},{"i":58,"t":"See the Stability Badges for more detais. import { Stability } from '@site/src/components/Stability'; tip You can also utilize React components in the message option. Available levels: 0, 1, 1.1, 1.2, 2 and 3. Example 2Stable 2Stable Some message.","s":"Stability","u":"/node-mysql2/docs/contributing/website","h":"#stability","p":47},{"i":60,"t":"import { FAQ } from '@site/src/components/FAQ'; > Some markdown (**MDX**) content. tip The FAQ component can be utilized in any section or page. Code blocks are compatible and can be used within the FAQ component. Example Title Some markdown (MDX) content.","s":"FAQ","u":"/node-mysql2/docs/contributing/website","h":"#faq","p":47},{"i":62,"t":"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; Example","s":"ExternalCodeEmbed","u":"/node-mysql2/docs/contributing/website","h":"#externalcodeembed","p":47},{"i":64,"t":"npm run test Check Prettier and ESLint rules for compliance npm run lintcheck Included in the GitHub Actions workflow. Check for typings errors 1Experimental Checks for MDX components are missing. npm run typecheck Included in the GitHub Actions workflow. Clear and build the website npm run clear npm run build Included in the GitHub Actions workflow. Fix issues from Prettier and ESLint rules npm run lint To prevent lint issues, it is recommended to execute this command before creating your commit. Not included in the GitHub Actions workflow.","s":"Running Tests","u":"/node-mysql2/docs/contributing/website","h":"#running-tests","p":47},{"i":67,"t":"Similar to connection.query(). connection.execute('select 1 + ? + ? as result', [5, 6], (err, rows) => { // rows: [ { result: 12 } ] // internally 'select 1 + ? + ? as result' is prepared first. On subsequent calls cached statement is re-used }); // close cached statement for 'select 1 + ? + ? as result'. noop if not in cache connection.unprepare('select 1 + ? + ? as result'); Note that connection.execute() will cache the prepared statement for better performance, remove the cache with connection.unprepare() when you're done.","s":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":65},{"i":69,"t":"Manually prepared statements doesn't comes with LRU cache and SHOULD be closed using statement.close() instead of connection.unprepare(). connection.prepare('select ? + ? as tests', (err, statement) => { // statement.parameters - array of column definitions, length === number of params, here 2 // statement.columns - array of result column definitions. Can be empty if result schema is dynamic / not known // statement.id // statement.query statement.execute([1, 2], (err, rows, columns) => { // -> [ { tests: 3 } ] }); // don't use connection.unprepare(), it won't work! // note that there is no callback here. There is no statement close ack at protocol level. statement.close(); }); Note that you should not use statement after connection reset (changeUser() or disconnect). Statement scope is connection, you need to prepare statement for each new connection in order to use it.","s":"Manual prepare / execute","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":65},{"i":71,"t":"maxPreparedStatements : We keep the cached statements in a lru-cache. Default size is 16000 but you can use this option to override it. Any statements that are dropped from cache will be closed.","s":"Configuration","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#configuration","p":65},{"i":73,"t":"The bind parameter values passed to execute are serialized JS -> MySQL as: null -> NULL number -> DOUBLE boolean -> TINY (0 for false, 1 for true) object -> depending on prototype: Date -> DATETIME JSON like object - JSON Buffer -> VAR_STRING Other -> VAR_STRING Passing in undefined or a function will result in an error.","s":"Serialization of bind parameters","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":65},{"i":75,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [1, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.unprepare('select ?+1 as qqq, ? as rrr, ? as yyy'); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); } ); } ); } );","s":"Prepared Statements Helper","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":65},{"i":77,"t":"For Prepared Statements examples, please see here.","s":"Examples","u":"/node-mysql2/docs/documentation/prepared-statements","h":"#examples","p":65},{"i":79,"t":"tip To explore the examples, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Examples","u":"/node-mysql2/docs/examples","h":"","p":78},{"i":81,"t":"MySQL-pg-proxy - MySQL to Postgres proxy server. MySQLite.js - MySQL server with JS-only (emscripten compiled) sqlite backend. SQL-engine - MySQL server with LevelDB backend. MySQL-osquery-proxy - Connect to facebook osquery using MySQL client PlyQL - Connect to Druid using MySQL client","s":"Examples using MySQL server API","u":"/node-mysql2/docs/examples","h":"#examples-using-mysql-server-api","p":78},{"i":83,"t":"index.js 'use strict'; const mysql = require('mysql2'); const through2 = require('through2'); const binlogStream = mysql.createBinlogStream({ serverId: 123, // slave ID, first field in \"show slave hosts\" sql response // you can also specify slave host, username, password and port masterId: 0, filename: 'mysql-bin.000007', binlogPos: 120, flags: 1, // 1 = \"non-blocking mode\" }); binlogStream.pipe( through2.obj((obj, enc, next) => { console.log(obj); next(); }) );","s":"Binlog Watcher","u":"/node-mysql2/docs/examples/binlog-watcher","h":"","p":82},{"i":86,"t":"npm install --save mysql2 npm install --save-dev @types/node The @types/node ensure the proper interaction between TypeScript and the Node.js modules used by MySQL2 (net, events, stream, tls, etc.). info Requires TypeScript >=4.5.2.","s":"Installation","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#installation","p":84},{"i":88,"t":"You can import MySQL2 in two ways: By setting the esModuleInterop option to true in tsconfig.json import mysql from 'mysql2'; import mysql from 'mysql2/promise'; By setting the esModuleInterop option to false in tsconfig.json import * as mysql from 'mysql2'; import * as mysql from 'mysql2/promise';","s":"Usage","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#usage","p":84},{"i":90,"t":"import mysql, { ConnectionOptions } from 'mysql2'; const access: ConnectionOptions = { user: 'test', database: 'test', }; const conn = mysql.createConnection(access);","s":"Connection","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#connection","p":84},{"i":92,"t":"import mysql, { PoolOptions } from 'mysql2'; const access: PoolOptions = { user: 'test', database: 'test', }; const conn = mysql.createPool(access);","s":"Pool Connection","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#pool-connection","p":84},{"i":94,"t":"A simple query​ conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); conn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); The rows output will be these possible types: RowDataPacket[] RowDataPacket[][] ResultSetHeader ResultSetHeader[] ProcedureCallPacket In this example, you need to manually check the output types","s":"Query and Execute","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#query-and-execute","p":84},{"i":97,"t":"2Stable An array with the returned rows, for example: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); // SELECT conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { test: 2 } ] */ }); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { Tables_in_test: 'test' } ] */ }); Using rowsAsArray option as true: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', rowsAsArray: true, }); // SELECT conn.query( 'SELECT 1 + 1 AS test, 2 + 2 AS test;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 2, 4 ] ] */ } ); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 'test' ] ] */ });","s":"RowDataPacket[]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#rowdatapacket","p":84},{"i":99,"t":"2Stable Using multipleStatements option as true with multiple queries: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SELECT 1 + 1 AS test; SELECT 2 + 2 AS test; `; conn.query(sql, (_err, rows) => { console.log(rows); /** * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ] */ });","s":"RowDataPacket[][]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":84},{"i":101,"t":"2Stable History Version Changes v3.5.1 OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead. changedRows option is deprecated and might be removed in the future major release. Please use affectedRows instead. For INSERT, UPDATE, DELETE, TRUNCATE, etc.: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); const sql = ` SET @1 = 1; `; conn.query(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ });","s":"ResultSetHeader","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#resultsetheader","p":84},{"i":103,"t":"2Stable History Version Changes v3.5.1 Introduce ResultSetHeader[] For multiples INSERT, UPDATE, DELETE, TRUNCATE, etc. when using multipleStatements as true: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SET @1 = 1; SET @2 = 2; `; conn.query(sql, (_err, results) => { console.log(results); /** * @results: [ ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 10, warningStatus: 0, changedRows: 0 }, ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } ] */ });","s":"ResultSetHeader[]","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":84},{"i":105,"t":"2Stable History Version Changes v3.5.1 Introduce ProcedureCallPacket tip By performing a Call Procedure using INSERT, UPDATE, etc., the return will be a ProcedureCallPacket (even if you perform multiples queries and set multipleStatements to true): import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); /** ResultSetHeader */ conn.query('DROP PROCEDURE IF EXISTS myProcedure'); /** ResultSetHeader */ conn.query(` CREATE PROCEDURE myProcedure() BEGIN SET @1 = 1; SET @2 = 2; END `); /** ProcedureCallPacket */ const sql = 'CALL myProcedure()'; conn.query>(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ }); For CREATE PROCEDURE and DROP PROCEDURE, these returns will be the default ResultSetHeader. By using SELECT and SHOW queries in a Procedure Call, it groups the results as: /** ProcedureCallPacket */ [RowDataPacket[], ResultSetHeader] For ProcedureCallPacket, please see the following examples.","s":"ProcedureCallPacket","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":84},{"i":107,"t":"0Deprecated OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead.","s":"OkPacket","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#okpacket","p":84},{"i":109,"t":"You can also check some code examples using MySQL2 and TypeScript to understand advanced concepts: Extending and using Interfaces with RowDataPacket Extending and using Interfaces with RowDataPacket and rowAsArray Extending and using Interfaces with RowDataPacket and multipleStatements Extending and using Interfaces with RowDataPacket, rowAsArray and multipleStatements Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket from ProcedureCallPacket Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket and rowAsArray from ProcedureCallPacket Creating a basic custom MySQL2 Class","s":"Examples","u":"/node-mysql2/docs/documentation/typescript-examples","h":"#examples","p":84},{"i":111,"t":"MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more.","s":"MySQL2","u":"/node-mysql2/docs","h":"","p":110},{"i":113,"t":"MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues. JavaScript TypeScript npm install --save mysql2 npm install --save mysql2 npm install --save-dev @types/node For TypeScript documentation and examples, see here.","s":"Installation","u":"/node-mysql2/docs","h":"#installation","p":110},{"i":115,"t":"To explore more queries examples, please visit the example sections Simple Queries and Prepared Statements. Promise Callback // Get the client import mysql from 'mysql2/promise'; // Create the connection to database const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // A simple SELECT query try { const [results, fields] = await connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45' ); console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } catch (err) { console.log(err); } // Using placeholders try { const [results] = await connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45] ); console.log(results); } catch (err) { console.log(err); } // Get the client const mysql = require('mysql2'); // Create the connection to database const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // A simple SELECT query connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45', function (err, results, fields) { console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } ); // Using placeholders connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45], function (err, results) { console.log(results); } );","s":"First Query","u":"/node-mysql2/docs","h":"#first-query","p":110},{"i":117,"t":"With MySQL2 you also get the prepared statements. With prepared statements MySQL doesn't have to prepare plan for same query every time, this results in better performance. If you don't know why they are important, please check these discussions: How prepared statements can protect from SQL Injection attacks MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. To explore more Prepared Statements and Placeholders examples, please visit the example section Prepared Statements. Promise Callback import mysql from 'mysql2/promise'; try { // create the connection to database const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute will internally call prepare and query const [results, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53] ); console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } catch (err) { console.log(err); } const mysql = require('mysql2'); // create the connection to database const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute will internally call prepare and query connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53], function (err, results, fields) { console.log(results); // results contains rows returned by server console.log(fields); // fields contains extra meta data about results, if available } ); tip If you execute same statement again, it will be picked from a LRU cache which will save query preparation time and give better performance.","s":"Using Prepared Statements","u":"/node-mysql2/docs","h":"#using-prepared-statements","p":110},{"i":119,"t":"Connection pools help reduce the time spent connecting to the MySQL server by reusing a previous connection, leaving them open instead of closing when you are done with them. This improves the latency of queries as you avoid all of the overhead that comes with establishing a new connection. To explore more Connection Pools examples, please visit the example section createPool. Promise Callback import mysql from 'mysql2/promise'; // Create the connection pool. The pool-specific settings are the defaults const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); const mysql = require('mysql2'); // Create the connection pool. The pool-specific settings are the defaults const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); note The pool does not create all connections upfront but creates them on demand until the connection limit is reached. You can use the pool in the same way as connections (using pool.query() and pool.execute()): Promise Callback try { // For pool initialization, see above const [rows, fields] = await pool.query('SELECT `field` FROM `table`'); // Connection is automatically released when query resolves } catch (err) { console.log(err); } // For pool initialization, see above pool.query('SELECT `field` FROM `table`', function (err, rows, fields) { // Connection is automatically released when query resolves }); Alternatively, there is also the possibility of manually acquiring a connection from the pool and returning it later: Promise Callback // For pool initialization, see above const conn = await pool.getConnection(); // Do something with the connection await conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); // For pool initialization, see above pool.getConnection(function (err, conn) { // Do something with the connection conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); }); Additionally, directly release the connection using the connection object: conn.release();","s":"Using Connection Pools","u":"/node-mysql2/docs","h":"#using-connection-pools","p":110},{"i":121,"t":"MySQL2 also support Promise API. Which works very well with ES7 async await. import mysql from 'mysql2/promise'; async function main() { // create the connection const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); } MySQL2 use default Promise object available in scope. But you can choose which Promise implementation you want to use. // get the client import mysql from 'mysql2/promise'; // get the promise implementation, we will use bluebird import bluebird from 'bluebird'; // create the connection, specify bluebird as Promise const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', Promise: bluebird, }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); MySQL2 also exposes a .promise() function on Pools, so you can create a promise/non-promise connections from the same pool. import mysql from 'mysql2'; async function main() { // create the pool const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', }); // now get a Promise wrapped instance of that pool const promisePool = pool.promise(); // query database using promises const [rows, fields] = await promisePool.query('SELECT 1'); } MySQL2 exposes a .promise() function on Connections, to \"upgrade\" an existing non-promise connection to use promise. const mysql = require('mysql2'); // create the connection const conn = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); conn .promise() .query('SELECT 1') .then(([rows, fields]) => { console.log(rows); }) .catch(console.log) .then(() => conn.end());","s":"Using Promise Wrapper","u":"/node-mysql2/docs","h":"#using-promise-wrapper","p":110},{"i":123,"t":"If you have two columns with the same name, you might want to get results as an array rather than an object to prevent them from clashing. This is a deviation from the Node MySQL library. For example: SELECT 1 AS `foo`, 2 AS `foo`. You can enable this setting at either the connection level (applies to all queries), or at the query level (applies only to that specific query). Connection Level​ Promise Callback const conn = await mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); const conn = mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); Query Level​ Promise Callback try { const [results, fields] = await conn.query({ sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }); console.log(results); // in this query, results will be an array of arrays rather than an array of objects console.log(fields); // fields are unchanged } catch (err) { console.log(err); } conn.query( { sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }, function (err, results, fields) { console.log(results); // in this query, results will be an array of arrays rather than an array of objects console.log(fields); // fields are unchanged } ); Getting Help Need help? Ask your question on Stack Overflow or GitHub. If you've encountered an issue, please file it on GitHub.","s":"Array Results","u":"/node-mysql2/docs","h":"#array-results","p":110},{"i":125,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createConnection","u":"/node-mysql2/docs/examples/connections/create-connection","h":"","p":124},{"i":127,"t":"createConnection(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(connectionUri)","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":124},{"i":129,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config)","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":124},{"i":131,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config) — SHA1","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":124},{"i":133,"t":"createConnection(config: ConnectionOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); connection.addListener('error', (err) => { console.log(err); }); See ssl/certs.","s":"createConnection(config) — SSL","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":124},{"i":135,"t":"createConnection(config: ConnectionOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await connection.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); connection.addListener('error', (err) => { console.log(err); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { connection.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); });","s":"createConnection(config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":124},{"i":137,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#related-links","p":124},{"i":139,"t":"createConnection(config: ConnectionOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const connection = mysql.createConnection({ stream: socksProxy, }); connection.addListener('error', (err) => { console.log(err); }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const connection = mysql.createConnection({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); connection.addListener('error', (err) => { console.log(err); }); Testing connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createConnection(config) — Socks","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":124},{"i":142,"t":"ConnectionOptions Specification","s":"ConnectionOptions","u":"/node-mysql2/docs/examples/connections/create-connection","h":"#connectionoptions","p":124},{"i":144,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. See detailed documentaion in Prepared Statements. tip If you execute same statement again, it will be picked form a LRU cache which will save query preparation time and give better performance. Usage examples: INSERT SELECT UPDATE DELETE","s":"Prepared Statements","u":"/node-mysql2/docs/examples/queries/prepared-statements","h":"","p":143},{"i":146,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPool","u":"/node-mysql2/docs/examples/connections/create-pool","h":"","p":145},{"i":148,"t":"createPool(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(connectionUri)","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":145},{"i":150,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config)","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig","p":145},{"i":152,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SHA1","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":145},{"i":154,"t":"createPool(config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SSL","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":145},{"i":156,"t":"createPool(config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await pool.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { pool.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); warning Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":145},{"i":158,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#related-links","p":145},{"i":160,"t":"createPool(config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const pool = mysql.createPool({ stream: socksProxy, }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); Testing pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createPool(config) — Socks","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":145},{"i":163,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/docs/examples/connections/create-pool","h":"#pooloptions","p":145},{"i":166,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":164},{"i":168,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":164},{"i":170,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":164},{"i":173,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":164},{"i":175,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":164},{"i":178,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute(sql, values); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute(sql, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":176},{"i":180,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute({ sql, values, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, values, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":176},{"i":182,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, // ... other options }, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":176},{"i":185,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":176},{"i":187,"t":"info For Prepared Statements or Placeholders / Parameters examples, please see here. Usage examples: INSERT SELECT UPDATE DELETE","s":"Simple Queries","u":"/node-mysql2/docs/examples/queries/simple-queries","h":"","p":186},{"i":189,"t":"The examples below also work for the execute method.","s":"DELETE","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"","p":188},{"i":191,"t":"query(sql: string) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#querysql","p":188},{"i":193,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":188},{"i":196,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":188},{"i":198,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":188},{"i":200,"t":"await.js co.js .babelrc package.json 'use strict'; const mysql = require('mysql2/promise'); async function test() { const c = await mysql.createConnection({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log('connected!'); const [rows, fields] = await c.query('show databases'); console.log(rows); try { const [rows, fields] = await c.query('some invalid sql here'); } catch (e) { console.log('caught exception!', e); } console.log(await c.execute('select sleep(0.5)')); console.log('after first sleep'); console.log(await c.execute('select sleep(0.5)')); console.log('after second sleep'); let start = +new Date(); console.log( await Promise.all([ c.execute('select sleep(2.5)'), c.execute('select sleep(2.5)'), ]) ); console.log( 'after 2+3 parallel sleep which is in fact not parallel because commands are queued per connection' ); let end = +new Date(); console.log(end - start); await c.end(); const p = mysql.createPool({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log(await p.execute('select sleep(0.5)')); console.log('after first pool sleep'); start = +new Date(); console.log( await Promise.all([ p.execute('select sleep(2.5)'), p.execute('select sleep(2.5)'), ]) ); console.log('after 2+3 parallel pool sleep'); end = +new Date(); console.log(end - start); await p.end(); } test() .then(() => { console.log('done'); }) .catch((err) => { console.log('error!', err); throw err; }); 'use strict'; const mysql = require('mysql2/promise'); const co = require('co'); co(function* () { const c = yield mysql.createConnection({ port: 3306, user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }) .then(function () { console.log('done'); }) .catch(function (err) { console.log(err); throw err; }); { \"plugins\": [\"transform-async-to-generator\"] } { \"name\": \"promise-co-await\", \"version\": \"1.0.0\", \"description\": \"\", \"main\": \"await.js\", \"scripts\": { \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\" }, \"author\": \"\", \"license\": \"ISC\", \"dependencies\": { \"babel-cli\": \"^6.9.0\" } }","s":"await — co","u":"/node-mysql2/docs/examples/promise-wrapper/co-await","h":"","p":199},{"i":202,"t":"The examples below also work for the execute method.","s":"SELECT","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"","p":201},{"i":204,"t":"query(sql: string) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query(sql); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query(sql, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#querysql","p":201},{"i":206,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":201},{"i":208,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, rowsAsArray: true, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, rowsAsArray: true, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server as array fields contains extra meta data about rows, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options) — Row as Array","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":201},{"i":211,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":201},{"i":213,"t":"The examples below also work for the execute method.","s":"INSERT","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"","p":212},{"i":215,"t":"query(sql: string) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#querysql","p":212},{"i":217,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":212},{"i":220,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":212},{"i":222,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":212},{"i":225,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":223},{"i":227,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":223},{"i":229,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":223},{"i":232,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":223},{"i":234,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":223},{"i":236,"t":"index.js 'use strict'; const pool = require('mysql2').createPool({ host: 'localhost', user: 'root', database: 'test', password: 'root', }); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.query((err, rows, fields) => { console.log(rows, fields); // Connection is automatically released once query resolves }); } }, 1000); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.getConnection((err, db) => { db.query('select sleep(0.5) as qqq', (err, rows, fields) => { console.log(rows, fields); db.release(); }); }); } }, 1000);","s":"Pool","u":"/node-mysql2/docs/examples/tests/pool","h":"","p":235},{"i":238,"t":"info For queries please see the Simple Queries and Prepared Statements examples.","s":"createPoolCluster","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"","p":237},{"i":240,"t":"add(group: string, connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, connectionUri)","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":237},{"i":242,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config)","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":237},{"i":244,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SHA1","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":237},{"i":246,"t":"add(group: string, config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SSL","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":237},{"i":248,"t":"add(group: string, config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await poolCluster.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { poolCluster.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); warning Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — RDS SSL","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":237},{"i":250,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#related-links","p":237},{"i":252,"t":"add(group: string, config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { stream: socksProxy, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); Testing poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"add(group, config) — Socks","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":237},{"i":255,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":237},{"i":257,"t":"index.js 'use strict'; const mysql = require('mysql2'); const flags = require('mysql2/lib/constants/client.js'); const auth = require('mysql2/lib/auth_41.js'); function authenticate(params, cb) { console.log(params); const doubleSha = auth.doubleSha1('pass123'); const isValid = auth.verifyToken( params.authPluginData1, params.authPluginData2, params.authToken, doubleSha ); if (isValid) { cb(null); } else { // for list of codes lib/constants/errors.js cb(null, { message: 'wrong password dude', code: 1045 }); } } const server = mysql.createServer(); server.listen(3333); server.on('connection', (conn) => { // we can deny connection here: // conn.writeError({ message: 'secret', code: 123 }); // conn.close(); conn.serverHandshake({ protocolVersion: 10, serverVersion: '5.6.10', // 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, // capabilityFlags: 0xffffff, // capabilityFlags: -2113931265, capabilityFlags: 2181036031, authCallback: authenticate, }); conn.on('field_list', (table, fields) => { console.log('FIELD LIST:', table, fields); conn.writeEof(); }); conn.on('query', (query) => { conn.writeColumns([ { catalog: 'def', schema: 'test', table: 'test_table', orgTable: 'test_table', name: 'beta', orgName: 'beta', characterSet: 33, columnLength: 384, columnType: 253, flags: 0, decimals: 0, }, ]); conn.writeTextRow(['test тест テスト փորձարկում পরীক্ষা kiểm tra ']); conn.writeTextRow(['ტესტი પરીક્ષણ מבחן פּרובירן اختبار परीक्षण']); conn.writeEof(); conn.close(); }); });","s":"Server","u":"/node-mysql2/docs/examples/tests/server","h":"","p":256},{"i":259,"t":"index.js 'use strict'; const mysql = require('mysql2'); const ClientFlags = require('mysql2/lib/constants/client.js'); const server = mysql.createServer(); server.listen(3307); server.on('connection', (conn) => { console.log('connection'); conn.serverHandshake({ protocolVersion: 10, serverVersion: 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, capabilityFlags: 0xffffff ^ ClientFlags.COMPRESS, }); conn.on('field_list', (table, fields) => { console.log('field list:', table, fields); conn.writeEof(); }); const remote = mysql.createConnection({ user: 'root', database: 'dbname', host: 'server.example.com', password: 'secret', }); conn.on('query', (sql) => { console.log(`proxying query: ${sql}`); remote.query(sql, function (err) { // overloaded args, either (err, result :object) // or (err, rows :array, columns :array) if (Array.isArray(arguments[1])) { // response to a 'select', 'show' or similar const rows = arguments[1], columns = arguments[2]; console.log('rows', rows); console.log('columns', columns); conn.writeTextResult(rows, columns); } else { // response to an 'insert', 'update' or 'delete' const result = arguments[1]; console.log('result', result); conn.writeOk(result); } }); }); conn.on('end', remote.end.bind(remote)); });","s":"MySQL Proxy","u":"/node-mysql2/docs/examples/tests/mysql-proxy","h":"","p":258},{"i":261,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user.id); console.log('name:', user.name); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet","u":"/node-mysql2/docs/examples/typescript/procedure-call/index","h":"","p":260},{"i":263,"t":"The examples below also work for the execute method.","s":"UPDATE","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"","p":262},{"i":265,"t":"query(sql: string) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#querysql","p":262},{"i":267,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":262},{"i":270,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":262},{"i":272,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":262},{"i":274,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet","u":"/node-mysql2/docs/examples/typescript/row-data/index","h":"","p":273},{"i":277,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":275},{"i":279,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":275},{"i":281,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available info The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":275},{"i":284,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":275},{"i":286,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":275},{"i":288,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements)","u":"/node-mysql2/docs/examples/typescript/row-data/multi-statements","h":"","p":287},{"i":290,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Row as Array)","u":"/node-mysql2/docs/examples/typescript/row-data/row-as-array","h":"","p":289},{"i":292,"t":"MySQL2 project is a continuation of MySQL-Native. Protocol parser code was rewritten from scratch and api changed to match popular Node MySQL. MySQL2 team is working together with Node MySQL team to factor out shared code and move it under mysqljs organization. MySQL2 is mostly API compatible with Node MySQL and supports majority of features. MySQL2 also offers these additional features: Faster / Better Performance Prepared Statements MySQL Binary Log Protocol MySQL Server Extended support for Encoding and Collation Promise Wrapper Compression SSL and Authentication Switch Custom Streams Pooling","s":"History and Why MySQL2","u":"/node-mysql2/docs/history-and-why-mysq2","h":"","p":291},{"i":294,"t":"This section provides answers to commonly asked questions about MySQL2. tip To explore the FAQs, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Frequently Asked Questions","u":"/node-mysql2/docs/faq","h":"","p":293},{"i":296,"t":"The Stability Badges are indications of a section's stability. The stability indices are as follows: 0Deprecated The feature might generate warnings and does not assure backward compatibility. Experimental: These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged. Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features. Experimental features are classified into stages: 1Experimental Experimental features at this stage are currently in development and prone to considerable changes. 1.1Early Development Experimental features at this stage are approaching minimum viability. 1.2Release Candidate Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification. 2Stable Compatibility with the MySQL ecosystem is a high priority. 3Legacy This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available. Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed.","s":"Stability Badges","u":"/node-mysql2/docs/stability-badges","h":"","p":295},{"i":298,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/docs/examples/typescript/procedure-call/row-as-array","h":"","p":297},{"i":300,"t":"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.","s":"How to handle errors?","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"","p":299},{"i":302,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors by adding an error event listener: const mysql = require('mysql2'); connection = mysql.createConnection({ host: '', user: '', database: '', }); connection.addListener('error', (err) => { if (err instanceof Error) { console.log(`createConnection error:`, err); } }); createPool 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const pool = mysql.createPool({ host: '', user: '', database: '', }); pool.getConnection((err, connection) => { if (err instanceof Error) { console.log('pool.getConnection error:', err); return; } }); createPoolCluster 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); poolCluster.getConnection('NodeI', (err, connection) => { if (err instanceof Error) { console.log('poolCluster.getConnection error:', err); return; } }); execute 2Stable This solution has been tested. Handling execute errors through callback's err parameter: connection.execute('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('execute error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through callback's err parameter: connection.query('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('query error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using callbacks","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":299},{"i":304,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: '', user: '', database: '', }); } catch (err) { if (err instanceof Error) { console.log(err); } } createPool 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const pool = mysql.createPool({ host: '', user: '', database: '', }); try { const connection = await pool.getConnection(); } catch (err) { if (err instanceof Error) { console.log(err); } } createPoolCluster 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); try { await poolCluster.getConnection('NodeI'); } catch (err) { if (err instanceof Error) { console.log('createConnection error:', err); } } execute 2Stable This solution has been tested. Handling execute errors through try-catch block: try { const [rows] = await connection.execute('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('execute error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through try-catch block: try { const [rows] = await connection.query('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('query error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using promises","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#using-promises","p":299},{"i":306,"t":"Discussions #1998 #2282","s":"Related Links","u":"/node-mysql2/docs/faq/how-to-handle-errors","h":"#related-links","p":299},{"i":308,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/docs/examples/typescript/row-data/row-as-array-multi-statements","h":"","p":307},{"i":310,"t":"index.ts db.ts /** * The types are explicity for learning purpose */ import { PoolOptions } from 'mysql2/promise'; import { MySQL } from './db.js'; interface User extends RowDataPacket { id: number; name: string; } const access: PoolOptions = { host: '', user: '', password: '', database: '', }; (async () => { const mysql = new MySQL(access); /** Deleting the `users` table, if it exists */ await mysql.queryResult('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await mysql.queryResult( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await mysql.executeResult( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await mysql.queryRows( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user: User) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await mysql.connection.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */ /** * The types are explicity for learning purpose */ import { createPool, PoolOptions, Pool, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; export class MySQL { private conn: Pool; private credentials: PoolOptions; constructor(credentials: PoolOptions) { this.credentials = credentials; this.conn = createPool(this.credentials); } /** A random method to simulate a step before to get the class methods */ private ensureConnection() { if (!this?.conn) this.conn = createPool(this.credentials); } /** For `SELECT` and `SHOW` */ get queryRows() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get queryRowsAsArray() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get queryResult() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get queryResults() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` */ get executeRows() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get executeRowsAsArray() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get executeResult() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get executeResults() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** Expose the Pool Connection */ get connection() { return this.conn; } }","s":"Basic Custom Class","u":"/node-mysql2/docs/examples/typescript/basic-custom-class","h":"","p":309}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/2",[0,4.512,1,3.687,2,5.936,3,5.936,4,1.437,5,4.837,6,5.936,7,1.871,8,3.687,9,5.936,10,2.61,11,5.936,12,4.837,13,5.936,14,3.687,15,3.087,16,5.274,17,4.295,18,4.837,19,5.936,20,5.936,21,1.492,22,0.537,23,4.512,24,3.849,25,4.251,26,3.687,27,5.274,28,3.187,29,5.936]],["t/4",[30,5.779,31,6.3,32,6.3,33,2.83,34,3.041,35,4.599,36,7.092,37,3.2,38,7.092,39,5.079]],["t/6",[4,1.495,14,4.826,24,3.457,26,3.312,33,2.127,34,2.286,40,4.737,41,4.345,42,4.345,43,6.902,44,4.345,45,1.786,46,1.558,47,1.903,48,5.332,49,2.773,50,4.737,51,1.862,52,4.737,53,5.332,54,2.032,55,4.737,56,5.332,57,4.737,58,4.345,59,5.332,60,4.737,61,5.332,62,4.737,63,2.539,64,4.737,65,5.332,66,1.75,67,5.332,68,6.194,69,4.345,70,3.312,71,5.332,72,3.819,73,4.737,74,5.332]],["t/8",[0,1.662,17,1.257,21,1.058,22,0.834,24,1.418,28,2.456,45,0.733,46,1.307,54,2.534,69,2.928,75,2.187,76,2.187,77,1.542,78,1.782,79,3.476,80,2.187,81,4.316,82,1.204,83,4.064,84,2.73,85,1.96,86,1.813,87,0.853,88,3.727,89,2.94,90,1.179,91,2.187,92,2.573,93,5.658,94,4.191,95,1.943,96,3.727,97,2.187,98,2.187,99,2.372,100,1.943,101,2.187,102,4.574,103,4.026,104,6.647,105,1.662,106,1.358,107,3.192,108,1.943,109,2.187,110,2.187,111,2.187,112,0.583,113,1.214,114,1.782,115,1.633,116,2.187,117,0.748,118,2.187,119,4.574,120,2.187,121,0.877,122,1.468,123,1.401,124,0.849,125,3.192,126,2.39,127,1.132,128,1.155,129,3.192,130,2.187,131,2.187,132,4.506,133,3.593,134,3.192,135,4.064,136,2.928,137,1.782,138,1.782,139,3.593,140,3.593,141,3.593,142,1.662,143,4.574,144,3.593,145,1.418,146,1.566,147,1.566,148,2.187,149,2.731,150,5.297,151,1.782,152,2.187,153,2.187,154,2.187,155,1.943,156,2.187,157,1.782,158,2.187,159,1.782,160,0.471,161,1.174,162,1.782,163,2.187,164,2.187,165,0.938,166,2.187,167,1.782,168,1.257,169,3.593,170,1.662,171,1.943,172,1.662,173,1.358,174,1.358,175,1.662,176,2.187,177,2.187,178,1.943,179,2.33,180,1.486,181,2.187,182,1.566,183,1.943,184,1.943,185,1.943]],["t/10",[21,0.743,22,0.85,28,1.998,46,1.752,54,2.989,77,1.083,79,2.828,81,5.232,83,3.306,84,2.221,85,1.247,88,3.033,90,1.221,92,5.056,93,4.429,94,3.892,96,3.033,99,1.939,106,3.375,112,0.603,121,0.558,122,1.52,123,1.451,124,1.284,125,3.306,126,2.897,128,1.197,129,3.306,167,3.033,170,2.828,179,2.413,182,3.892,183,3.306,184,3.306,186,3.721,187,5.704,188,3.721,189,3.033,190,3.721,191,3.721,192,1.451,193,3.306,194,1.877,195,1.52,196,6.42,197,6.42,198,3.033,199,3.721,200,3.721,201,3.721,202,3.721,203,5.435,204,3.721,205,7.842,206,3.721,207,3.721,208,3.721,209,3.721,210,3.721]],["t/12",[1,3.398,4,1.659,10,2.406,14,4.886,15,2.845,23,4.158,24,3.548,28,2.937,33,2.829,34,2.346,43,4.86,63,2.605,68,4.86,69,4.458,70,3.398,77,1.593,79,4.158,92,3.918,106,3.398,113,3.037,168,3.146,174,3.398,211,5.471,212,4.458,213,5.471,214,4.458,215,4.86,216,3.918,217,3.918,218,3.918,219,5.389,220,2.605,221,2.535,222,4.458,223,3.719,224,4.158,225,4.458]],["t/14",[33,2.981,34,3.204,35,4.845,117,2.555]],["t/16",[22,0.664,25,5.256,35,3.743,44,4.704,46,1.29,47,2.619,49,3.817,62,5.128,84,3.445,85,2.458,95,5.128,149,4.387,165,2.475,174,3.585,226,7.339,227,5.772,228,4.074,229,5.772,230,3.924,231,5.772,232,5.128,233,3.743,234,1.586,235,5.772,236,5.772,237,5.128,238,5.772,239,5.772,240,5.128,241,5.772]],["t/18",[1,4.681,4,1.659,14,5.11,27,5.35,28,4.417,41,4.907,77,1.753,220,2.868,221,2.79,242,6.021,243,4.576,244,5.35,245,4.093,246,4.907,247,6.142,248,6.021,249,6.021,250,7.537,251,7.537,252,6.021]],["t/20",[4,1.342,14,4.331,117,2.385,253,6.974,254,4.995,255,6.716,256,8.773,257,1.844,258,6.196]],["t/23",[1,2,4,0.62,8,3.66,22,0.869,28,1.729,45,2.203,46,0.72,77,0.938,84,1.922,85,1.079,86,1.625,87,1.256,90,2.158,108,2.861,112,0.791,160,1.415,165,1.381,179,3.165,180,4.006,194,1.625,195,1.994,218,2.307,220,1.534,221,1.492,232,2.861,259,4.997,260,2.625,261,3.221,262,5.893,263,3.221,264,2.625,265,1.922,266,4.336,267,3.031,268,2.189,269,3.221,270,3.977,271,7.956,272,4.881,273,8.146,274,2.506,275,1.381,276,2.319,277,2.398,278,1.421,279,3.221,280,4.336,281,0.939,282,2.861]],["t/25",[7,1.819,22,0.853,45,2.844,51,2.564,85,1.934,121,0.865,160,1.242,165,2.475,267,4.558,277,2.105,283,5.772,284,4.387,285,3.743,286,5.772,287,5.128,288,2.333,289,5.128,290,4.387,291,5.772]],["t/27",[4,0.608,7,1.835,8,2.988,21,0.961,22,0.84,39,2.263,41,2.575,46,1.301,54,1.833,77,0.92,85,1.951,86,2.427,99,2.323,100,5.785,106,1.963,112,0.512,115,1.248,121,1.05,123,1.232,124,0.747,127,2.208,128,1.016,132,2.263,136,3.92,138,2.575,161,1.696,173,1.963,174,1.963,182,2.263,195,1.291,281,1.121,282,2.807,288,1.322,292,7.027,293,4.81,294,5.61,295,3.777,296,7.381,297,3.16,298,1.886,299,6.557,300,3.16,301,6.511,302,2.807,303,1.696,304,2.263,305,3.476,306,5.825,307,2.774,308,4.81,309,2.871,310,4.274,311,3.16,312,3.16,313,3.16,314,3.16,315,2.402,316,3.16,317,1.104,318,3.16,319,3.16,320,2.807,321,2.807,322,3.16,323,3.16,324,3.16]],["t/29",[4,1.046,10,2.823,21,1.5,22,0.832,51,1.3,54,2.447,85,1.247,106,2.311,112,1.041,117,1.273,121,1.244,123,1.451,124,1.284,126,2.897,127,2.023,128,1.747,146,2.665,157,3.033,159,3.033,161,3.447,182,2.665,217,2.665,230,2.529,280,3.306,284,2.828,295,4.869,317,1.898,325,3.306,326,3.721,327,3.721,328,3.721,329,3.721,330,3.721,331,2.413,332,3.721,333,3.721,334,3.721,335,3.721,336,2.14,337,3.721,338,5.435,339,3.033,340,3.721,341,4.828,342,4.13,343,2.828,344,1.998,345,3.306,346,5.435,347,2.119,348,3.721,349,3.125,350,2.311,351,2.14,352,3.721,353,1.387,354,1.357,355,3.306,356,3.721,357,2.828,358,3.306,359,3.721,360,1.357]],["t/32",[22,0.626,57,6.144,77,2.014,265,4.128,349,3.976,361,6.916,362,3.205,363,4.953,364,6.916,365,5.256,366,6.916,367,6.916,368,6.916]],["t/34",[21,1.714,161,4.011,369,7.471]],["t/36",[1,3.059,22,0.676,28,3.551,39,3.527,45,1.65,51,2.311,77,1.434,132,3.527,135,5.877,136,6.087,145,3.193,224,3.743,265,2.939,267,3.059,276,2.171,281,0.948,288,2.052,305,2.939,365,3.743,370,4.924,371,4.013,372,4.013,373,4.013,374,5.39,375,4.013,376,4.013,377,4.924,378,7.094,379,4.924,380,3.527,381,4.924,382,3.347,383,6.615,384,3.347,385,4.375,386,4.924,387,6.615,388,4.924,389,7.469,390,4.375,391,4.924,392,4.924,393,4.924,394,4.924]],["t/38",[8,3.023,17,2.798,21,0.972,28,2.613,34,2.087,42,3.966,46,1.775,47,2.836,49,2.531,77,1.911,96,5.348,106,3.023,147,3.486,178,4.324,288,1.337,365,4.988,378,7.371,380,5.692,385,5.83,395,6.563,396,5.348,397,4.867,398,4.867,399,4.324,400,4.867,401,4.867,402,4.867,403,4.867,404,4.867,405,4.867,406,4.867,407,4.867,408,5.942,409,3.308,410,4.867,411,3.486,412,4.867,413,4.867,414,4.867,415,4.867,416,4.867]],["t/40",[18,5.829,24,4.638,106,4.442,113,3.97,222,5.829,417,7.152,418,4.269,419,7.152,420,5.829]],["t/42",[4,1.239,8,2.938,10,2.83,21,0.945,22,0.866,46,1.057,113,2.625,115,1.227,121,1.097,137,3.854,180,4.375,265,2.823,281,0.91,284,4.892,288,1.3,345,5.718,353,2.399,421,4.202,422,4.73,423,4.73,424,3.854,425,4.73,426,3.387,427,6.437,428,5.718,429,4.202,430,4.73,431,4.73,432,4.73,433,4.73,434,4.73,435,4.61,436,4.202,437,4.73,438,4.73,439,1.16,440,4.202]],["t/44",[4,1.268,10,2.153,22,0.847,52,4.349,54,2.511,121,1.246,122,2,123,1.909,127,2.076,128,2.118,194,2.47,275,2.825,276,1.607,278,1.425,288,1.345,336,2.815,344,2.628,424,5.369,441,3.788,442,4.895,443,1.857,444,4.349,445,3.041,446,4.895,447,4.349,448,4.349,449,5.853,450,4.349,451,5.853,452,4.895,453,4.895,454,4.895,455,4.349]],["t/46",[4,1.067,22,0.842,114,6.451,117,1.896,121,1.254,124,1.31,128,1.782,165,2.377,260,4.517,276,1.819,290,4.213,317,1.936,331,3.595,443,1.238,456,6.353,457,4.925,458,4.925,459,5.543,460,2.883,461,4.925,462,2.569,463,4.925,464,4.925,465,4.925,466,3.595,467,4.925,468,4.925,469,5.543]],["t/48",[112,1.16,194,3.608,470,6.817,471,7.152,472,5.829,473,7.152,474,7.152,475,5.436]],["t/50",[230,4.946,245,4.946,258,6.465,476,7.277,477,5.53,478,7.277,479,7.277]],["t/52",[14,3.572,22,0.364,33,2.678,34,2.466,39,5.244,63,1.917,64,3.576,77,1.675,85,1.927,117,1.377,161,2.161,174,2.5,193,3.576,243,4.372,254,5.244,255,5.469,289,3.576,292,5.962,294,3.059,299,3.576,362,1.865,460,2.991,470,6.564,472,3.28,475,3.059,477,4.372,480,5.752,481,5.752,482,4.025,483,4.025,484,5.752,485,5.752,486,4.025,487,4.025,488,5.752,489,4.025,490,5.752,491,4.025,492,4.025,493,4.025,494,5.11,495,3.576,496,4.025,497,3.576,498,2.61,499,4.025,500,4.025,501,3.576,502,4.025,503,4.025,504,3.576,505,2.61,506,3.576,507,5.752,508,4.025,509,4.025,510,4.025,511,4.025,512,4.025,513,4.025,514,3.059,515,4.025,516,4.025,517,4.025,518,4.025,519,3.576,520,3.576,521,3.28]],["t/54",[112,0.962,219,4.512,228,3.295,243,4.512,294,4.512,362,2.751,472,4.837,504,5.274,514,4.512,522,2.314,523,5.854,524,5.936,525,5.274,526,7.262,527,5.274,528,5.274,529,6.087,530,5.936,531,5.936,532,6.636,533,5.274,534,5.936,535,5.936,536,5.274,537,5.936,538,3.687,539,5.936]],["t/56",[22,0.805,49,2.922,85,1.882,117,1.921,173,5.221,234,1.544,307,2.675,390,4.991,498,5.867,523,5.166,529,4.578,540,6.389,541,5.618,542,4.578,543,5.618,544,5.618,545,5.618,546,4.991,547,5.878,548,3.489,549,4.578,550,5.618]],["t/58",[22,0.77,63,2.768,85,1.947,117,1.988,194,2.932,223,3.951,234,1.597,274,1.726,275,2.493,315,4.418,360,2.12,523,4.163,529,4.737,547,6.597,548,3.61,549,4.737,551,7.563,552,5.164,553,5.813,554,5.813,555,7.371,556,5.813,557,3.023,558,5.813,559,5.813,560,4.399]],["t/60",[17,3.487,22,0.747,26,3.767,112,0.983,117,2.074,234,1.666,310,5.388,514,5.754,523,5.422,526,6.726,532,6.726,536,5.388,548,3.767,549,4.943,561,7.904,562,6.065,563,6.065,564,4.122,565,2.737,566,4.943]],["t/62",[22,0.805,117,2.254,234,1.811,567,8.564,568,6.59,569,6.59,570,6.59,571,6.59,572,6.59,573,6.59,574,6.59,575,6.59,576,6.59,577,6.59]],["t/64",[35,4.815,50,7.06,70,4.076,72,3.486,115,1.263,127,1.534,214,6.476,228,2.702,254,6.122,255,6.966,278,1.417,362,2.255,380,3.486,421,5.83,470,3.966,514,3.699,523,3.486,578,6.563,579,6.563,580,4.867,581,4.867,582,7.947,583,7.947,584,4.324,585,4.867,586,4.867,587,6.563,588,6.563,589,6.563,590,4.324,591,4.867,592,4.324,593,4.867]],["t/67",[0,3.515,22,0.871,51,2.848,58,3.769,103,3.515,112,0.75,147,3.313,160,0.996,168,2.659,174,2.873,189,3.769,216,3.313,220,3.019,221,3.352,270,3.769,274,2.31,276,2.08,277,2.312,305,2.76,409,3.144,435,3.313,594,4.109,595,4.625,596,4.625,597,4.625,598,5.838,599,4.625,600,4.109,601,2.483,602,3.515,603,4.109,604,4.625]],["t/69",[1,2.512,21,1.344,22,0.856,42,3.296,49,2.103,51,2.016,88,3.296,112,1.19,127,1.819,145,2.623,160,1.242,161,2.171,174,3.585,194,2.04,220,2.749,221,3.739,230,2.749,233,2.623,267,3.585,268,2.749,275,2.475,276,1.327,315,3.074,355,3.593,409,3.923,505,3.743,598,2.897,603,5.128,605,3.593,606,3.593,607,3.074,608,5.772,609,4.045,610,4.045,611,5.484,612,5.772,613,4.045,614,4.045,615,4.045,616,4.045,617,3.593,618,4.045,619,4.045,620,4.045,621,4.045,622,2.103,623,4.045,624,2.414,625,4.045,626,4.045,627,4.045,628,3.593,629,2.512]],["t/71",[22,0.606,85,2.243,112,1.086,171,5.948,212,5.456,221,3.727,408,4.795,409,4.551,598,6.175,607,5.088,630,6.695,631,6.695,632,6.695,633,6.695]],["t/73",[4,1.074,8,3.466,22,0.828,45,1.869,49,2.902,51,1.949,54,2.127,87,2.8,107,4.958,115,1.448,165,2.393,237,6.38,247,4.547,274,1.657,278,1.625,399,4.958,521,4.547,557,2.902,634,5.58,635,4.958,636,6.38,637,5.58,638,5.58,639,4.241,640,5.58,641,4.958,642,5.58,643,7.182,644,7.182,645,5.58]],["t/75",[22,0.859,33,1.722,82,1.446,160,1.501,194,4.011,195,1.763,220,3.32,221,2.8,233,2.798,274,2.361,276,2.704,277,2.542,278,1.256,281,0.83,288,2.264,439,1.71,466,4.898,600,3.834,601,3.743,636,6.194,646,3.517,647,4.924,648,7.553,649,7.553]],["t/77",[34,3.148,63,3.496,117,2.511,220,3.496,221,3.401,505,4.76]],["t/79",[34,2.99,112,1.131,117,2.385,303,3.744,548,4.331,650,4.995,651,6.196,652,6.196,653,6.196,654,6.196,655,6.196,656,6.196]],["t/81",[4,1.754,7,1.832,21,1.473,28,3.957,77,2.357,112,1.195,341,7.191,527,5.164,635,5.164,657,5.813,658,5.813,659,5.813,660,5.813,661,5.813,662,7.371,663,5.813,664,5.813,665,7.371,666,5.813,667,5.813,668,5.813]],["t/83",[4,1.283,7,1.57,22,0.839,25,3.569,112,0.808,121,1.126,126,2.248,132,3.569,147,3.569,274,1.98,288,1.369,309,2.974,317,1.741,347,2.599,349,2.865,426,3.569,448,5.923,557,2.591,566,4.061,669,3.787,670,3.569,671,4.983,672,4.983,673,4.983,674,4.983,675,4.983,676,4.427,677,7.514,678,3.231,679,4.061,680,4.983,681,4.983,682,4.983,683,4.983,684,4.983,685,4.983,686,4.983,687,4.983,688,4.983,689,4.983,690,4.983]],["t/86",[33,3.048,66,2.02,112,0.998,182,4.408,185,5.467,245,4.183,254,5.472,295,3.991,325,5.467,396,5.015,477,5.807,691,5.807,692,5.467,693,6.788,694,6.154,695,6.154,696,6.154,697,6.226,698,6.154,699,4.677,700,4.408,701,6.154]],["t/88",[4,1.672,22,0.691,33,3.315,85,2.559,86,3.854,165,2.639,234,2.455,639,4.677,702,5.467,703,5.467,704,7.64,705,7.64,706,2.726]],["t/90",[4,1.258,22,0.836,33,2.609,121,1.189,122,2.671,124,1.545,127,2.499,128,2.102,234,1.797,303,3.51,707,3.884,708,4.24]],["t/92",[4,1.258,22,0.836,33,2.609,121,1.189,122,2.671,124,1.545,127,2.499,128,2.102,234,1.797,303,3.51,709,4,710,6.538]],["t/94",[22,0.872,35,3.29,117,1.735,127,2.547,170,3.856,228,3.746,230,3.448,233,3.29,274,2.399,275,2.894,276,2.761,281,0.976,428,4.507,444,4.507,711,3.634,712,4.587,713,4.191,714,3.623,715,2.126,716,3.634]],["t/97",[4,0.991,22,0.881,33,2.055,46,0.773,85,1.159,112,0.561,117,1.183,121,0.772,122,2.104,123,2.008,124,1.217,127,2.738,128,1.656,165,2.209,234,1.415,267,2.149,274,2.024,275,2.923,276,2.726,277,2.244,285,3.34,307,2.453,462,3.158,560,2.065,678,3.34,712,4.633,714,2.765,717,3.46,718,5.151,719,3.46,720,3.46,721,2.065]],["t/99",[4,0.937,7,1.534,22,0.874,33,1.942,85,1.63,112,0.789,121,0.984,122,1.988,123,1.898,124,1.15,127,2.694,128,1.565,165,2.814,179,3.156,234,1.337,274,1.949,275,3.184,276,2.154,277,2.393,281,0.937,462,2.255,560,2.905,712,3.308,714,2.613,721,2.905,722,4.256,723,4.867]],["t/101",[4,0.843,7,1.381,22,0.846,33,1.749,34,2.619,51,2.134,66,1.438,85,1.468,86,2.211,112,0.99,121,0.916,122,1.79,123,1.709,124,1.036,127,1.925,128,1.409,142,4.642,172,4.642,173,2.722,234,1.204,268,4.152,274,1.814,275,1.88,382,4.152,384,2.979,498,2.842,540,3.331,557,4.159,560,2.616,602,4.642,700,3.139,712,2.979,715,2.215,724,3.572,725,3.894,726,4.642,727,2.992,728,4.375,729,1.978,730,2.147,731,2.031,732,3.894,733,4.383,734,1.834,735,3.139,736,3.139,737,3.139]],["t/103",[4,0.802,7,1.313,22,0.858,33,1.662,51,2.059,66,1.934,86,2.973,112,0.675,121,0.883,122,1.701,123,1.624,124,0.984,127,1.857,128,1.339,165,2.527,173,2.587,179,2.701,234,1.144,274,1.75,275,2.933,331,2.701,382,4.006,384,4.006,498,2.701,540,3.166,557,4.587,560,2.486,700,2.983,712,2.831,715,2.343,722,3.822,724,3.394,728,4.221,729,1.88,730,2.041,731,1.93,732,3.701,734,1.743,735,4.221,736,4.221,737,4.221,738,3.701,739,4.165]],["t/105",[4,0.689,7,1.128,22,0.849,33,1.428,34,1.534,46,1.18,51,2.192,63,1.704,66,1.174,86,3.166,103,4.77,112,0.856,117,1.224,121,0.792,122,1.462,123,1.395,124,0.845,127,1.664,128,1.151,151,2.916,165,1.534,168,3.036,173,2.222,179,2.32,212,2.916,234,0.983,274,1.568,275,2.691,277,1.305,281,1.016,304,2.563,362,2.447,382,2.432,384,2.432,408,2.563,498,2.32,540,2.72,548,2.222,557,3.843,560,2.136,678,2.32,700,2.563,712,2.432,714,1.921,715,2.437,716,4.495,722,2.32,724,2.916,728,2.563,729,1.615,730,1.753,734,1.497,735,2.563,736,2.563,737,2.563,738,3.179,740,6.302,741,3.578,742,3.578,743,3.578,744,2.136,745,6.276,746,2.916,747,2.916,748,3.578,749,3.578,750,5.28]],["t/107",[34,3.016,112,1.14,142,5.345,172,5.345,268,4.78,602,5.345,715,2.216,725,6.248,726,5.345,727,3.445,751,6.248]],["t/109",[12,4.345,17,3.065,33,2.782,35,5.038,112,1.449,117,1.824,339,4.345,362,2.471,418,5.235,697,4.345,714,4.709,715,2.197,716,4.994,722,4.521,752,5.332,753,5.332,754,5.332,755,4.869,756,6.902,757,5.332]],["t/111",[1,4.125,4,1.278,15,3.454,23,5.048,28,3.566,168,3.819,218,4.757,220,3.163,221,3.078,223,4.515,224,5.048,225,5.413,245,4.515,426,4.757,758,6.642,759,6.642,760,5.901,761,6.642]],["t/113",[5,4.907,33,3.283,63,2.868,70,3.74,117,2.06,240,5.35,243,4.576,247,4.907,254,5.892,477,6.553,497,5.35,501,5.35,505,3.905,691,6.253,692,5.35,693,5.35,697,6.142,762,6.021,763,6.021,764,6.021,765,6.021]],["t/115",[4,0.85,21,1.227,22,0.867,28,2.372,34,1.213,46,0.987,51,2.665,54,1.684,77,1.286,90,2.015,99,1.576,112,0.716,113,1.57,117,1.511,121,0.999,123,1.722,124,1.044,127,1.392,128,1.975,145,1.835,160,1.322,192,2.394,220,1.347,221,1.311,223,1.923,234,0.777,257,1.168,259,3.357,276,1.45,277,2.574,281,1.182,288,1.687,305,3.665,307,2.925,317,0.988,347,1.722,351,2.54,360,1.611,362,2.047,439,1.083,443,1.214,460,2.297,522,1.722,564,1.923,565,2.771,650,2.026,706,1.01,711,3.892,734,2.57,766,2.305,767,2.701,768,3.297,769,1.722,770,1.762,771,1.191]],["t/117",[0,3.23,4,1.013,7,0.849,21,1.194,22,0.843,33,1.695,34,1.822,35,1.746,46,0.949,51,2.528,54,1.026,77,1.237,82,0.902,90,1.394,99,1.516,103,3.23,113,1.495,117,1.453,121,0.896,123,1.657,124,1.004,127,1.339,128,1.922,145,1.746,160,0.915,168,2.443,180,2.888,192,2.33,195,1.1,198,2.194,216,3.043,220,3.905,221,3.476,223,1.83,233,1.746,234,1.168,257,0.712,259,2.047,265,2.536,276,1.394,277,1.55,278,1.74,281,1.252,288,1.642,290,3.23,307,2.024,317,0.941,347,1.657,351,2.443,360,1.55,362,1.969,439,0.66,443,0.949,460,2.21,522,1.657,548,1.672,564,1.83,598,1.928,601,2.281,605,2.392,607,2.047,622,1.4,646,2.194,647,3.463,650,1.928,691,2.047,706,0.961,734,1.778,766,2.194,767,1.869,769,1.657,770,1.695,771,0.726,772,2.693,773,2.693,774,2.392,775,2.693,776,2.693,777,2.693,778,4.249,779,4.249,780,4.249,781,2.392,782,2.392]],["t/119",[4,0.879,10,3.568,21,1.739,22,0.826,31,1.938,32,3.185,34,0.935,45,1.772,46,0.487,54,0.831,58,1.777,60,1.938,63,2.518,77,0.635,86,1.809,87,0.85,112,0.74,113,2.534,117,1.226,121,0.876,122,1.465,124,0.847,127,1.13,128,1.153,145,2.961,160,0.983,161,1.171,165,2.268,167,4.31,170,1.658,174,1.355,180,1.482,223,1.482,233,1.414,234,0.599,257,0.577,265,2.725,268,1.482,276,1.177,281,0.879,288,1.453,307,1.708,317,0.762,331,3.429,344,1.925,347,1.398,351,2.062,354,0.795,362,2.451,408,4.5,409,1.482,436,1.938,439,0.535,440,4.698,443,1.02,451,3.185,460,1.865,495,1.938,557,2.75,564,1.482,606,1.938,622,1.865,650,1.562,703,1.938,706,0.778,727,2.863,746,2.922,766,1.777,771,0.588,783,1.938,784,1.938,785,2.181,786,2.181,787,2.181,788,2.181,789,2.181,790,2.181,791,2.181,792,1.577,793,3.586,794,5.288,795,3.586,796,3.586,797,5.288,798,3.586,799,5.288,800,3.586,801,3.586,802,3.586,803,3.586,804,3.586,805,2.181,806,2.181,807,2.181,808,1.134,809,1.938,810,2.181,811,2.181,812,3.185,813,3.185,814,2.181,815,2.181,816,2.181,817,1.414,818,1.99,819,1.99,820,3.586,821,1.482,822,2.181,823,2.181]],["t/121",[4,1.12,10,2.796,16,2.282,21,1.474,22,0.853,24,1.666,28,1.379,30,2.093,33,2.537,54,2.219,87,1.002,90,1.343,112,1.031,113,4.626,121,1.14,122,1.672,123,1.99,124,1.375,127,1.834,128,2.285,218,1.84,234,1.599,265,1.533,274,1.215,276,1.675,277,1.493,281,0.982,287,2.282,288,1.599,307,1.949,317,0.897,344,1.379,347,2.27,351,3.347,358,3.637,360,0.937,362,2.946,363,1.84,408,1.84,420,3.336,426,1.84,429,2.282,441,2.934,443,1.513,445,1.596,460,3.027,462,1.19,601,2.198,624,1.533,628,2.282,679,2.093,706,1.461,744,1.533,767,1.8,824,2.569,825,2.569,826,2.569,827,3.637,828,4.094,829,4.094,830,2.569,831,6.358,832,2.569,833,2.569,834,2.569,835,2.569,836,2.569,837,2.569,838,2.569]],["t/123",[4,0.634,7,1.565,14,2.048,21,0.992,22,0.822,30,2.686,34,1.414,51,2.493,54,1.256,55,4.413,70,2.048,78,2.686,86,1.663,87,2.33,90,1.082,113,2.757,117,1.128,121,0.896,122,2.029,123,1.937,124,1.174,127,1.565,128,1.597,145,3.221,160,1.069,165,2.853,214,4.048,230,2.241,246,2.686,257,0.872,265,1.967,267,4.836,274,1.775,275,2.563,277,2.18,281,1.444,284,5.702,285,4.314,288,1.828,294,2.506,298,1.967,315,5.057,347,1.937,351,2.856,439,0.809,443,1.11,460,2.583,533,2.929,590,2.929,611,2.686,702,2.929,734,2.078,746,4.048,769,1.937,771,0.889,783,4.413,792,1.45,839,3.297,840,3.297,841,4.967,842,2.929,843,3.297,844,3.297,845,3.297,846,3.297]],["t/125",[34,3.067,63,3.406,66,2.347,117,2.446,220,3.406,221,3.314,281,1.61,711,5.122]],["t/127",[4,1.406,21,1.46,22,0.857,47,2.046,121,1.206,123,2.849,160,1.573,234,1.575,257,1.516,317,2.003,439,1.792,443,1.281,706,2.046,771,1.545,847,5.733,848,1.736,849,1.736,850,6.492,851,3.718]],["t/129",[4,1.283,21,1.332,22,0.862,121,1.126,123,2.599,124,1.575,126,3.009,127,2.101,128,2.144,160,1.435,234,1.369,257,1.318,317,1.741,347,2.599,349,3.833,350,4.141,351,3.833,439,1.635,443,1.113,460,3.467,706,1.778,707,2.441,771,1.343,848,1.509,849,1.509,851,3.231,852,3.569]],["t/131",[4,1.347,21,1.399,22,0.866,121,1.168,123,2.73,160,1.507,234,1.474,257,1.419,317,1.874,357,5.321,439,1.717,443,1.199,706,1.915,707,2.629,771,1.446,848,1.625,849,1.625,851,3.479,852,3.843,853,4.373,854,4.373,855,5.706,856,4.373]],["t/133",[4,1.224,15,3.309,21,1.271,22,0.869,63,2.215,89,3.532,121,1.087,123,2.481,160,1.37,234,1.278,257,1.23,317,1.625,439,1.561,443,1.039,706,1.66,707,2.278,771,1.254,848,1.408,849,1.408,851,3.016,852,3.331,857,3.79,858,5.552,859,6.356,860,5.186,861,3.798,862,3.798,863,5.186,864,3.79]],["t/135",[4,1.248,15,3.933,21,1.296,22,0.854,45,1.269,46,0.846,47,1.352,54,1.444,112,0.893,115,0.983,121,1.067,123,2.147,127,1.735,146,2.713,160,1.628,217,2.713,234,1.041,257,1.456,317,1.323,347,2.147,435,3.943,439,1.746,443,1.449,706,1.352,707,1.856,771,1.484,848,1.147,849,1.147,851,2.457,852,2.713,858,2.575,861,2.261,862,3.286,865,4.839,866,4.839,867,3.087,868,3.087,869,3.087,870,4.487,871,4.487,872,4.487,873,3.087,874,4.487,875,4.487,876,5.506,877,4.487,878,3.087,879,1.125]],["t/137",[15,3.224,17,3.565,22,0.754,26,3.851,70,3.851,72,4.44,94,4.44,105,4.712,363,4.44,699,4.712,730,3.76,861,4.581,862,3.7,865,5.217,866,5.217,880,5.052,881,5.052,882,5.052,883,5.052,884,5.052,885,5.052]],["t/139",[4,1.036,21,1.075,22,0.868,46,1.567,54,1.4,115,1.653,121,1.209,123,2.098,127,1.157,160,1.78,161,2.89,270,5.192,274,1.09,276,2.091,288,2.145,295,3.49,317,1.88,342,5.332,343,4.091,349,3.095,350,3.343,439,1.832,462,2.952,466,3.49,707,1.799,851,3.49,852,2.63,879,1.892,886,2.993,887,2.993,888,4.386,889,2.993,890,2.993,891,2.993,892,4.386]],["t/142",[707,3.727,792,3.345]],["t/144",[22,0.647,33,2.212,37,2.501,63,2.64,82,1.857,117,1.896,168,3.187,180,3.768,195,2.264,198,4.517,216,3.97,220,4.123,221,3.876,233,3.595,265,3.308,277,2.021,278,2.082,281,1.376,548,3.443,598,3.97,607,4.213,646,4.517,647,5.827,691,4.213,729,2.501,730,2.716,731,2.569,781,4.925,782,4.925,893,5.543,894,5.543,895,4.925]],["t/146",[34,3.067,63,3.406,66,2.347,117,2.446,220,3.406,221,3.314,281,1.61,711,5.122]],["t/148",[4,1.278,10,2.92,21,1.497,22,0.856,46,1.107,47,1.768,112,0.803,115,1.285,121,1.2,160,1.612,234,1.361,257,1.31,281,1.278,317,1.73,439,1.629,443,1.107,622,2.576,706,1.768,727,2.427,771,1.335,817,3.212,818,2.75,819,2.75,821,3.367,848,1.5,849,1.5,879,1.471,896,4.953,897,6.641,898,4.307,899,2.75,900,3.548]],["t/150",[4,1.158,10,2.647,21,1.389,22,0.863,46,0.959,112,0.696,115,1.114,121,1.13,124,1.422,126,2.717,127,1.897,128,1.936,160,1.497,234,1.18,257,1.136,281,1.158,317,1.5,344,3.232,347,2.347,349,3.461,350,3.739,351,3.461,439,1.477,443,0.959,460,3.131,622,2.233,706,1.532,709,2.166,727,2.103,771,1.157,817,2.784,818,2.383,819,2.383,821,2.918,848,1.3,849,1.3,879,1.275,898,3.997,899,2.383,900,3.075,901,3.075]],["t/152",[4,1.211,10,2.767,21,1.437,22,0.866,46,1.022,112,0.742,115,1.187,121,1.161,160,1.548,234,1.257,257,1.21,281,1.211,317,1.598,344,3.378,357,4.782,439,1.543,443,1.022,622,2.379,706,1.632,709,2.308,727,2.241,771,1.233,817,2.966,818,2.539,819,2.539,821,3.109,848,1.385,849,1.385,853,3.728,854,3.728,855,5.127,856,3.728,879,1.358,898,4.135,899,2.539,900,3.276,901,3.276]],["t/154",[4,1.111,10,2.538,15,3.002,21,1.344,22,0.868,46,0.904,63,1.926,89,3.204,112,0.656,115,1.05,121,1.1,160,1.448,234,1.111,257,1.07,281,1.111,317,1.413,344,3.099,439,1.416,443,0.904,622,2.103,706,1.443,709,2.04,727,1.981,771,1.09,817,2.623,818,2.245,819,2.245,821,2.749,848,1.225,849,1.225,857,3.296,858,5.274,859,5.98,860,4.703,861,3.445,862,3.445,863,4.703,864,3.296,879,1.201,898,3.869,899,2.245,900,2.897,901,2.897]],["t/156",[4,1.167,10,2.224,15,3.75,21,1.345,22,0.856,45,1.131,46,1.13,47,1.205,54,1.287,112,0.983,115,1.312,121,1.081,127,1.594,146,2.418,160,1.629,217,2.418,234,0.928,257,1.338,281,0.973,317,1.179,344,2.715,347,1.972,435,3.622,439,1.652,443,1.355,455,4.493,622,1.756,706,1.205,709,1.703,727,1.654,771,1.363,817,2.189,818,1.874,819,1.874,821,2.295,848,1.022,849,1.022,858,2.295,861,2.015,862,3.018,865,4.577,866,4.577,867,2.751,868,2.751,869,2.751,870,4.121,871,4.121,872,4.121,873,2.751,874,4.121,875,4.121,877,4.121,878,2.751,879,1.502,898,3.486,899,1.874,900,2.418,901,2.418]],["t/158",[15,3.224,17,3.565,22,0.754,26,3.851,70,3.851,72,4.44,94,4.44,105,4.712,363,4.44,699,4.712,730,3.76,861,4.581,862,3.7,865,5.217,866,5.217,880,5.052,881,5.052,882,5.052,883,5.052,884,5.052,885,5.052]],["t/160",[4,1.077,10,2.462,22,0.863,46,1.608,54,1.477,115,1.705,121,1.229,127,1.221,160,1.712,161,3.005,274,1.151,276,2.156,288,2.185,295,3.63,317,1.955,342,5.469,343,4.255,344,3.005,349,3.219,350,3.477,439,1.612,462,3.045,466,3.63,709,1.955,879,1.951,886,3.159,887,3.159,888,4.562,889,3.159,890,3.159,891,3.159,892,4.562,901,2.776,902,6.571]],["t/163",[85,2.417,707,4.118,709,4.241,755,4.004,792,3.697]],["t/166",[7,1.812,21,0.804,22,0.847,37,1.816,45,2.778,46,0.899,47,1.436,51,2.344,66,1.321,77,1.172,82,1.348,87,1.569,99,1.436,112,0.653,115,1.045,121,1.161,160,1.445,192,2.242,195,1.644,257,1.065,278,1.675,281,0.775,288,1.844,353,1.5,354,1.468,360,1.468,439,1.411,443,0.899,522,1.569,565,2.595,715,1.268,729,2.595,734,2.407,767,2.529,768,3.088,769,2.242,770,1.606,771,1.085,848,1.219,849,1.219,879,1.195,903,3.059,904,3.088,905,2.665,906,4.119,907,4.372,908,2.818,909,1.684,910,1.606,911,1.569]],["t/168",[7,2.253,21,0.764,22,0.861,37,1.725,45,2.652,46,0.854,51,2.277,66,1.255,77,1.113,82,1.281,85,1.857,87,1.491,99,1.364,112,0.62,115,0.992,121,1.138,160,1.403,192,2.161,195,1.562,257,1.011,278,1.614,281,0.736,288,1.791,353,1.425,354,1.394,360,1.394,439,1.359,443,0.854,522,1.491,565,2.501,601,2.976,715,1.205,729,2.501,734,2.319,767,2.437,768,2.976,769,2.161,770,1.525,771,1.031,848,1.158,849,1.158,879,1.135,904,2.976,905,2.568,906,3.97,908,2.715,909,1.6,910,1.525,911,1.491,912,2.375,913,1.6]],["t/170",[7,2.239,21,0.753,22,0.863,37,1.702,45,2.724,46,0.843,51,2.26,66,1.238,77,1.098,82,1.263,85,1.838,87,1.47,99,1.346,112,0.611,115,0.979,121,1.132,160,1.392,192,2.14,195,1.541,257,0.998,278,1.598,281,0.726,288,1.778,353,1.406,354,1.375,360,1.375,439,1.346,443,0.843,522,1.47,565,2.476,601,2.946,715,1.188,729,2.476,734,2.296,767,2.413,768,2.946,769,2.14,770,1.505,771,1.017,848,1.142,849,1.142,879,1.12,904,2.946,905,2.543,906,3.93,908,2.688,909,1.578,910,1.505,911,1.47,912,2.343,913,1.578]],["t/173",[715,2.397,792,3.345]],["t/175",[792,3.345,913,3.183]],["t/178",[7,1.838,21,0.82,22,0.859,45,2.614,46,1.303,47,1.465,66,1.347,77,1.195,82,1.375,90,1.914,99,1.465,112,0.665,115,1.065,121,1.17,124,1.378,160,1.46,192,2.274,257,1.085,276,2.561,277,2.127,278,1.195,281,0.79,288,1.864,353,1.53,354,1.497,360,1.497,439,1.43,443,0.917,462,2.702,522,1.6,565,2.632,767,2.564,768,3.131,769,2.274,770,1.637,771,1.106,848,1.243,849,1.243,879,1.219,903,3.119,907,4.432,909,1.717,910,1.637,911,1.6]],["t/180",[7,2.273,21,0.778,22,0.868,45,2.416,46,1.255,66,1.278,77,1.134,82,1.305,85,1.882,90,1.843,99,1.39,112,0.631,115,1.011,121,1.146,124,1.327,160,1.418,192,2.19,257,1.03,276,2.509,277,2.048,278,1.134,281,0.749,288,1.81,353,1.452,354,1.42,360,1.42,439,1.378,443,0.87,462,2.603,522,1.518,565,2.535,601,3.015,767,2.47,768,3.015,769,2.19,770,1.554,771,1.05,848,1.179,849,1.179,879,1.156,909,1.629,910,1.554,911,1.518,912,2.419,913,1.629]],["t/182",[7,2.258,21,0.767,22,0.869,45,2.547,46,1.242,66,1.26,77,1.118,82,1.287,85,1.863,90,1.825,99,1.371,112,0.623,115,0.997,121,1.14,124,1.314,160,1.407,192,2.168,257,1.016,276,2.495,277,2.028,278,1.118,281,0.739,288,1.796,353,1.432,354,1.401,360,1.401,439,1.364,443,0.858,462,2.577,522,1.497,565,2.509,601,2.985,767,2.445,768,2.985,769,2.168,770,1.532,771,1.035,848,1.163,849,1.163,879,1.14,909,1.607,910,1.532,911,1.497,912,2.385,913,1.607]],["t/185",[792,3.345,913,3.183]],["t/187",[8,4.192,22,0.61,34,2.894,63,3.214,66,2.215,117,2.764,220,3.214,221,3.127,259,5.129,277,2.461,505,4.376,729,3.045,730,3.306,731,3.127,895,5.996]],["t/189",[82,2.481,117,2.533,278,2.156,624,4.42,914,5.628]],["t/191",[7,1.925,21,0.876,22,0.834,37,1.978,46,0.979,47,1.564,51,2.456,66,1.438,77,1.276,82,1.468,87,1.709,90,2.004,99,1.564,112,0.711,115,1.138,121,1.054,124,1.443,160,1.513,192,2.381,195,1.79,257,1.159,274,1.814,278,1.276,281,1.175,288,1.932,353,1.634,354,1.598,360,1.598,411,3.139,439,1.498,443,0.979,522,1.709,565,2.756,715,1.381,731,2.83,734,2.556,769,2.381,770,1.749,771,1.182,808,3.177,848,1.327,849,1.327,879,1.301,908,2.992,909,1.834,910,1.749,911,1.709,915,4.642]],["t/193",[7,2.333,21,0.824,22,0.855,37,1.861,46,0.921,51,2.376,66,1.353,77,1.201,82,1.382,85,1.96,87,1.608,90,1.92,99,1.472,112,0.669,115,1.07,121,1.02,124,1.383,160,1.464,192,2.282,195,1.685,257,1.091,274,1.738,278,1.201,281,1.126,288,1.869,305,3.493,353,1.537,354,1.504,360,1.504,439,1.435,443,0.921,522,1.608,565,2.641,715,1.3,731,2.712,734,2.449,769,2.282,770,1.646,771,1.112,808,3.044,848,1.249,849,1.249,879,1.225,908,2.867,909,1.726,910,1.646,911,1.608,913,1.726,916,2.954]],["t/196",[715,2.397,792,3.345]],["t/198",[792,3.345,913,3.183]],["t/200",[4,0.724,7,0.729,10,1.655,21,0.462,22,0.858,39,3.924,54,0.882,90,0.759,93,1.885,112,0.61,113,1.284,114,3.876,115,0.6,121,1.1,123,1.467,124,1.124,126,1.698,127,1.726,128,1.21,137,1.885,138,3.066,147,2.695,160,1.179,161,2.941,165,2.039,173,1.437,257,0.612,260,3.876,274,0.687,276,1.561,288,1.034,290,2.86,304,2.695,320,2.055,331,1.5,336,2.734,344,1.242,349,2.734,350,2.954,380,1.657,424,3.066,439,0.567,441,2.163,443,1.586,447,4.225,449,2.055,450,3.343,456,3.343,457,2.055,458,2.055,460,1.203,461,3.343,462,1.744,463,2.055,464,5.356,465,2.055,466,1.5,467,2.055,468,3.343,475,1.758,505,1.5,506,2.055,520,2.055,521,1.885,525,2.055,528,2.055,546,2.055,641,4.867,670,2.695,679,1.885,771,0.624,827,2.055,917,3.763,918,2.313,919,2.313,920,3.763,921,3.763,922,2.055,923,2.313,924,3.763,925,2.313,926,2.313,927,4.756,928,4.225,929,5.479,930,6.028,931,5.479,932,3.763,933,2.313,934,2.313,935,2.313,936,3.763,937,2.313,938,4.756,939,2.313,940,3.763,941,2.313,942,2.313,943,2.313,944,2.313,945,2.313,946,2.313,947,2.313,948,2.313,949,2.313,950,2.313,951,2.313]],["t/202",[82,2.481,117,2.533,278,2.156,624,4.42,914,5.628]],["t/204",[7,1.925,21,0.876,22,0.85,46,1.365,47,1.564,66,1.438,77,1.276,82,1.468,90,2.004,99,1.564,112,0.711,115,1.138,121,1.054,124,1.443,160,1.513,192,2.381,257,1.159,276,2.624,277,2.227,281,1.175,288,1.932,353,1.634,354,1.598,360,1.598,411,3.139,439,1.498,443,0.979,462,2.83,522,1.709,565,2.756,767,2.686,768,3.279,769,2.381,770,1.749,771,1.182,848,1.327,849,1.327,879,1.301,909,1.834,910,1.749,911,1.709,915,4.642]],["t/206",[7,2.333,21,0.824,22,0.863,46,1.307,66,1.353,77,1.201,82,1.382,85,1.96,90,1.92,99,1.472,112,0.669,115,1.07,121,1.02,124,1.383,160,1.464,192,2.282,257,1.091,276,2.565,277,2.134,281,1.126,288,1.869,305,3.493,353,1.537,354,1.504,360,1.504,439,1.435,443,0.921,462,2.712,522,1.608,565,2.641,767,2.573,768,3.142,769,2.282,770,1.646,771,1.112,848,1.249,849,1.249,879,1.225,909,1.726,910,1.646,911,1.608,913,1.726,916,2.954]],["t/208",[7,2.307,21,0.804,22,0.861,46,1.285,66,1.321,77,1.172,82,1.348,85,1.927,90,1.887,99,1.436,112,0.653,115,1.045,121,1.006,124,1.359,160,1.445,165,2.466,192,2.242,257,1.065,267,2.5,276,2.542,277,2.097,281,1.107,285,3.73,288,1.844,305,3.433,353,1.5,354,1.468,360,1.468,439,1.411,443,0.899,462,2.665,522,1.569,565,2.595,767,2.529,768,3.088,769,2.242,770,1.606,771,1.085,848,1.219,849,1.219,879,1.195,909,1.684,910,1.606,911,1.569,913,1.684,916,2.883]],["t/211",[792,3.345,913,3.183]],["t/213",[82,2.481,117,2.533,278,2.156,624,4.42,914,5.628]],["t/215",[7,1.911,21,0.867,22,0.821,37,1.957,45,2.031,46,0.969,47,1.548,51,2.442,66,1.424,77,1.263,82,1.453,87,1.691,99,1.548,112,0.703,115,1.126,121,1.048,160,1.505,192,2.364,195,1.772,257,1.147,278,1.263,281,1.167,288,1.921,353,1.617,354,1.582,360,1.582,411,3.107,439,1.487,443,0.969,522,1.691,565,2.736,715,1.367,729,2.736,734,2.537,767,2.667,768,3.256,769,2.364,770,1.731,771,1.169,848,1.314,849,1.314,879,1.288,904,3.256,905,2.81,906,4.343,908,2.971,909,1.815,910,1.731,911,1.691,915,4.609]],["t/217",[7,2.323,21,0.816,22,0.849,37,1.843,45,1.947,46,0.912,51,2.363,66,1.34,77,1.189,82,1.368,85,1.947,87,1.592,99,1.457,112,0.662,115,1.06,121,1.014,160,1.456,192,2.266,195,1.668,257,1.08,278,1.189,281,1.118,288,1.859,305,3.468,353,1.522,354,1.489,360,1.489,439,1.425,443,0.912,522,1.592,565,2.622,715,1.287,729,2.622,734,2.432,767,2.556,768,3.12,769,2.266,770,1.629,771,1.101,848,1.237,849,1.237,879,1.213,904,3.12,905,2.693,906,4.162,908,2.847,909,1.709,910,1.629,911,1.592,913,1.709,916,2.925]],["t/220",[715,2.397,792,3.345]],["t/222",[792,3.345,913,3.183]],["t/225",[7,1.851,21,0.828,22,0.844,37,1.87,45,2.624,46,0.926,47,1.479,51,2.383,66,1.36,77,1.207,82,1.388,87,1.616,90,1.927,99,1.479,112,0.672,115,1.076,121,1.174,124,1.387,160,1.468,192,2.29,195,1.693,257,1.096,274,1.744,278,1.71,281,0.798,288,1.874,353,1.545,354,1.511,360,1.511,439,1.44,443,0.926,522,1.616,565,2.65,715,1.306,731,2.721,734,2.457,769,2.29,770,1.654,771,1.117,808,3.054,848,1.255,849,1.255,879,1.231,903,3.15,907,4.463,908,2.877,909,1.734,910,1.654,911,1.616]],["t/227",[7,2.282,21,0.785,22,0.859,37,1.774,45,2.426,46,0.878,51,2.313,66,1.29,77,1.144,82,1.317,85,1.894,87,1.533,90,1.856,99,1.403,112,0.637,115,1.02,121,1.15,124,1.336,160,1.426,192,2.205,195,1.606,257,1.04,274,1.679,278,1.646,281,0.756,288,1.82,353,1.465,354,1.433,360,1.433,439,1.387,443,0.878,522,1.533,565,2.552,601,3.036,715,1.239,731,2.62,734,2.366,769,2.205,770,1.568,771,1.06,808,2.941,848,1.19,849,1.19,879,1.167,908,2.77,909,1.645,910,1.568,911,1.533,912,2.441,913,1.645]],["t/229",[7,2.268,21,0.774,22,0.862,37,1.749,45,2.557,46,0.866,51,2.295,66,1.272,77,1.129,82,1.298,85,1.875,87,1.511,90,1.837,99,1.383,112,0.628,115,1.006,121,1.144,124,1.323,160,1.414,192,2.183,195,1.583,257,1.025,274,1.662,278,1.63,281,0.746,288,1.805,353,1.445,354,1.413,360,1.413,439,1.373,443,0.866,522,1.511,565,2.526,601,3.005,715,1.221,731,2.594,734,2.342,769,2.183,770,1.547,771,1.045,808,2.911,848,1.174,849,1.174,879,1.151,908,2.742,909,1.622,910,1.547,911,1.511,912,2.408,913,1.622]],["t/232",[715,2.397,792,3.345]],["t/234",[792,3.345,913,3.183]],["t/236",[10,2.068,21,0.94,22,0.873,112,0.763,121,0.705,124,1.111,126,2.122,127,1.482,128,1.512,160,1.012,276,2.104,281,0.905,288,2.153,347,1.834,351,2.704,460,3.335,462,2.971,466,3.05,557,3.335,594,5.697,669,3.575,670,3.368,727,2.304,812,4.178,813,4.178,928,4.178,952,4.703,953,6.412,954,4.703,955,4.703,956,6.412,957,4.178,958,4.703,959,4.703,960,4.703]],["t/238",[34,3.067,63,3.406,66,2.347,117,2.446,220,3.406,221,3.314,281,1.61,711,5.122]],["t/240",[4,1.22,21,1.445,22,0.86,46,1.033,47,2.262,54,1.763,112,0.75,115,1.2,121,1.166,160,1.557,234,1.271,257,1.223,281,1.22,317,1.616,439,1.555,443,1.033,622,2.405,706,1.65,727,2.266,771,1.247,818,2.567,819,2.567,848,1.401,849,1.401,850,5.632,879,1.373,898,4.159,899,2.567,961,3.144,962,4.625,963,3.937,964,3.937,965,4.309,966,4.309,967,4.54]],["t/242",[4,1.111,21,1.344,22,0.868,46,0.904,47,1.443,54,1.542,84,2.414,112,0.656,115,1.05,121,1.1,124,1.364,126,2.604,127,1.819,128,1.856,160,1.448,234,1.111,257,1.07,281,1.111,317,1.413,347,2.25,349,3.318,350,3.585,351,3.318,439,1.416,443,0.904,460,3.002,622,2.103,706,1.443,709,2.04,727,1.981,771,1.09,818,2.245,819,2.245,848,1.225,849,1.225,879,1.201,898,3.869,899,2.245,961,2.749,963,3.585,964,3.585,965,3.923,966,3.923,967,4.134]],["t/244",[4,1.158,21,1.389,22,0.871,46,0.959,47,1.532,54,1.636,84,2.562,112,0.696,115,1.114,121,1.13,160,1.497,234,1.18,257,1.136,281,1.158,317,1.5,357,4.576,439,1.477,443,0.959,622,2.233,706,1.532,709,2.166,727,2.103,771,1.157,818,2.383,819,2.383,848,1.3,849,1.3,853,3.499,854,3.499,855,4.906,856,3.499,879,1.275,898,3.997,899,2.383,961,2.918,963,3.739,964,3.739,965,4.092,966,4.092,967,4.312]],["t/246",[4,1.067,15,2.882,21,1.302,22,0.871,46,0.854,47,1.364,54,1.457,63,1.821,84,2.282,89,3.077,112,0.62,115,0.992,121,1.072,160,1.403,234,1.05,257,1.011,281,1.067,317,1.335,439,1.359,443,0.854,622,1.988,706,1.364,709,1.929,727,1.873,771,1.031,818,2.122,819,2.122,848,1.158,849,1.158,857,3.116,858,5.159,859,5.827,860,4.517,861,3.308,862,3.308,863,4.517,864,3.116,879,1.135,898,3.749,899,2.122,961,2.599,963,3.442,964,3.442,965,3.767,966,3.767,967,3.97]],["t/248",[4,1.134,15,3.675,21,1.314,22,0.861,45,1.079,46,1.09,47,1.742,54,1.86,84,1.922,112,0.955,115,1.267,121,1.059,127,1.538,146,2.307,160,1.6,217,2.307,234,0.885,257,1.291,281,0.939,317,1.125,347,1.903,435,3.495,439,1.613,443,1.317,622,1.675,706,1.149,709,1.625,727,1.578,771,1.316,818,1.788,819,1.788,848,0.975,849,0.975,858,2.189,861,1.922,862,2.913,865,4.469,866,4.469,867,2.625,868,2.625,869,2.625,870,3.977,871,3.977,872,3.977,873,2.625,874,3.977,875,3.977,877,3.977,878,2.625,879,1.449,898,3.388,899,1.788,961,2.189,963,3.031,964,3.031,965,3.317,966,3.317,967,3.495,968,4.881]],["t/250",[15,3.224,17,3.565,22,0.754,26,3.851,70,3.851,72,4.44,94,4.44,105,4.712,363,4.44,699,4.712,730,3.76,861,4.581,862,3.7,865,5.217,866,5.217,880,5.052,881,5.052,882,5.052,883,5.052,884,5.052,885,5.052]],["t/252",[4,1.01,22,0.868,46,1.542,47,1.266,54,1.352,84,2.117,115,1.621,121,1.254,127,1.118,160,1.659,161,2.817,274,1.053,276,2.049,288,2.118,295,3.403,317,1.833,342,5.244,343,3.988,349,3.017,350,3.259,439,1.532,462,2.894,466,3.403,709,1.79,879,1.854,886,2.891,887,2.891,888,4.276,889,2.891,890,2.891,891,2.891,892,4.276,961,2.412,963,3.259,964,3.259,965,3.567,966,3.567,969,5.247,970,5.247,971,6.244]],["t/255",[85,2.417,707,4.118,709,4.241,755,4.004,792,3.697]],["t/257",[4,0.603,17,3.334,21,0.627,22,0.869,25,3.426,44,2.556,54,1.195,77,0.913,81,2.556,90,1.029,92,2.246,112,0.508,121,1.103,122,1.281,126,1.415,127,0.988,157,2.556,159,3.898,245,2.132,275,1.345,281,0.603,288,1.314,307,2.761,317,1.096,331,2.034,371,2.556,372,2.556,373,2.556,374,2.556,375,3.898,376,4.725,505,2.034,542,3.898,547,3.898,557,2.487,617,2.786,669,2.384,670,2.246,676,2.786,972,2.786,973,3.136,974,3.136,975,3.136,976,4.783,977,3.136,978,4.783,979,3.136,980,3.136,981,3.136,982,3.136,983,3.136,984,3.136,985,3.136,986,3.136,987,2.786,988,3.136,989,2.786,990,3.136,991,3.136,992,2.786,993,4.783,994,2.786,995,3.136,996,2.786,997,2.786,998,2.786,999,2.786,1000,3.136,1001,3.136,1002,3.136,1003,2.786,1004,2.786,1005,4.249,1006,2.786,1007,3.136,1008,3.136,1009,3.136,1010,4.783,1011,3.136,1012,4.783,1013,3.136,1014,3.136,1015,3.136,1016,3.136,1017,3.136,1018,3.136,1019,3.136,1020,3.136,1021,3.136,1022,3.136]],["t/259",[4,0.692,7,1.669,22,0.858,51,2.198,54,1.37,77,1.046,87,1.401,112,0.583,121,1.161,122,1.468,123,1.401,124,0.849,126,1.622,128,1.155,132,3.794,160,1.354,189,2.928,245,2.443,267,3.29,275,1.541,276,2.065,277,1.31,281,0.692,288,1.455,307,2.523,317,1.255,331,2.33,347,1.401,371,2.928,372,2.928,373,2.928,374,2.928,375,2.928,376,2.928,460,1.869,542,2.928,611,5.658,669,2.731,670,2.574,678,2.33,729,1.622,730,1.76,731,1.665,922,3.193,972,3.193,987,3.193,989,3.193,992,3.193,994,3.193,996,3.193,997,3.193,998,3.193,999,3.193,1003,3.193,1004,3.193,1005,3.193,1006,3.193,1023,3.594,1024,3.594,1025,3.594,1026,3.594,1027,3.594,1028,3.594,1029,3.594,1030,3.594,1031,3.594,1032,3.594,1033,3.594,1034,5.297,1035,3.594,1036,3.594,1037,3.594,1038,3.594,1039,3.594,1040,3.594,1041,3.594,1042,3.594]],["t/261",[4,0.434,22,0.875,45,0.756,46,0.824,47,0.806,49,1.174,66,0.741,87,0.88,89,2.596,90,2.212,99,2.124,112,0.366,121,0.957,122,0.922,124,1.768,126,1.019,128,0.726,149,1.716,162,1.84,168,1.298,194,1.139,228,1.253,234,0.62,274,0.67,275,0.968,276,1.21,277,1.345,278,0.657,281,0.434,298,1.347,303,1.212,304,1.617,307,2.571,309,4.022,336,2.121,347,0.88,362,2.502,382,1.534,384,1.534,418,2.201,441,1.298,443,1.571,445,1.402,538,1.402,557,1.174,629,1.402,639,1.716,678,1.464,706,0.806,707,1.807,708,1.464,713,1.402,714,2.51,715,1.473,716,1.617,721,2.201,728,1.617,729,2.436,731,1.709,735,1.617,736,1.617,737,1.617,740,4.4,744,3.222,747,1.84,755,2.047,904,1.212,905,1.709,1043,1.464,1044,1.464,1045,1.464,1046,2.005,1047,2.005,1048,2.005,1049,2.507,1050,1.464,1051,2.507,1052,1.464,1053,1.464,1054,1.464,1055,1.464,1056,1.534,1057,2.392,1058,2.392,1059,2.392,1060,1.464,1061,1.464,1062,4.797,1063,1.464,1064,3.277,1065,2.005,1066,2.005,1067,2.005,1068,2.005,1069,2.005,1070,2.005,1071,2.005,1072,1.464,1073,1.464,1074,1.716,1075,1.464,1076,1.716,1077,2.005]],["t/263",[82,2.481,117,2.533,278,2.156,624,4.42,914,5.628]],["t/265",[7,1.87,21,0.84,22,0.838,37,1.898,46,0.94,47,1.501,51,2.402,66,1.381,77,1.225,82,1.409,86,2.994,87,1.64,90,1.948,99,1.501,112,0.682,115,1.092,121,1.031,124,1.402,160,1.48,192,2.314,195,1.719,257,1.113,274,1.762,278,1.225,281,1.142,288,1.889,353,1.568,354,1.534,360,1.534,411,3.013,439,1.456,443,0.94,522,1.64,715,1.326,730,2.908,734,2.483,767,2.61,769,2.314,770,1.679,771,1.134,808,3.087,848,1.274,849,1.274,879,1.249,905,2.75,908,2.908,909,1.76,910,1.679,911,1.64,915,4.511,1078,4.251]],["t/267",[7,2.292,21,0.793,22,0.856,37,1.791,46,0.886,51,2.326,66,1.302,77,1.155,82,1.329,85,1.907,86,2.872,87,1.547,90,1.868,99,1.416,112,0.643,115,1.03,121,0.998,124,1.345,160,1.433,192,2.22,195,1.621,257,1.049,274,1.69,278,1.155,281,1.096,288,1.829,305,3.398,353,1.479,354,1.447,360,1.447,439,1.396,443,0.886,522,1.547,715,1.25,730,2.789,734,2.382,767,2.503,769,2.22,770,1.583,771,1.07,808,2.961,848,1.202,849,1.202,879,1.178,905,2.638,908,2.789,909,1.66,910,1.583,911,1.547,913,1.66,916,2.842,1078,4.077]],["t/270",[715,2.397,792,3.345]],["t/272",[792,3.345,913,3.183]],["t/274",[4,0.571,22,0.875,45,0.995,47,1.06,49,1.544,89,1.648,90,2.463,112,0.481,121,0.945,122,1.213,124,1.92,126,1.34,128,0.955,194,1.498,228,1.648,234,0.816,274,0.882,275,1.273,277,1.083,278,0.865,281,0.571,298,1.772,303,1.594,307,3.002,309,4.48,336,1.707,347,1.158,362,2.125,418,2.737,441,1.707,443,1.609,445,1.844,538,1.844,629,1.844,706,1.06,707,2.247,708,1.926,713,1.844,714,3.009,715,0.936,721,2.737,729,2.844,731,1.376,744,2.737,755,2.546,904,1.594,905,2.125,1043,1.926,1044,1.926,1045,1.926,1049,2.018,1050,1.926,1051,2.018,1052,1.926,1053,1.926,1054,1.926,1055,1.926,1056,2.018,1057,2.974,1058,2.974,1059,2.974,1060,1.926,1061,1.926,1063,1.926,1072,1.926,1073,1.926,1074,2.257,1075,1.926,1076,2.257,1079,2.257]],["t/277",[7,1.788,21,0.789,22,0.851,37,1.782,45,2.575,46,0.882,47,1.409,51,2.32,66,1.296,77,1.15,82,1.323,86,2.862,87,1.54,90,1.862,99,1.409,112,0.64,115,1.025,121,1.153,124,1.341,160,1.429,192,2.212,195,1.613,257,1.045,274,1.685,278,1.652,281,0.76,288,1.825,353,1.472,354,1.44,360,1.44,439,1.392,443,0.882,522,1.54,715,1.244,730,2.78,734,2.374,767,2.495,769,2.212,770,1.576,771,1.065,808,2.951,848,1.196,849,1.196,879,1.173,903,3.002,905,2.629,907,4.312,908,2.78,909,1.652,910,1.576,911,1.54,1078,4.064]],["t/279",[7,2.234,21,0.75,22,0.863,37,1.694,45,2.375,46,0.839,51,2.254,66,1.232,77,1.093,82,1.258,85,1.832,86,2.759,87,1.464,90,1.795,99,1.34,112,0.609,115,0.974,121,1.13,124,1.292,160,1.389,192,2.133,195,1.534,257,0.993,274,1.624,278,1.593,281,0.722,288,1.773,353,1.399,354,1.369,360,1.369,439,1.342,443,0.839,522,1.464,601,2.937,715,1.183,730,2.68,734,2.289,767,2.405,769,2.133,770,1.498,771,1.012,808,2.845,848,1.137,849,1.137,879,1.115,905,2.535,908,2.68,909,1.571,910,1.498,911,1.464,912,2.332,913,1.571,1078,3.918]],["t/281",[7,2.22,21,0.74,22,0.865,37,1.672,45,2.511,46,0.828,51,2.237,66,1.216,77,1.079,82,1.241,85,1.815,86,2.733,87,1.444,90,1.778,99,1.322,112,0.601,115,0.961,121,1.124,124,1.28,160,1.378,192,2.112,195,1.513,257,0.98,274,1.608,278,1.577,281,0.713,288,1.759,353,1.381,354,1.351,360,1.351,439,1.329,443,0.828,522,1.444,601,2.908,715,1.167,730,2.654,734,2.267,767,2.382,769,2.112,770,1.478,771,0.999,808,2.817,848,1.122,849,1.122,879,1.1,905,2.51,908,2.654,909,1.55,910,1.478,911,1.444,912,2.301,913,1.55,1078,3.88]],["t/284",[715,2.397,792,3.345]],["t/286",[792,3.345,913,3.183]],["t/288",[4,0.532,22,0.875,45,0.926,47,0.986,49,1.437,89,1.534,90,2.484,112,0.448,121,0.909,122,1.129,124,1.882,126,1.247,128,0.889,165,1.185,194,1.394,228,1.534,234,0.759,274,0.821,275,2.6,276,0.907,277,1.582,278,0.805,281,0.532,298,1.649,303,1.484,307,2.888,309,4.363,336,1.589,347,1.078,362,2.01,418,2.589,441,1.589,443,1.562,445,1.717,538,1.717,629,2.694,706,0.986,707,2.125,708,1.792,713,1.717,714,2.874,715,0.871,721,2.589,722,1.792,729,2.736,731,1.281,744,2.589,755,2.408,808,2.256,904,1.484,905,2.01,1043,1.792,1044,1.792,1045,1.792,1049,1.879,1050,1.792,1051,1.879,1052,1.792,1053,1.792,1054,1.792,1055,1.792,1056,1.879,1057,2.813,1058,2.813,1059,2.813,1060,1.792,1061,1.792,1063,2.813,1072,1.792,1073,1.792,1074,2.101,1075,1.792,1076,2.101,1079,2.101,1080,2.455,1081,2.455,1082,2.455]],["t/290",[4,0.556,22,0.876,45,0.967,47,1.03,49,1.502,89,1.603,90,2.438,112,0.468,121,0.931,122,1.18,124,1.906,126,1.303,128,0.928,165,1.238,194,1.457,228,1.603,234,0.793,274,1.333,275,1.238,277,1.053,278,0.841,281,0.556,285,1.872,298,1.723,303,1.55,307,2.957,309,4.435,336,1.66,347,1.126,362,2.08,418,2.679,441,1.66,443,1.591,445,1.794,538,1.794,557,1.502,629,1.794,706,1.03,707,2.199,708,1.872,713,1.794,714,2.956,715,0.91,721,2.679,729,2.802,731,1.338,744,2.679,755,2.491,904,1.55,905,2.08,1043,1.872,1044,1.872,1045,1.872,1049,1.963,1050,1.872,1051,1.963,1052,1.872,1053,1.872,1054,1.872,1055,1.872,1056,1.963,1057,2.91,1058,2.91,1059,2.91,1060,1.872,1061,1.872,1063,1.872,1072,1.872,1073,1.872,1075,1.872,1079,2.195,1083,2.353,1084,2.353]],["t/292",[1,3.998,4,1.631,5,3.854,10,2.08,14,4.545,15,2.46,17,3.701,22,0.428,23,3.595,24,4.174,26,2.938,33,3.134,40,4.202,77,1.377,79,3.595,92,3.387,106,2.938,113,2.625,134,4.202,155,4.202,168,2.719,187,4.202,215,4.202,216,3.387,218,4.61,219,4.892,220,2.252,221,2.192,222,3.854,224,3.595,225,3.854,244,4.202,264,3.854,295,3.067,339,3.854,498,3.067,624,2.823,726,3.595,755,2.625,760,4.202,1085,4.73,1086,4.73,1087,4.73,1088,4.73,1089,6.437,1090,4.73,1091,4.73,1092,4.73,1093,4.73,1094,4.73,1095,4.73,1096,4.73,1097,4.73]],["t/294",[33,2.629,34,2.826,78,5.37,112,1.068,195,2.692,303,3.538,548,4.093,561,5.854,564,4.479,650,4.72,651,5.854,652,5.854,653,5.854,654,5.854,655,5.854,656,5.854,842,5.854,1098,5.37,1099,6.59]],["t/296",[4,1.003,18,2.867,25,2.52,26,3.859,73,3.126,85,1.179,112,1.114,124,1.232,127,1.109,142,2.674,151,2.867,172,2.674,173,3.239,219,6.696,234,0.967,246,2.867,264,2.867,266,4.633,268,2.391,302,4.633,321,4.633,360,1.283,380,2.52,409,2.391,426,2.52,475,2.674,494,4.633,498,4.456,519,3.126,551,6.105,552,3.126,560,2.1,584,3.126,602,3.963,726,2.674,727,1.723,751,3.126,784,3.126,809,3.126,899,1.953,1100,3.518,1101,3.518,1102,5.215,1103,7.955,1104,3.518,1105,5.215,1106,3.518,1107,3.518,1108,3.518,1109,3.518,1110,3.518,1111,3.518,1112,3.518,1113,3.518,1114,5.215,1115,6.214,1116,3.518,1117,3.518,1118,3.518,1119,3.518,1120,3.518,1121,3.518,1122,3.518,1123,3.518,1124,3.518,1125,3.518,1126,5.215,1127,3.518,1128,3.518,1129,3.518,1130,3.518,1131,5.215,1132,3.518,1133,3.518,1134,3.518,1135,3.518,1136,3.518,1137,5.215,1138,3.518,1139,3.518,1140,3.518,1141,3.518,1142,3.518,1143,3.518,1144,3.518]],["t/298",[4,0.425,22,0.876,45,0.74,46,0.81,47,0.789,49,1.149,66,0.725,87,0.862,89,2.558,90,2.191,99,2.1,112,0.358,121,0.948,122,0.903,124,1.755,126,0.997,128,0.711,149,1.679,162,1.801,165,0.948,168,1.27,194,1.115,228,1.227,234,0.607,274,1.076,275,0.948,276,1.189,277,1.322,278,0.643,281,0.425,285,1.433,298,1.319,303,1.186,304,1.583,307,2.539,309,3.985,336,2.084,347,0.862,362,2.47,382,1.502,384,1.502,418,2.163,441,1.27,443,1.557,445,1.372,538,1.372,557,1.885,629,1.372,639,1.679,678,1.433,706,0.789,707,1.775,708,1.433,713,1.372,714,2.474,715,1.452,716,1.583,721,2.163,728,1.583,729,2.405,731,1.679,735,1.583,736,1.583,737,1.583,740,4.344,744,3.181,747,1.801,755,2.012,904,1.186,905,1.679,1043,1.433,1044,1.433,1045,1.433,1046,1.963,1047,1.963,1048,1.963,1049,2.463,1050,1.433,1051,2.463,1052,1.433,1053,1.433,1054,1.433,1055,1.433,1056,1.502,1057,2.35,1058,2.35,1059,2.35,1060,1.433,1061,1.433,1062,4.736,1063,1.433,1064,3.22,1065,1.963,1066,1.963,1067,1.963,1068,1.963,1069,1.963,1070,1.963,1071,1.963,1072,1.433,1073,1.433,1075,1.433,1077,1.963,1083,1.801,1084,1.801]],["t/300",[33,2.65,37,2.997,82,2.225,115,2.077,175,5.048,278,1.934,281,1.278,353,2.476,354,2.422,564,4.515,911,2.59,1145,6.642,1146,6.642,1147,6.642,1148,6.642,1149,6.642,1150,6.642]],["t/302",[4,1.028,8,3.759,10,1.211,21,1.511,22,0.861,46,1.352,115,2.242,121,0.986,123,1.074,124,1.262,127,2.073,128,1.718,160,1.889,175,4.999,274,1.797,276,1.42,278,1.26,281,0.832,317,1.866,344,1.479,347,2.083,353,1.991,354,1.948,365,2.094,396,2.245,462,2.005,560,3.926,624,2.582,851,1.786,879,1.953,910,2.415,911,2.083,957,2.447,963,1.711,964,1.711,1098,2.245,1151,5.844,1152,2.447,1153,2.447,1154,2.755,1155,2.755,1156,6.053,1157,2.755,1158,2.447,1159,2.447,1160,2.755,1161,2.447,1162,2.447,1163,3.843,1164,2.447,1165,2.447]],["t/304",[4,0.996,10,1.154,21,1.432,22,0.863,115,2.146,121,1.025,123,1.024,124,1.223,127,2.025,128,1.665,160,1.78,175,4.884,234,1.422,257,2.075,274,1.75,276,1.367,278,1.213,281,0.801,344,1.409,347,2.018,353,1.93,354,1.888,439,1.022,443,1.436,462,1.93,560,3.835,566,5.237,624,2.486,706,1.847,771,2.115,817,1.702,879,1.908,910,2.564,911,2.018,963,1.631,964,1.631,1098,2.139,1151,5.709,1152,2.332,1153,2.332,1158,2.332,1159,2.332,1161,2.332,1162,2.332,1163,3.7,1164,2.332,1165,2.332,1166,2.625]],["t/306",[774,6.697,1167,7.538,1168,7.538]],["t/308",[4,0.518,22,0.876,45,0.902,47,0.961,49,1.4,89,1.495,90,2.462,112,0.437,121,0.896,122,1.1,124,1.868,126,1.215,128,0.866,165,1.822,194,1.358,228,1.495,234,0.74,274,1.262,275,2.563,276,0.884,277,1.55,278,0.784,281,0.518,285,1.746,298,1.607,303,1.446,307,2.846,309,4.32,336,1.548,347,1.05,362,1.969,418,2.536,441,1.548,443,1.545,445,1.672,538,1.672,557,1.4,629,2.639,706,0.961,707,2.082,708,1.746,713,1.672,714,2.826,715,0.849,721,2.536,722,1.746,729,2.697,731,1.248,744,2.536,755,2.359,808,2.21,904,1.446,905,1.969,1043,1.746,1044,1.746,1045,1.746,1049,1.83,1050,1.746,1051,1.83,1052,1.746,1053,1.746,1054,1.746,1055,1.746,1056,1.83,1057,2.755,1058,2.755,1059,2.755,1060,1.746,1061,1.746,1063,2.755,1072,1.746,1073,1.746,1075,1.746,1079,2.047,1080,2.392,1081,2.392,1082,2.392,1083,2.194,1084,2.194]],["t/310",[4,0.801,10,1.831,12,2.624,21,0.643,22,0.877,45,0.642,46,1.528,47,0.684,49,0.997,82,1.079,89,1.064,90,2.056,121,0.732,122,0.783,124,1.716,126,0.865,128,0.616,161,1.029,165,2.093,179,2.088,194,0.967,228,1.788,234,1.144,274,0.569,275,0.822,277,1.984,298,1.144,303,1.029,307,2.324,309,3.738,336,1.102,347,0.747,354,0.699,362,1.492,418,1.144,420,1.562,441,1.102,443,1.216,538,2,592,1.703,629,1.19,678,3.165,700,3.495,706,1.149,709,2.745,713,1.19,714,1.729,715,0.604,721,1.922,722,2.088,729,2.967,730,2.391,731,0.888,744,1.922,755,1.064,756,2.861,904,1.029,905,1.492,1043,1.243,1044,2.088,1045,2.088,1050,1.243,1052,1.243,1053,1.243,1054,1.243,1055,1.243,1057,2.088,1058,2.088,1059,2.088,1060,1.243,1061,1.243,1063,1.243,1072,1.243,1073,1.243,1074,1.457,1075,1.243,1076,1.457,1169,1.917,1170,1.917,1171,1.917,1172,1.917,1173,1.917,1174,1.917,1175,1.917,1176,1.917,1177,1.917,1178,4.165,1179,3.22,1180,1.917,1181,1.917,1182,4.165,1183,3.22,1184,1.917,1185,1.917,1186,1.917,1187,1.917,1188,1.917,1189,1.917,1190,6.575,1191,3.22,1192,1.917,1193,3.22,1194,3.22,1195,1.917,1196,3.22,1197,1.917,1198,3.22,1199,3.22]]],"invertedIndex":[["",{"_index":22,"t":{"2":{"position":[[216,1]]},"8":{"position":[[837,1],[941,1],[968,2],[980,2],[983,1],[1014,1],[1051,2],[1054,1],[1071,1],[1109,2],[1173,2],[1189,2],[1192,1],[1194,2],[1259,3],[1263,2],[1266,2],[1269,2],[1272,3],[1687,1],[1806,2],[1832,2],[1839,1],[1856,3],[1876,1],[1898,2],[1901,1],[1918,1],[1946,2],[1993,2],[2085,3],[2089,1],[2096,1],[2108,1],[2175,2],[2188,1],[2205,1],[2207,2],[2210,3]]},"10":{"position":[[523,1],[674,1],[676,2],[689,3],[727,2],[740,2],[743,1],[780,1],[836,2],[839,2],[867,2],[880,2],[883,1],[920,1],[976,2],[979,2],[1007,2],[1020,2],[1023,1],[1060,1],[1116,2],[1119,2],[1122,2],[1125,3]]},"16":{"position":[[254,1],[278,1]]},"23":{"position":[[162,1],[462,1],[500,1],[512,1],[525,2],[540,2],[543,1],[545,2],[578,1],[580,1],[582,1],[621,2],[639,1],[641,1],[648,1],[650,1],[652,3],[686,1],[698,1],[705,2],[720,2],[723,1],[725,2],[735,1],[737,1],[739,1],[767,3],[799,1],[811,1],[818,2],[833,2],[836,1],[838,2],[856,1],[865,3],[869,2],[973,1],[975,1],[977,1],[1006,2],[1009,1],[1011,2],[1029,1],[1038,3]]},"25":{"position":[[14,1],[16,1],[68,2],[112,2],[115,1],[117,2],[170,2],[241,2],[244,4],[249,2],[252,3]]},"27":{"position":[[453,2],[562,1],[590,2],[593,2],[619,1],[693,1],[727,1],[776,1],[798,2],[801,2],[816,2],[898,1],[927,1],[965,1],[1052,2],[1055,1],[1057,2],[1096,1],[1149,1],[1238,3],[1242,3],[1246,2],[1249,1],[1285,2],[1288,3],[1379,2]]},"29":{"position":[[10,1],[40,1],[73,1],[111,1],[226,2],[255,3],[592,1],[635,1],[668,1],[759,1],[777,1],[800,1],[834,2],[837,1],[869,1],[871,2],[895,2],[898,3]]},"32":{"position":[[69,1]]},"36":{"position":[[107,2],[255,2],[497,1]]},"42":{"position":[[0,2],[18,2],[33,1],[62,2],[136,2],[191,2],[194,2],[210,2],[271,2],[312,1],[356,2],[483,2],[486,1],[498,1],[563,2],[581,2],[584,1],[617,2],[633,2],[636,1],[656,2],[714,3]]},"44":{"position":[[26,1],[40,1],[80,1],[128,3],[153,1],[182,3],[222,1],[250,1],[264,1],[304,1],[340,3],[344,2],[480,3],[534,1]]},"46":{"position":[[12,1],[42,1],[72,2],[75,1],[85,1],[164,3],[179,1],[287,1],[299,4],[319,3]]},"52":{"position":[[632,1]]},"56":{"position":[[122,1],[132,1],[191,1],[246,2],[249,2],[252,2]]},"58":{"position":[[49,1],[61,1],[123,2],[170,2]]},"60":{"position":[[7,1],[13,1],[68,1]]},"62":{"position":[[7,1],[27,1],[216,2],[385,2]]},"67":{"position":[[60,1],[62,1],[64,1],[66,1],[100,2],[103,1],[105,2],[114,1],[116,1],[129,1],[131,1],[133,2],[157,1],[159,1],[161,1],[163,1],[243,3],[247,2],[287,1],[289,1],[291,1],[293,1],[359,1],[361,1],[363,1],[365,1]]},"69":{"position":[[165,1],[167,1],[169,1],[199,2],[202,1],[204,2],[266,3],[295,2],[395,1],[407,2],[423,2],[489,2],[492,1],[494,2],[498,1],[500,1],[502,1],[513,1],[515,1],[517,3],[521,2],[573,2],[683,3]]},"71":{"position":[[22,1]]},"73":{"position":[[63,1],[81,1],[96,1],[114,1],[155,1],[187,1],[230,1],[250,1]]},"75":{"position":[[105,1],[140,1],[201,1],[211,1],[256,2],[259,1],[333,1],[343,1],[388,2],[391,1],[466,1],[476,1],[528,1],[538,1],[583,2],[586,1],[620,1],[622,2],[625,1],[627,2],[630,1],[632,2]]},"83":{"position":[[35,1],[71,1],[113,1],[157,2],[217,2],[350,2],[355,1],[377,3],[430,2],[433,1],[461,2],[464,2]]},"88":{"position":[[233,1],[266,1]]},"90":{"position":[[14,1],[34,1],[83,1],[85,1],[119,2],[133,1]]},"92":{"position":[[14,1],[28,1],[71,1],[73,1],[107,2],[121,1]]},"94":{"position":[[37,1],[67,2],[70,1],[72,3],[76,1],[85,1],[87,1],[97,1],[99,1],[101,2],[104,3],[131,1],[161,2],[164,1],[166,3],[170,1],[179,1],[181,1],[191,1],[193,1],[195,2],[198,3]]},"97":{"position":[[68,1],[84,1],[112,1],[171,3],[175,2],[223,1],[253,2],[256,1],[277,3],[281,1],[290,1],[292,1],[302,1],[304,1],[306,2],[309,3],[313,2],[390,2],[393,1],[414,3],[418,1],[427,1],[429,1],[454,1],[456,1],[458,2],[461,3],[513,1],[529,1],[557,1],[635,3],[639,2],[688,1],[703,1],[731,2],[734,1],[755,3],[759,1],[768,1],[770,1],[777,1],[779,1],[781,2],[784,1],[786,2],[789,2],[866,2],[869,1],[890,3],[894,1],[903,1],[905,1],[914,1],[916,1],[918,2],[921,3]]},"99":{"position":[[85,1],[101,1],[129,1],[214,3],[228,1],[230,1],[241,1],[263,1],[276,2],[327,2],[330,1],[351,3],[355,1],[364,1],[366,1],[368,1],[378,1],[380,2],[383,1],[385,1],[395,1],[397,1],[399,1],[401,2],[404,3]]},"101":{"position":[[322,1],[340,1],[368,1],[427,3],[441,1],[443,1],[452,1],[457,2],[508,2],[511,1],[534,3],[538,1],[565,1],[618,3],[672,1],[674,2],[677,3]]},"103":{"position":[[173,1],[191,1],[219,1],[304,3],[318,1],[320,1],[329,1],[341,1],[346,2],[400,2],[403,1],[427,3],[431,1],[443,1],[461,1],[514,3],[569,2],[588,1],[641,3],[695,1],[697,1],[699,2],[702,3]]},"105":{"position":[[280,1],[319,1],[347,1],[406,3],[410,3],[430,2],[485,3],[505,2],[565,1],[577,1],[586,3],[590,3],[614,2],[627,1],[720,2],[723,1],[746,3],[750,1],[777,1],[830,3],[884,1],[886,2],[889,3],[1065,3],[1106,2]]},"115":{"position":[[125,2],[179,2],[233,1],[317,3],[321,2],[350,1],[376,1],[410,1],[438,1],[457,1],[463,2],[488,2],[553,2],[616,1],[630,1],[650,1],[652,2],[678,1],[696,1],[730,1],[758,1],[760,1],[772,1],[774,3],[791,2],[816,1],[830,1],[850,1],[852,2],[882,1],[903,2],[957,1],[1035,3],[1039,2],[1090,1],[1118,1],[1137,1],[1176,1],[1200,2],[1265,2],[1328,1],[1330,2],[1333,2],[1381,1],[1409,1],[1411,1],[1423,1],[1425,3],[1467,1],[1491,1],[1493,2]]},"117":{"position":[[415,1],[450,1],[645,1],[647,2],[701,1],[785,3],[789,2],[863,1],[899,1],[927,1],[929,1],[941,1],[943,3],[966,2],[991,2],[1056,2],[1119,1],[1133,1],[1153,1],[1167,1],[1188,2],[1242,1],[1320,3],[1324,2],[1402,1],[1430,1],[1432,1],[1444,1],[1446,3],[1502,1],[1526,2],[1591,2],[1654,1],[1656,2]]},"119":{"position":[[433,2],[519,1],[651,2],[747,2],[881,3],[897,1],[918,2],[1004,1],[1136,2],[1232,2],[1366,3],[1604,1],[1606,2],[1665,1],[1716,2],[1776,1],[1790,1],[1810,1],[1812,2],[1921,1],[1923,2],[1983,3],[2122,2],[2171,1],[2201,2],[2257,3],[2261,4],[2266,2],[2353,2],[2431,1],[2433,2],[2483,3],[2487,4],[2492,2],[2579,3]]},"121":{"position":[[135,1],[137,2],[179,1],[263,3],[267,2],[306,1],[342,1],[370,1],[372,1],[384,1],[386,3],[404,2],[407,1],[528,2],[582,2],[671,2],[742,1],[845,3],[849,2],[888,1],[924,1],[952,1],[954,1],[966,1],[968,3],[986,2],[1163,1],[1165,2],[1195,1],[1267,3],[1271,2],[1340,1],[1358,2],[1412,1],[1451,1],[1582,1],[1603,2],[1639,1],[1717,3],[1779,2],[1782,1],[1803,2],[1835,2]]},"123":{"position":[[424,1],[527,3],[542,1],[639,3],[677,1],[703,1],[781,3],[807,2],[913,2],[937,1],[951,1],[971,1],[985,1],[1044,2],[1079,1],[1103,2],[1209,2],[1233,1],[1235,2]]},"127":{"position":[[103,1],[122,1],[198,2],[201,1],[215,1],[235,1],[249,1],[287,1],[357,2],[398,2],[401,1],[421,3]]},"129":{"position":[[107,1],[126,1],[210,2],[225,2],[238,3],[242,3],[246,1],[260,1],[280,1],[294,1],[332,1],[410,2],[425,2],[438,3],[442,3],[484,2],[487,1],[507,3]]},"131":{"position":[[107,1],[126,1],[159,2],[162,3],[243,2],[246,3],[250,1],[264,1],[284,1],[298,1],[336,1],[363,2],[366,3],[448,3],[490,2],[493,1],[513,3]]},"133":{"position":[[125,1],[144,1],[177,2],[180,3],[189,1],[191,2],[242,2],[338,2],[341,3],[345,1],[359,1],[379,1],[393,1],[431,1],[458,2],[461,3],[470,1],[472,2],[523,2],[619,2],[622,3],[664,2],[667,1],[687,3]]},"135":{"position":[[294,1],[313,1],[346,2],[349,3],[420,3],[424,1],[438,1],[458,1],[472,1],[486,1],[589,1],[603,1],[623,1],[637,1],[675,1],[702,2],[705,3],[776,3],[818,2],[821,1],[841,3],[924,1],[970,1],[998,1],[1018,3]]},"137":{"position":[[13,1],[77,1],[129,1]]},"139":{"position":[[66,1],[109,1],[148,1],[183,3],[204,1],[251,3],[293,2],[296,1],[316,3],[332,1],[375,1],[414,1],[468,2],[471,1],[513,3],[517,2],[520,3],[562,2],[565,1],[585,3],[666,2],[669,1],[697,1],[725,1],[754,3],[825,2],[828,1],[856,1],[884,1],[913,3],[984,2],[987,1],[1015,1],[1043,1],[1072,3]]},"144":{"position":[[105,1],[140,1]]},"148":{"position":[[97,1],[110,1],[192,1],[222,2],[225,3],[262,1],[276,1],[296,1],[310,1],[342,1],[453,1],[481,1],[509,1],[511,2],[514,3],[551,3]]},"150":{"position":[[95,1],[108,1],[180,2],[195,2],[208,3],[212,3],[233,1],[263,2],[266,3],[303,1],[317,1],[337,1],[351,1],[383,1],[455,2],[470,2],[483,3],[487,3],[537,1],[565,1],[593,1],[595,2],[598,3],[635,3]]},"152":{"position":[[95,1],[108,1],[129,2],[132,3],[213,2],[216,3],[237,1],[267,2],[270,3],[307,1],[321,1],[341,1],[355,1],[387,1],[408,2],[411,3],[493,3],[543,1],[571,1],[599,1],[601,2],[604,3],[641,3]]},"154":{"position":[[113,1],[126,1],[147,2],[150,3],[159,1],[161,2],[212,2],[308,2],[311,3],[332,1],[362,2],[365,3],[402,1],[416,1],[436,1],[450,1],[482,1],[503,2],[506,3],[515,1],[517,2],[568,2],[664,2],[667,3],[717,1],[745,1],[773,1],[775,2],[778,3],[815,3]]},"156":{"position":[[282,1],[295,1],[316,2],[319,3],[390,3],[411,1],[441,2],[444,3],[481,1],[495,1],[515,1],[529,1],[543,1],[640,1],[654,1],[674,1],[688,1],[720,1],[741,2],[744,3],[815,3],[865,1],[893,1],[921,1],[923,2],[926,3],[963,3],[1046,1],[1086,1],[1114,1],[1134,3]]},"158":{"position":[[13,1],[77,1],[129,1]]},"160":{"position":[[54,1],[97,1],[136,1],[171,3],[186,1],[227,3],[243,1],[286,1],[319,1],[367,2],[370,1],[412,3],[416,2],[419,3],[494,2],[497,1],[525,1],[553,1],[582,3],[647,2],[650,1],[678,1],[706,1],[735,3],[800,2],[803,1],[831,1],[859,1],[888,3]]},"166":{"position":[[63,1],[75,1],[120,3],[124,3],[128,7],[149,1],[200,1],[283,1],[297,1],[317,1],[329,1],[374,3],[378,3],[382,7],[403,1],[485,2],[488,1],[516,1],[544,1],[588,3]]},"168":{"position":[[58,1],[70,1],[115,3],[119,3],[123,7],[144,1],[195,1],[237,2],[240,3],[258,3],[304,1],[318,1],[338,1],[350,1],[395,3],[399,3],[403,7],[424,1],[472,1],[487,2],[490,3],[508,2],[533,2],[536,1],[564,1],[592,1],[636,1],[638,2]]},"170":{"position":[[73,1],[85,1],[130,3],[134,3],[138,7],[159,1],[210,1],[238,1],[245,2],[248,3],[266,2],[276,2],[321,1],[335,1],[355,1],[367,1],[412,3],[416,3],[420,7],[441,1],[489,1],[496,2],[499,3],[517,2],[550,2],[553,1],[581,1],[609,1],[653,1],[655,2]]},"178":{"position":[[63,1],[75,1],[85,1],[113,1],[115,1],[127,1],[129,3],[146,1],[183,1],[264,1],[278,1],[298,1],[310,1],[320,1],[348,1],[350,1],[362,1],[364,3],[381,1],[449,2],[452,1],[480,1],[508,1],[550,3]]},"180":{"position":[[58,1],[70,1],[80,1],[108,1],[110,1],[122,1],[124,3],[141,1],[178,1],[220,2],[223,3],[241,3],[285,1],[299,1],[319,1],[331,1],[341,1],[369,1],[371,1],[383,1],[385,3],[402,1],[438,1],[453,2],[456,3],[474,2],[497,2],[500,1],[528,1],[556,1],[598,1],[600,2]]},"182":{"position":[[73,1],[85,1],[95,1],[123,1],[125,1],[137,1],[139,3],[156,1],[193,1],[221,1],[228,2],[231,3],[249,2],[259,2],[302,1],[316,1],[336,1],[348,1],[358,1],[386,1],[388,1],[400,1],[402,3],[419,1],[455,1],[462,2],[465,3],[483,2],[514,2],[517,1],[545,1],[573,1],[615,1],[617,2]]},"187":{"position":[[45,1]]},"191":{"position":[[46,1],[58,1],[94,1],[136,1],[209,1],[223,1],[243,1],[255,1],[291,1],[354,2],[357,1],[385,1],[413,1],[457,3]]},"193":{"position":[[56,1],[68,1],[104,1],[146,1],[178,2],[181,3],[199,3],[245,1],[259,1],[279,1],[291,1],[327,1],[364,1],[371,2],[374,3],[392,2],[417,2],[420,1],[448,1],[476,1],[520,1],[522,2]]},"200":{"position":[[63,1],[114,1],[124,1],[238,3],[290,1],[348,1],[371,1],[413,1],[425,1],[464,1],[647,1],[759,2],[762,2],[878,2],[889,1],[953,1],[1055,3],[1155,1],[1267,2],[1270,2],[1323,1],[1379,1],[1397,2],[1400,1],[1423,2],[1439,2],[1442,1],[1483,3],[1513,1],[1551,1],[1581,2],[1584,1],[1594,1],[1678,3],[1693,1],[1801,1],[1813,4],[1833,2],[1851,2],[1854,1],[1877,2],[1902,1],[1933,3],[1937,1],[1983,1],[1985,1],[2050,3],[2085,1],[2130,2],[2141,2],[2154,3],[2192,1],[2216,1],[2218,1]]},"204":{"position":[[46,1],[58,1],[68,1],[96,1],[115,1],[143,1],[214,1],[228,1],[248,1],[260,1],[270,1],[298,1],[317,1],[366,2],[369,1],[397,1],[425,1],[467,3]]},"206":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[185,2],[188,3],[206,3],[250,1],[264,1],[284,1],[296,1],[306,1],[334,1],[353,1],[378,1],[385,2],[388,3],[406,2],[429,2],[432,1],[460,1],[488,1],[530,1],[532,2]]},"208":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[204,2],[207,3],[225,3],[269,1],[283,1],[303,1],[315,1],[325,1],[353,1],[372,1],[397,1],[423,2],[426,3],[444,2],[467,2],[470,1],[498,1],[526,1],[568,1],[570,2]]},"215":{"position":[[46,1],[58,1],[155,1],[228,1],[242,1],[262,1],[274,1],[392,2],[395,1],[423,1],[451,1],[495,3]]},"217":{"position":[[56,1],[68,1],[165,1],[197,2],[200,3],[218,3],[264,1],[278,1],[298,1],[310,1],[402,1],[409,2],[412,3],[430,2],[455,2],[458,1],[486,1],[514,1],[558,1],[560,2]]},"225":{"position":[[63,1],[75,1],[111,1],[113,1],[138,1],[173,1],[256,1],[270,1],[290,1],[302,1],[338,1],[340,1],[365,1],[431,2],[434,1],[462,1],[490,1],[534,3]]},"227":{"position":[[58,1],[70,1],[106,1],[108,1],[133,1],[168,1],[210,2],[213,3],[231,3],[277,1],[291,1],[311,1],[323,1],[359,1],[361,1],[386,1],[418,1],[433,2],[436,3],[454,2],[479,2],[482,1],[510,1],[538,1],[582,1],[584,2]]},"229":{"position":[[73,1],[85,1],[121,1],[123,1],[148,1],[183,1],[211,1],[218,2],[221,3],[239,2],[249,2],[294,1],[308,1],[328,1],[340,1],[376,1],[378,1],[403,1],[435,1],[442,2],[445,3],[463,2],[496,2],[499,1],[527,1],[555,1],[599,1],[601,2]]},"236":{"position":[[34,1],[136,3],[155,2],[158,1],[171,1],[178,1],[188,1],[221,2],[224,1],[253,2],[313,3],[317,1],[319,2],[344,2],[347,1],[360,1],[367,1],[377,1],[408,2],[411,1],[470,2],[473,1],[516,3],[520,3],[524,1],[526,2]]},"240":{"position":[[105,1],[125,1],[228,2],[259,7],[284,1],[331,2],[334,3],[371,1],[385,1],[405,1],[419,1],[458,1],[561,2],[592,7],[665,1],[693,1],[721,1],[723,2],[726,3],[763,3]]},"242":{"position":[[103,1],[123,1],[180,1],[233,2],[248,2],[261,3],[265,3],[269,2],[300,7],[325,1],[372,2],[375,3],[412,1],[426,1],[446,1],[460,1],[499,1],[556,1],[609,2],[624,2],[637,3],[641,3],[645,2],[676,7],[749,1],[777,1],[805,1],[807,2],[810,3],[847,3]]},"244":{"position":[[103,1],[123,1],[180,1],[182,2],[185,3],[266,2],[269,3],[273,2],[304,7],[329,1],[376,2],[379,3],[416,1],[430,1],[450,1],[464,1],[503,1],[560,1],[562,2],[565,3],[647,3],[651,2],[682,7],[755,1],[783,1],[811,1],[813,2],[816,3],[853,3]]},"246":{"position":[[121,1],[141,1],[198,1],[200,2],[203,3],[212,1],[214,2],[265,2],[361,2],[364,3],[368,2],[399,7],[424,1],[471,2],[474,3],[511,1],[525,1],[545,1],[559,1],[598,1],[655,1],[657,2],[660,3],[669,1],[671,2],[722,2],[818,2],[821,3],[825,2],[856,7],[929,1],[957,1],[985,1],[987,2],[990,3],[1027,3]]},"248":{"position":[[290,1],[310,1],[367,1],[369,2],[372,3],[443,3],[447,2],[478,7],[503,1],[550,2],[553,3],[590,1],[604,1],[624,1],[638,1],[652,1],[756,1],[770,1],[790,1],[804,1],[843,1],[900,1],[902,2],[905,3],[976,3],[980,2],[1011,7],[1084,1],[1112,1],[1140,1],[1142,2],[1145,3],[1182,3],[1265,1],[1312,1],[1340,1],[1360,3]]},"250":{"position":[[13,1],[77,1],[129,1]]},"252":{"position":[[62,1],[105,1],[144,1],[179,3],[201,1],[258,1],[280,3],[284,2],[315,7],[343,1],[385,1],[428,1],[468,1],[525,1],[554,2],[557,1],[599,3],[603,2],[606,3],[610,2],[641,7],[669,1],[779,2],[782,1],[810,1],[838,1],[867,3],[941,2],[944,1],[972,1],[1000,1],[1029,3],[1103,2],[1106,1],[1134,1],[1162,1],[1191,3]]},"257":{"position":[[35,1],[68,1],[124,1],[194,1],[233,1],[277,1],[373,2],[389,1],[401,1],[408,1],[410,2],[464,1],[509,3],[513,1],[515,1],[530,1],[606,2],[609,1],[611,2],[643,2],[693,3],[697,2],[783,2],[856,2],[886,2],[976,3],[1018,2],[1021,1],[1083,3],[1112,2],[1115,1],[1137,1],[1324,2],[1327,3],[1356,4],[1361,3],[1365,10],[1376,7],[1393,4],[1424,7],[1432,4],[1437,8],[1446,6],[1453,11],[1496,3],[1500,3]]},"259":{"position":[[35,1],[74,1],[132,1],[208,2],[211,1],[395,1],[419,3],[461,2],[464,1],[526,3],[543,1],[652,3],[679,2],[682,1],[756,1],[758,2],[807,2],[881,1],[883,2],[939,1],[963,1],[1076,1],[1083,1],[1085,2],[1147,1],[1216,1],[1218,3],[1222,3],[1267,3]]},"261":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[329,1],[355,1],[398,2],[401,1],[413,2],[428,3],[467,1],[469,1],[569,2],[596,2],[613,2],[623,2],[626,2],[629,1],[663,1],[665,1],[673,3],[683,3],[697,3],[711,3],[715,2],[729,1],[769,3],[814,2],[885,3],[919,2],[1051,2],[1054,3],[1079,2],[1099,1],[1178,4],[1183,4],[1188,6],[1230,2],[1282,3],[1334,2],[1409,3],[1451,2],[1531,1],[1567,3],[1571,3],[1589,2],[1616,1],[1716,2],[1719,1],[1721,3],[1823,2],[1856,1],[1887,3],[1942,1],[1949,1],[1972,2],[1975,1],[2006,3],[2027,2],[2073,3],[2077,1],[2079,3],[2101,5],[2107,3],[2118,1],[2120,1],[2134,1],[2153,1],[2161,1],[2175,1],[2194,1],[2202,1],[2215,1],[2234,1],[2242,1],[2255,1],[2274,1],[2282,1],[2296,1],[2315,1],[2334,2]]},"265":{"position":[[46,1],[58,1],[86,1],[104,1],[146,1],[219,1],[233,1],[253,1],[265,1],[293,1],[311,1],[374,2],[377,1],[405,1],[433,1],[477,3]]},"267":{"position":[[56,1],[68,1],[96,1],[114,1],[156,1],[188,2],[191,3],[209,3],[255,1],[269,1],[289,1],[301,1],[329,1],[347,1],[384,1],[391,2],[394,3],[412,2],[437,2],[440,1],[468,1],[496,1],[540,1],[542,2]]},"274":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[409,2],[423,1],[463,3],[508,2],[579,3],[613,2],[745,2],[748,3],[773,2],[793,1],[872,4],[877,4],[882,6],[924,2],[976,3],[994,2],[1011,1],[1047,1],[1084,2],[1108,2],[1111,1],[1137,3],[1158,2],[1204,3],[1226,5],[1232,3],[1243,1],[1245,1],[1259,1],[1273,1],[1281,1],[1295,1],[1309,1],[1317,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1401,2]]},"277":{"position":[[63,1],[75,1],[103,1],[105,1],[120,1],[122,1],[147,1],[186,1],[269,1],[283,1],[303,1],[315,1],[343,1],[345,1],[360,1],[362,1],[387,1],[457,2],[460,1],[488,1],[516,1],[560,3]]},"279":{"position":[[58,1],[70,1],[98,1],[100,1],[115,1],[117,1],[142,1],[181,1],[223,2],[226,3],[244,3],[290,1],[304,1],[324,1],[336,1],[364,1],[366,1],[381,1],[383,1],[408,1],[444,1],[459,2],[462,3],[480,2],[505,2],[508,1],[536,1],[564,1],[608,1],[610,2]]},"281":{"position":[[73,1],[85,1],[113,1],[115,1],[130,1],[132,1],[157,1],[196,1],[224,1],[231,2],[234,3],[252,2],[262,2],[307,1],[321,1],[341,1],[353,1],[381,1],[383,1],[398,1],[400,1],[425,1],[461,1],[468,2],[471,3],[489,2],[522,2],[525,1],[553,1],[581,1],[625,1],[627,2]]},"288":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[435,2],[449,1],[489,3],[534,2],[605,3],[639,2],[771,2],[774,3],[799,2],[819,1],[898,4],[903,4],[908,6],[950,2],[1002,3],[1020,2],[1036,1],[1066,1],[1076,1],[1130,1],[1194,2],[1197,2],[1221,2],[1224,1],[1247,2],[1250,1],[1276,3],[1297,2],[1343,3],[1347,3],[1369,5],[1375,3],[1386,1],[1388,1],[1402,1],[1416,1],[1424,1],[1438,1],[1452,1],[1460,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1544,2]]},"290":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[446,2],[460,1],[500,3],[545,2],[616,3],[650,2],[782,2],[785,3],[810,2],[830,1],[909,4],[914,4],[919,6],[961,2],[1013,3],[1031,2],[1048,1],[1084,1],[1121,2],[1145,2],[1148,1],[1174,3],[1195,2],[1239,3],[1261,5],[1267,3],[1278,1],[1280,1],[1294,1],[1308,1],[1316,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1400,1],[1414,1],[1422,1],[1436,2]]},"292":{"position":[[398,1]]},"298":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[303,3],[310,2],[324,3],[333,2],[347,1],[373,1],[416,2],[419,1],[431,2],[446,3],[485,1],[487,1],[587,2],[614,2],[631,2],[641,2],[644,2],[647,1],[681,1],[683,1],[691,3],[701,3],[715,3],[729,3],[752,2],[766,1],[806,3],[851,2],[922,3],[956,2],[1088,2],[1091,3],[1116,2],[1136,1],[1215,4],[1220,4],[1225,6],[1267,2],[1319,3],[1371,2],[1446,3],[1488,2],[1568,1],[1604,3],[1608,3],[1626,2],[1653,1],[1753,2],[1756,1],[1758,3],[1860,2],[1893,1],[1924,3],[1979,1],[1986,1],[2009,2],[2012,1],[2043,3],[2064,2],[2108,3],[2112,1],[2114,3],[2136,5],[2142,3],[2153,1],[2155,1],[2169,1],[2188,1],[2196,1],[2210,1],[2229,1],[2237,1],[2250,1],[2269,1],[2277,1],[2290,1],[2309,1],[2317,1],[2331,1],[2350,1],[2369,2]]},"302":{"position":[[166,1],[198,1],[231,3],[241,3],[255,3],[259,3],[301,2],[304,1],[332,1],[379,1],[381,3],[508,1],[540,1],[567,3],[577,3],[591,3],[595,3],[636,2],[639,1],[667,1],[724,1],[726,3],[860,1],[899,1],[953,1],[961,3],[971,3],[985,3],[989,3],[1046,2],[1049,1],[1077,1],[1141,1],[1143,3],[1280,1],[1298,2],[1301,1],[1329,1],[1375,1],[1396,3],[1613,1],[1631,2],[1634,1],[1662,1],[1706,1],[1727,3]]},"304":{"position":[[184,1],[203,1],[242,3],[252,3],[266,3],[270,3],[274,1],[288,1],[316,1],[336,1],[338,1],[489,1],[516,3],[526,3],[540,3],[544,3],[552,1],[571,1],[601,1],[615,1],[643,1],[663,1],[665,1],[830,1],[884,1],[892,3],[902,3],[916,3],[920,3],[928,1],[972,1],[986,1],[1014,1],[1061,1],[1063,1],[1165,1],[1180,1],[1216,1],[1242,1],[1256,1],[1284,1],[1322,1],[1324,1],[1508,1],[1523,1],[1557,1],[1583,1],[1597,1],[1625,1],[1661,1],[1663,1]]},"308":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[472,2],[486,1],[526,3],[571,2],[642,3],[676,2],[808,2],[811,3],[836,2],[856,1],[935,4],[940,4],[945,6],[987,2],[1039,3],[1057,2],[1073,1],[1103,1],[1113,1],[1167,1],[1231,2],[1234,2],[1258,2],[1261,1],[1284,2],[1287,1],[1313,3],[1334,2],[1378,3],[1382,3],[1404,5],[1410,3],[1421,1],[1423,1],[1437,1],[1451,1],[1459,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1543,1],[1557,1],[1565,1],[1579,2]]},"310":{"position":[[15,3],[19,1],[66,2],[76,1],[90,1],[122,1],[130,1],[185,1],[213,1],[241,1],[243,1],[251,3],[261,3],[275,3],[289,3],[293,2],[303,2],[306,2],[309,1],[323,1],[344,3],[389,2],[450,3],[484,2],[606,2],[609,3],[634,2],[654,1],[723,4],[728,4],[733,6],[775,2],[827,3],[845,2],[862,1],[895,1],[932,2],[962,2],[965,1],[991,3],[1012,2],[1058,3],[1092,5],[1098,3],[1109,1],[1111,1],[1125,1],[1139,1],[1147,1],[1161,1],[1175,1],[1183,1],[1196,1],[1210,1],[1218,1],[1231,1],[1245,1],[1253,1],[1267,2],[1270,3],[1274,1],[1321,2],[1331,1],[1396,1],[1440,1],[1534,1],[1553,1],[1578,1],[1610,1],[1612,3],[1683,2],[1713,1],[1742,1],[1774,1],[1776,3],[1804,2],[1823,1],[1907,1],[1909,3],[1965,2],[1991,1],[2077,1],[2079,3],[2112,2],[2133,1],[2217,1],[2219,3],[2297,2],[2319,1],[2405,1],[2407,3],[2435,2],[2456,1],[2542,1],[2544,3],[2600,2],[2628,1],[2716,1],[2718,3],[2751,2],[2774,1],[2860,1],[2862,3],[2940,2],[2964,1],[3052,1],[3054,3],[3085,2],[3105,1],[3125,1],[3127,1]]}}}],["0",{"_index":557,"t":{"58":{"position":[[256,2]]},"73":{"position":[[121,2]]},"83":{"position":[[291,2]]},"101":{"position":[[579,2],[596,2],[609,2],[654,2],[670,1]]},"103":{"position":[[475,2],[492,2],[505,2],[551,2],[567,1],[602,2],[619,2],[632,2],[677,2],[693,1]]},"105":{"position":[[791,2],[808,2],[821,2],[866,2],[882,1]]},"119":{"position":[[829,2],[878,2],[1314,2],[1363,2]]},"236":{"position":[[173,2],[362,2]]},"257":{"position":[[1308,2],[1321,2]]},"261":{"position":[[2332,1]]},"290":{"position":[[292,2]]},"298":{"position":[[313,2],[2367,1]]},"308":{"position":[[292,2]]}}}],["0deprec",{"_index":751,"t":{"107":{"position":[[0,11]]},"296":{"position":[[101,11]]}}}],["0xffffff",{"_index":999,"t":{"257":{"position":[[876,9]]},"259":{"position":[[386,8]]}}}],["1",{"_index":274,"t":{"23":{"position":[[517,2],[703,1],[760,3],[764,2],[816,1],[854,1],[858,1],[986,3],[990,3],[1027,1],[1031,1]]},"58":{"position":[[259,2]]},"67":{"position":[[58,1],[155,1],[285,1],[357,1]]},"73":{"position":[[135,1]]},"75":{"position":[[189,3],[222,3],[321,3],[454,3],[516,3]]},"83":{"position":[[347,2],[353,1]]},"94":{"position":[[35,1],[39,1],[129,1],[133,1]]},"97":{"position":[[221,1],[225,1],[686,1],[690,1]]},"99":{"position":[[239,1],[243,1]]},"101":{"position":[[449,2],[454,2]]},"103":{"position":[[326,2],[331,2]]},"105":{"position":[[562,2],[567,2]]},"121":{"position":[[1446,4],[1752,3]]},"123":{"position":[[208,1],[737,1],[1000,1]]},"139":{"position":[[448,2]]},"160":{"position":[[347,2]]},"191":{"position":[[109,3],[306,3]]},"193":{"position":[[119,3],[342,3]]},"200":{"position":[[2138,2]]},"225":{"position":[[121,3],[348,3]]},"227":{"position":[[116,3],[369,3]]},"229":{"position":[[131,3],[386,3]]},"252":{"position":[[534,2]]},"261":{"position":[[2240,1]]},"265":{"position":[[119,3],[326,3]]},"267":{"position":[[129,3],[362,3]]},"274":{"position":[[1350,1]]},"277":{"position":[[130,3],[370,3]]},"279":{"position":[[125,3],[391,3]]},"281":{"position":[[140,3],[408,3]]},"288":{"position":[[1493,1]]},"290":{"position":[[315,2],[1385,1]]},"298":{"position":[[336,2],[2275,1]]},"302":{"position":[[1278,1],[1282,3],[1611,1],[1615,3]]},"304":{"position":[[1214,1],[1218,4],[1555,1],[1559,4]]},"308":{"position":[[315,2],[1528,1]]},"310":{"position":[[1216,1]]}}}],["1+1",{"_index":334,"t":{"29":{"position":[[284,3]]}}}],["1+:toadd",{"_index":465,"t":{"46":{"position":[[269,8]]},"200":{"position":[[1783,8]]}}}],["1,2",{"_index":279,"t":{"23":{"position":[[608,5]]}}}],["1.0.0",{"_index":546,"t":{"56":{"position":[[202,8]]},"200":{"position":[[2026,8]]}}}],["1.1",{"_index":558,"t":{"58":{"position":[[262,4]]}}}],["1.1earli",{"_index":1119,"t":{"296":{"position":[[756,8]]}}}],["1.2",{"_index":559,"t":{"58":{"position":[[267,4]]}}}],["1.2releas",{"_index":1123,"t":{"296":{"position":[[848,10]]}}}],["10",{"_index":331,"t":{"29":{"position":[[237,2]]},"46":{"position":[[296,2]]},"103":{"position":[[532,3]]},"119":{"position":[[634,3],[647,3],[1119,3],[1132,3]]},"200":{"position":[[1810,2]]},"257":{"position":[[754,3]]},"259":{"position":[[280,3]]}}}],["1000",{"_index":956,"t":{"236":{"position":[[322,6],[529,6]]}}}],["1045",{"_index":986,"t":{"257":{"position":[[504,4]]}}}],["1080",{"_index":352,"t":{"29":{"position":[[864,4]]}}}],["12",{"_index":596,"t":{"67":{"position":[[126,2]]}}}],["120",{"_index":685,"t":{"83":{"position":[[335,4]]}}}],["123",{"_index":676,"t":{"83":{"position":[[152,4]]},"257":{"position":[[689,3]]}}}],["1234",{"_index":997,"t":{"257":{"position":[[817,5]]},"259":{"position":[[330,5]]}}}],["137",{"_index":779,"t":{"117":{"position":[[956,5],[1459,5]]}}}],["14",{"_index":829,"t":{"121":{"position":[[400,3],[982,3]]}}}],["16000",{"_index":633,"t":{"71":{"position":[[86,5]]}}}],["18.x",{"_index":478,"t":{"50":{"position":[[60,5]]}}}],["19",{"_index":906,"t":{"166":{"position":[[160,3],[414,3]]},"168":{"position":[[155,3],[435,3]]},"170":{"position":[[170,3],[452,3]]},"215":{"position":[[112,4],[328,4]]},"217":{"position":[[122,4],[364,4]]}}}],["1998",{"_index":1167,"t":{"306":{"position":[[12,5]]}}}],["1experiment",{"_index":584,"t":{"64":{"position":[[144,13]]},"296":{"position":[[642,13]]}}}],["2",{"_index":275,"t":{"23":{"position":[[523,1]]},"44":{"position":[[195,3],[199,4]]},"58":{"position":[[272,1]]},"69":{"position":[[293,1],[464,3]]},"94":{"position":[[95,1],[189,1]]},"97":{"position":[[300,1],[701,1],[705,1],[772,2]]},"99":{"position":[[261,1],[265,1],[376,1]]},"101":{"position":[[636,2]]},"103":{"position":[[338,2],[343,2],[659,2]]},"105":{"position":[[574,2],[579,2],[848,2]]},"123":{"position":[[220,1],[749,1],[1012,1]]},"257":{"position":[[836,2]]},"259":{"position":[[349,2]]},"261":{"position":[[2200,1]]},"274":{"position":[[1315,1]]},"288":{"position":[[1117,4],[1171,1],[1180,4],[1458,1]]},"290":{"position":[[1350,1]]},"298":{"position":[[2235,1]]},"308":{"position":[[1154,4],[1208,1],[1217,4],[1493,1]]},"310":{"position":[[1181,1]]}}}],["2+3",{"_index":932,"t":{"200":{"position":[[785,3],[1292,3]]}}}],["2.0",{"_index":300,"t":{"27":{"position":[[238,3]]}}}],["2.rds.amazonaws.com",{"_index":872,"t":{"135":{"position":[[379,21],[735,21]]},"156":{"position":[[349,21],[774,21]]},"248":{"position":[[402,21],[935,21]]}}}],["20",{"_index":1078,"t":{"265":{"position":[[88,2],[295,2]]},"267":{"position":[[98,2],[331,2]]},"277":{"position":[[149,4],[389,4]]},"279":{"position":[[144,4],[410,4]]},"281":{"position":[[159,4],[427,4]]}}}],["2113931265",{"_index":1000,"t":{"257":{"position":[[907,11]]}}}],["2119",{"_index":882,"t":{"137":{"position":[[71,5]]},"158":{"position":[[71,5]]},"250":{"position":[[71,5]]}}}],["2130",{"_index":880,"t":{"137":{"position":[[7,5]]},"158":{"position":[[7,5]]},"250":{"position":[[7,5]]}}}],["2131",{"_index":885,"t":{"137":{"position":[[123,5]]},"158":{"position":[[123,5]]},"250":{"position":[[123,5]]}}}],["2181036031",{"_index":1001,"t":{"257":{"position":[[936,11]]}}}],["2282",{"_index":1168,"t":{"306":{"position":[[18,5]]}}}],["253",{"_index":1018,"t":{"257":{"position":[[1296,4]]}}}],["2stabl",{"_index":560,"t":{"58":{"position":[[289,7],[297,7]]},"97":{"position":[[0,7]]},"99":{"position":[[0,7]]},"101":{"position":[[0,7]]},"103":{"position":[[0,7]]},"105":{"position":[[0,7]]},"296":{"position":[[1114,7]]},"302":{"position":[[17,7],[396,7],[748,7],[1155,7],[1492,7]]},"304":{"position":[[17,7],[351,7],[685,7],[1073,7],[1418,7]]}}}],["3",{"_index":194,"t":{"10":{"position":[[292,3]]},"23":{"position":[[646,1]]},"44":{"position":[[388,1]]},"48":{"position":[[39,2]]},"58":{"position":[[278,2]]},"69":{"position":[[511,1]]},"75":{"position":[[232,3],[354,3],[364,3],[549,3],[559,3]]},"261":{"position":[[2280,1]]},"274":{"position":[[1385,1]]},"288":{"position":[[1528,1]]},"290":{"position":[[1420,1]]},"298":{"position":[[2315,1]]},"308":{"position":[[1563,1]]},"310":{"position":[[1251,1]]}}}],["33",{"_index":1014,"t":{"257":{"position":[[1261,3]]}}}],["3306",{"_index":350,"t":{"29":{"position":[[829,4]]},"129":{"position":[[219,5],[419,5]]},"139":{"position":[[178,4],[508,4]]},"150":{"position":[[189,5],[464,5]]},"160":{"position":[[166,4],[407,4]]},"200":{"position":[[163,5],[980,5],[1633,5]]},"242":{"position":[[242,5],[618,5]]},"252":{"position":[[174,4],[594,4]]}}}],["384",{"_index":1016,"t":{"257":{"position":[[1279,4]]}}}],["3legaci",{"_index":1133,"t":{"296":{"position":[[1181,7]]}}}],["4",{"_index":721,"t":{"97":{"position":[[775,1]]},"99":{"position":[[393,1]]},"261":{"position":[[2132,1],[2159,1]]},"274":{"position":[[1257,1],[1279,1]]},"288":{"position":[[1400,1],[1422,1]]},"290":{"position":[[1292,1],[1314,1]]},"298":{"position":[[2167,1],[2194,1]]},"308":{"position":[[1435,1],[1457,1]]},"310":{"position":[[1123,1],[1145,1]]}}}],["4.5.2",{"_index":701,"t":{"86":{"position":[[224,8]]}}}],["45",{"_index":768,"t":{"115":{"position":[[459,3],[787,3],[1139,4],[1438,4]]},"166":{"position":[[172,4],[426,4]]},"168":{"position":[[167,4],[447,4]]},"170":{"position":[[182,4],[464,4]]},"178":{"position":[[157,4],[392,4]]},"180":{"position":[[152,4],[413,4]]},"182":{"position":[[167,4],[430,4]]},"204":{"position":[[117,4],[319,4]]},"206":{"position":[[127,4],[355,4]]},"208":{"position":[[127,4],[374,4]]},"215":{"position":[[126,5],[342,5]]},"217":{"position":[[136,5],[378,5]]}}}],["5",{"_index":594,"t":{"67":{"position":[[80,3]]},"236":{"position":[[180,2],[369,2]]}}}],["5.6.10",{"_index":995,"t":{"257":{"position":[[773,9]]}}}],["53",{"_index":780,"t":{"117":{"position":[[962,3],[1465,4]]}}}],["6",{"_index":595,"t":{"67":{"position":[[84,3]]}}}],["6.9.0",{"_index":951,"t":{"200":{"position":[[2207,8]]}}}],["60000",{"_index":799,"t":{"119":{"position":[[740,6],[811,5],[1225,6],[1296,5]]}}}],["8",{"_index":998,"t":{"257":{"position":[[853,2]]},"259":{"position":[[366,2]]}}}],["8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":854,"t":{"131":{"position":[[193,43]]},"152":{"position":[[163,43]]},"244":{"position":[[216,43]]}}}],["_err",{"_index":712,"t":{"94":{"position":[[54,6],[148,6]]},"97":{"position":[[240,6],[377,6],[718,6],[853,6]]},"99":{"position":[[314,6]]},"101":{"position":[[493,6]]},"103":{"position":[[384,6]]},"105":{"position":[[705,6]]}}}],["a,b,c,d",{"_index":283,"t":{"25":{"position":[[31,7]]}}}],["a.j",{"_index":886,"t":{"139":{"position":[[44,4]]},"160":{"position":[[32,4]]},"252":{"position":[[40,4]]}}}],["abov",{"_index":440,"t":{"42":{"position":[[708,5]]},"119":{"position":[[1638,5],[1844,5],[2154,5],[2385,5]]}}}],["accept",{"_index":356,"t":{"29":{"position":[[976,6]]}}}],["access",{"_index":303,"t":{"27":{"position":[[357,6]]},"79":{"position":[[77,6]]},"90":{"position":[[57,7]]},"92":{"position":[[51,7]]},"261":{"position":[[637,7]]},"274":{"position":[[331,7]]},"288":{"position":[[331,7]]},"290":{"position":[[349,7]]},"294":{"position":[[145,6]]},"298":{"position":[[655,7]]},"308":{"position":[[349,7]]},"310":{"position":[[221,7]]}}}],["accord",{"_index":176,"t":{"8":{"position":[[2435,9]]}}}],["accordingli",{"_index":116,"t":{"8":{"position":[[760,12]]}}}],["ack",{"_index":625,"t":{"69":{"position":[[641,3]]}}}],["acquir",{"_index":815,"t":{"119":{"position":[[2044,9]]}}}],["action",{"_index":582,"t":{"64":{"position":[[101,7],[238,7],[335,7],[530,7]]}}}],["activ",{"_index":1135,"t":{"296":{"position":[[1289,6]]}}}],["ad",{"_index":1154,"t":{"302":{"position":[[122,6]]}}}],["add(group",{"_index":961,"t":{"240":{"position":[[0,10]]},"242":{"position":[[0,10]]},"244":{"position":[[0,10]]},"246":{"position":[[0,10]]},"248":{"position":[[0,10]]},"252":{"position":[[0,10]]}}}],["addit",{"_index":106,"t":{"8":{"position":[[599,10]]},"10":{"position":[[245,10],[296,10]]},"12":{"position":[[228,10]]},"27":{"position":[[3,8]]},"29":{"position":[[905,8]]},"38":{"position":[[251,8]]},"40":{"position":[[3,8]]},"292":{"position":[[370,10]]}}}],["addition",{"_index":822,"t":{"119":{"position":[[2583,13]]}}}],["address",{"_index":1144,"t":{"296":{"position":[[1520,10]]}}}],["advanc",{"_index":753,"t":{"109":{"position":[[80,8]]}}}],["affect",{"_index":1077,"t":{"261":{"position":[[2317,8]]},"298":{"position":[[2352,8]]}}}],["affectedrow",{"_index":382,"t":{"36":{"position":[[222,13]]},"101":{"position":[[242,12],[582,13]]},"103":{"position":[[478,13],[605,13]]},"105":{"position":[[794,13]]},"261":{"position":[[485,15]]},"298":{"position":[[503,15]]}}}],["ag",{"_index":767,"t":{"115":{"position":[[451,5],[766,5],[1131,5],[1417,5]]},"117":{"position":[[935,5],[1438,5]]},"121":{"position":[[378,5],[960,5]]},"166":{"position":[[106,6],[360,6]]},"168":{"position":[[101,6],[381,6]]},"170":{"position":[[116,6],[398,6]]},"178":{"position":[[121,5],[356,5]]},"180":{"position":[[116,5],[377,5]]},"182":{"position":[[131,5],[394,5]]},"204":{"position":[[109,5],[311,5]]},"206":{"position":[[119,5],[347,5]]},"208":{"position":[[119,5],[366,5]]},"215":{"position":[[89,6],[305,6]]},"217":{"position":[[99,6],[341,6]]},"265":{"position":[[80,5],[287,5]]},"267":{"position":[[90,5],[323,5]]},"277":{"position":[[97,5],[337,5]]},"279":{"position":[[92,5],[358,5]]},"281":{"position":[[107,5],[375,5]]}}}],["again",{"_index":198,"t":{"10":{"position":[[396,6]]},"117":{"position":[[1693,6]]},"144":{"position":[[245,6]]}}}],["aim",{"_index":211,"t":{"12":{"position":[[7,4]]}}}],["algorithm",{"_index":181,"t":{"8":{"position":[[2592,9]]}}}],["algoritm",{"_index":199,"t":{"10":{"position":[[502,9]]}}}],["allow",{"_index":530,"t":{"54":{"position":[[181,6]]}}}],["alongsid",{"_index":543,"t":{"56":{"position":[[90,9]]}}}],["altern",{"_index":814,"t":{"119":{"position":[[1987,14]]}}}],["alway",{"_index":149,"t":{"8":{"position":[[1488,6],[2239,6]]},"16":{"position":[[192,6]]},"261":{"position":[[1793,6]]},"298":{"position":[[1830,6]]}}}],["amazon",{"_index":865,"t":{"135":{"position":[[56,6],[113,6],[406,7],[762,7]]},"137":{"position":[[36,6],[138,6]]},"156":{"position":[[44,6],[101,6],[376,7],[801,7]]},"158":{"position":[[36,6],[138,6]]},"248":{"position":[[52,6],[109,6],[429,7],[962,7]]},"250":{"position":[[36,6],[138,6]]}}}],["anoth",{"_index":97,"t":{"8":{"position":[[372,7]]}}}],["answer",{"_index":1098,"t":{"294":{"position":[[22,7]]},"302":{"position":[[84,7]]},"304":{"position":[[84,7]]}}}],["api",{"_index":24,"t":{"2":{"position":[[240,3]]},"6":{"position":[[17,3]]},"8":{"position":[[1303,3]]},"12":{"position":[[76,3]]},"40":{"position":[[79,3]]},"121":{"position":[[28,4]]},"292":{"position":[[102,3],[279,3]]}}}],["appli",{"_index":55,"t":{"6":{"position":[[233,7]]},"123":{"position":[[291,8],[339,8]]}}}],["approach",{"_index":1120,"t":{"296":{"position":[[817,11]]}}}],["arg",{"_index":1032,"t":{"259":{"position":[[772,5]]}}}],["argument",{"_index":57,"t":{"6":{"position":[[252,10]]},"32":{"position":[[89,9]]}}}],["arguments[1",{"_index":1034,"t":{"259":{"position":[[941,13],[1149,13]]}}}],["arguments[2",{"_index":1035,"t":{"259":{"position":[[965,13]]}}}],["array",{"_index":267,"t":{"23":{"position":[[398,5],[942,5]]},"25":{"position":[[139,5],[148,6]]},"36":{"position":[[536,5]]},"69":{"position":[[230,5],[318,5]]},"97":{"position":[[11,5]]},"123":{"position":[[80,5],[844,5],[853,6],[875,5],[1140,5],[1149,6],[1171,5]]},"208":{"position":[[614,5]]},"259":{"position":[[824,7],[840,7]]}}}],["array.isarray(arguments[1",{"_index":1033,"t":{"259":{"position":[[851,29]]}}}],["asc",{"_index":1063,"t":{"261":{"position":[[1558,4]]},"274":{"position":[[1078,5]]},"288":{"position":[[1107,3],[1161,3]]},"290":{"position":[[1115,5]]},"298":{"position":[[1595,4]]},"308":{"position":[[1144,3],[1198,3]]},"310":{"position":[[926,5]]}}}],["ascertain",{"_index":1127,"t":{"296":{"position":[[1045,9]]}}}],["ask",{"_index":78,"t":{"8":{"position":[[43,3]]},"123":{"position":[[1262,3]]},"294":{"position":[[42,5]]}}}],["assur",{"_index":1101,"t":{"296":{"position":[[162,6]]}}}],["async",{"_index":441,"t":{"44":{"position":[[0,5],[224,5]]},"121":{"position":[[64,5],[113,5],[1141,5]]},"200":{"position":[[92,5],[1962,5]]},"261":{"position":[[616,6]]},"274":{"position":[[310,6]]},"288":{"position":[[310,6]]},"290":{"position":[[328,6]]},"298":{"position":[[634,6]]},"308":{"position":[[328,6]]},"310":{"position":[[296,6]]}}}],["asynchron",{"_index":111,"t":{"8":{"position":[[703,14]]}}}],["attach",{"_index":412,"t":{"38":{"position":[[499,6]]}}}],["attack",{"_index":777,"t":{"117":{"position":[[302,7]]}}}],["auth",{"_index":81,"t":{"8":{"position":[[83,4],[801,4],[952,6],[1869,6]]},"10":{"position":[[702,5],[842,5],[982,5]]},"257":{"position":[[119,4]]}}}],["auth.doublesha1('pass123",{"_index":977,"t":{"257":{"position":[[235,27]]}}}],["auth.verifytoken",{"_index":979,"t":{"257":{"position":[[279,17]]}}}],["authcallback",{"_index":1002,"t":{"257":{"position":[[948,13]]}}}],["authent",{"_index":92,"t":{"8":{"position":[[211,14],[610,14]]},"10":{"position":[[34,14],[159,14],[256,14],[412,14]]},"12":{"position":[[285,14]]},"257":{"position":[[962,13]]},"292":{"position":[[558,14]]}}}],["authenticate(param",{"_index":974,"t":{"257":{"position":[[169,20]]}}}],["authentication::native41",{"_index":177,"t":{"8":{"position":[[2448,24]]}}}],["authnextfactor",{"_index":188,"t":{"10":{"position":[[90,14]]}}}],["author",{"_index":947,"t":{"200":{"position":[[2144,9]]}}}],["authplugin",{"_index":83,"t":{"8":{"position":[[103,11],[928,12],[2480,11]]},"10":{"position":[[661,12]]}}}],["authswitchhandl",{"_index":143,"t":{"8":{"position":[[1318,17],[1778,18],[2508,17]]}}}],["authswitchrequest",{"_index":163,"t":{"8":{"position":[[2130,17]]}}}],["auto",{"_index":513,"t":{"52":{"position":[[709,4]]}}}],["auto_incr",{"_index":1053,"t":{"261":{"position":[[993,15]]},"274":{"position":[[687,15]]},"288":{"position":[[713,15]]},"290":{"position":[[724,15]]},"298":{"position":[[1030,15]]},"308":{"position":[[750,15]]},"310":{"position":[[548,15]]}}}],["automat",{"_index":812,"t":{"119":{"position":[[1733,13],[1940,13]]},"236":{"position":[[270,13]]}}}],["avail",{"_index":360,"t":{"29":{"position":[[1080,10]]},"58":{"position":[[238,9]]},"115":{"position":[[606,9],[1318,9]]},"117":{"position":[[1109,9],[1644,9]]},"121":{"position":[[443,9]]},"166":{"position":[[758,9]]},"168":{"position":[[807,9]]},"170":{"position":[[824,9]]},"178":{"position":[[639,9]]},"180":{"position":[[688,9]]},"182":{"position":[[705,9]]},"191":{"position":[[627,9]]},"193":{"position":[[691,9]]},"204":{"position":[[556,9]]},"206":{"position":[[620,9]]},"208":{"position":[[667,9]]},"215":{"position":[[665,9]]},"217":{"position":[[729,9]]},"225":{"position":[[704,9]]},"227":{"position":[[753,9]]},"229":{"position":[[770,9]]},"265":{"position":[[647,9]]},"267":{"position":[[711,9]]},"277":{"position":[[730,9]]},"279":{"position":[[779,9]]},"281":{"position":[[796,9]]},"296":{"position":[[1330,10]]}}}],["avg",{"_index":53,"t":{"6":{"position":[[212,5]]}}}],["avoid",{"_index":60,"t":{"6":{"position":[[292,5]]},"119":{"position":[[219,5]]}}}],["await",{"_index":443,"t":{"44":{"position":[[82,5],[155,5],[204,5],[398,5],[516,5]]},"46":{"position":[[356,5]]},"115":{"position":[[235,5],[378,5],[698,5]]},"117":{"position":[[703,5],[865,5]]},"119":{"position":[[1667,5],[2173,5],[2237,5]]},"121":{"position":[[70,6],[181,5],[308,5],[744,5],[890,5],[1414,5]]},"123":{"position":[[426,5],[705,5]]},"127":{"position":[[124,5]]},"129":{"position":[[128,5]]},"131":{"position":[[128,5]]},"133":{"position":[[146,5]]},"135":{"position":[[315,5],[488,5],[547,5]]},"148":{"position":[[194,5]]},"150":{"position":[[235,5]]},"152":{"position":[[239,5]]},"154":{"position":[[334,5]]},"156":{"position":[[413,5],[545,5],[604,5]]},"166":{"position":[[202,5]]},"168":{"position":[[197,5]]},"170":{"position":[[212,5]]},"178":{"position":[[185,5]]},"180":{"position":[[180,5]]},"182":{"position":[[195,5]]},"191":{"position":[[138,5]]},"193":{"position":[[148,5]]},"200":{"position":[[126,5],[292,5],[373,5],[675,5],[930,5],[1183,5],[1364,5],[2007,7]]},"204":{"position":[[145,5]]},"206":{"position":[[155,5]]},"208":{"position":[[155,5]]},"215":{"position":[[157,5]]},"217":{"position":[[167,5]]},"225":{"position":[[175,5]]},"227":{"position":[[170,5]]},"229":{"position":[[185,5]]},"240":{"position":[[286,5]]},"242":{"position":[[327,5]]},"244":{"position":[[331,5]]},"246":{"position":[[426,5]]},"248":{"position":[[505,5],[654,5],[713,5]]},"261":{"position":[[731,5],[817,5],[922,5],[1101,5],[1337,5],[1454,5],[1618,5],[2083,5]]},"265":{"position":[[148,5]]},"267":{"position":[[158,5]]},"274":{"position":[[425,5],[511,5],[616,5],[795,5],[1013,5],[1208,5]]},"277":{"position":[[188,5]]},"279":{"position":[[183,5]]},"281":{"position":[[198,5]]},"288":{"position":[[451,5],[537,5],[642,5],[821,5],[1038,5],[1351,5]]},"290":{"position":[[462,5],[548,5],[653,5],[832,5],[1050,5],[1243,5]]},"298":{"position":[[768,5],[854,5],[959,5],[1138,5],[1374,5],[1491,5],[1655,5],[2118,5]]},"304":{"position":[[205,5],[573,5],[930,5],[1182,5],[1525,5]]},"308":{"position":[[488,5],[574,5],[679,5],[858,5],[1075,5],[1386,5]]},"310":{"position":[[392,5],[487,5],[656,5],[864,5],[1062,5]]}}}],["await.j",{"_index":917,"t":{"200":{"position":[[0,8],[2062,11]]}}}],["b",{"_index":289,"t":{"25":{"position":[[197,1]]},"52":{"position":[[622,1]]}}}],["b.j",{"_index":887,"t":{"139":{"position":[[49,4]]},"160":{"position":[[37,4]]},"252":{"position":[[45,4]]}}}],["babel",{"_index":950,"t":{"200":{"position":[[2194,6]]}}}],["babelrc",{"_index":919,"t":{"200":{"position":[[15,8]]}}}],["back",{"_index":109,"t":{"8":{"position":[[659,4]]}}}],["backend",{"_index":662,"t":{"81":{"position":[[118,8],[166,8]]}}}],["backward",{"_index":1102,"t":{"296":{"position":[[169,8],[281,8]]}}}],["badg",{"_index":552,"t":{"58":{"position":[[18,6]]},"296":{"position":[[14,6]]}}}],["bar",{"_index":345,"t":{"29":{"position":[[730,6]]},"42":{"position":[[241,6],[528,6]]}}}],["base",{"_index":18,"t":{"2":{"position":[[170,5]]},"40":{"position":[[73,5]]},"296":{"position":[[983,5]]}}}],["basi",{"_index":74,"t":{"6":{"position":[[517,6]]}}}],["basic",{"_index":757,"t":{"109":{"position":[[608,5]]}}}],["befor",{"_index":592,"t":{"64":{"position":[[474,6]]},"310":{"position":[[1651,6]]}}}],["begin",{"_index":747,"t":{"105":{"position":[[552,5]]},"261":{"position":[[1518,5]]},"298":{"position":[[1555,5]]}}}],["behavior",{"_index":406,"t":{"38":{"position":[[363,8]]}}}],["below",{"_index":914,"t":{"189":{"position":[[13,5]]},"202":{"position":[[13,5]]},"213":{"position":[[13,5]]},"263":{"position":[[13,5]]}}}],["benchmark",{"_index":256,"t":{"20":{"position":[[63,10],[85,10],[115,10]]}}}],["beta",{"_index":1012,"t":{"257":{"position":[[1222,7],[1239,7]]}}}],["better",{"_index":216,"t":{"12":{"position":[[170,6]]},"67":{"position":[[449,6]]},"117":{"position":[[153,6],[1783,6]]},"144":{"position":[[335,6]]},"292":{"position":[[400,6]]}}}],["between",{"_index":185,"t":{"8":{"position":[[2648,7]]},"86":{"position":[[107,7]]}}}],["bin.000007",{"_index":683,"t":{"83":{"position":[[311,12]]}}}],["binari",{"_index":224,"t":{"12":{"position":[[364,6]]},"36":{"position":[[584,6]]},"111":{"position":[[102,6]]},"292":{"position":[[445,6]]}}}],["bind",{"_index":247,"t":{"18":{"position":[[99,8],[173,8]]},"73":{"position":[[4,4]]},"113":{"position":[[27,8]]}}}],["binlog",{"_index":252,"t":{"18":{"position":[[249,6]]}}}],["binlogpo",{"_index":684,"t":{"83":{"position":[[324,10]]}}}],["binlogstream",{"_index":673,"t":{"83":{"position":[[100,12]]}}}],["binlogstream.pip",{"_index":687,"t":{"83":{"position":[[381,18]]}}}],["blob",{"_index":154,"t":{"8":{"position":[[1607,4]]}}}],["block",{"_index":566,"t":{"60":{"position":[[177,6]]},"83":{"position":[[362,8]]},"304":{"position":[[137,6],[435,6],[769,6],[1154,6],[1497,6]]}}}],["bluebird",{"_index":831,"t":{"121":{"position":[[629,8],[645,8],[659,11],[705,8],[835,9]]}}}],["boolean",{"_index":399,"t":{"38":{"position":[[146,7]]},"73":{"position":[[105,7]]}}}],["both",{"_index":1163,"t":{"302":{"position":[[1417,4],[1748,4]]},"304":{"position":[[1343,4],[1682,4]]}}}],["bound",{"_index":1104,"t":{"296":{"position":[[230,5]]}}}],["branch",{"_index":486,"t":{"52":{"position":[[154,6]]}}}],["browser",{"_index":496,"t":{"52":{"position":[[399,7]]}}}],["buffer",{"_index":107,"t":{"8":{"position":[[630,8],[1667,8]]},"73":{"position":[[222,6]]}}}],["buffer.from",{"_index":853,"t":{"131":{"position":[[180,12]]},"152":{"position":[[150,12]]},"244":{"position":[[203,12]]}}}],["buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":856,"t":{"131":{"position":[[384,55]]},"152":{"position":[[429,55]]},"244":{"position":[[583,55]]}}}],["bug",{"_index":1143,"t":{"296":{"position":[[1488,4]]}}}],["build",{"_index":588,"t":{"64":{"position":[[266,5],[306,5]]}}}],["built",{"_index":471,"t":{"48":{"position":[[16,5]]}}}],["bun",{"_index":884,"t":{"137":{"position":[[119,3]]},"158":{"position":[[119,3]]},"250":{"position":[[119,3]]}}}],["byte",{"_index":402,"t":{"38":{"position":[[242,5]]}}}],["bytes/sec",{"_index":332,"t":{"29":{"position":[[240,9]]}}}],["c",{"_index":290,"t":{"25":{"position":[[214,1]]},"46":{"position":[[83,1]]},"117":{"position":[[954,1],[1457,1]]},"200":{"position":[[122,1],[1592,1]]}}}],["c.end",{"_index":468,"t":{"46":{"position":[[310,8]]},"200":{"position":[[936,8],[1824,8]]}}}],["c.execute('select",{"_index":464,"t":{"46":{"position":[[251,17]]},"200":{"position":[[484,17],[569,17],[695,17],[727,17],[1765,17]]}}}],["c.query('show",{"_index":461,"t":{"46":{"position":[[187,13]]},"200":{"position":[[298,13],[1701,13]]}}}],["c.query('som",{"_index":923,"t":{"200":{"position":[[379,13]]}}}],["ca",{"_index":862,"t":{"133":{"position":[[294,3],[575,3]]},"135":{"position":[[202,2],[214,2]]},"137":{"position":[[153,2]]},"154":{"position":[[264,3],[620,3]]},"156":{"position":[[190,2],[202,2]]},"158":{"position":[[153,2]]},"246":{"position":[[317,3],[774,3]]},"248":{"position":[[198,2],[210,2]]},"250":{"position":[[153,2]]}}}],["cach",{"_index":598,"t":{"67":{"position":[[215,6],[256,6],[322,5],[416,5],[480,5]]},"69":{"position":[[52,5]]},"71":{"position":[[36,6],[63,6],[173,5]]},"117":{"position":[[1729,5]]},"144":{"position":[[281,5]]}}}],["call",{"_index":103,"t":{"8":{"position":[[520,4],[560,4],[1549,5],[2556,6]]},"67":{"position":[[209,5]]},"105":{"position":[[89,4],[629,5],[1033,5]]},"117":{"position":[[816,4],[1351,4]]}}}],["callback",{"_index":145,"t":{"8":{"position":[[1443,9]]},"36":{"position":[[453,9]]},"69":{"position":[[598,8]]},"115":{"position":[[116,8]]},"117":{"position":[[596,8]]},"119":{"position":[[388,8],[1591,8],[2113,8]]},"123":{"position":[[404,8],[664,8]]}}}],["callback'",{"_index":1156,"t":{"302":{"position":[[470,10],[822,10],[1226,10],[1561,10]]}}}],["callback(nul",{"_index":156,"t":{"8":{"position":[[1646,14]]}}}],["callback.j",{"_index":849,"t":{"127":{"position":[[51,11]]},"129":{"position":[[55,11]]},"131":{"position":[[55,11]]},"133":{"position":[[55,11]]},"135":{"position":[[242,11]]},"148":{"position":[[45,11]]},"150":{"position":[[43,11]]},"152":{"position":[[43,11]]},"154":{"position":[[43,11]]},"156":{"position":[[230,11]]},"166":{"position":[[47,11]]},"168":{"position":[[42,11]]},"170":{"position":[[57,11]]},"178":{"position":[[47,11]]},"180":{"position":[[42,11]]},"182":{"position":[[57,11]]},"191":{"position":[[30,11]]},"193":{"position":[[40,11]]},"204":{"position":[[30,11]]},"206":{"position":[[40,11]]},"208":{"position":[[40,11]]},"215":{"position":[[30,11]]},"217":{"position":[[40,11]]},"225":{"position":[[47,11]]},"227":{"position":[[42,11]]},"229":{"position":[[57,11]]},"240":{"position":[[53,11]]},"242":{"position":[[51,11]]},"244":{"position":[[51,11]]},"246":{"position":[[51,11]]},"248":{"position":[[238,11]]},"265":{"position":[[30,11]]},"267":{"position":[[40,11]]},"277":{"position":[[47,11]]},"279":{"position":[[42,11]]},"281":{"position":[[57,11]]}}}],["candid",{"_index":1124,"t":{"296":{"position":[[859,9]]}}}],["capabilityflag",{"_index":376,"t":{"36":{"position":[[91,15]]},"257":{"position":[[859,16],[889,16],[919,16]]},"259":{"position":[[369,16]]}}}],["case",{"_index":146,"t":{"8":{"position":[[1461,5]]},"29":{"position":[[352,4]]},"135":{"position":[[148,4]]},"156":{"position":[[136,4]]},"248":{"position":[[144,4]]}}}],["catalog",{"_index":1008,"t":{"257":{"position":[[1139,8]]}}}],["catch",{"_index":771,"t":{"115":{"position":[[618,5],[818,5]]},"117":{"position":[[1121,5]]},"119":{"position":[[1778,5]]},"123":{"position":[[939,5]]},"127":{"position":[[203,5]]},"129":{"position":[[248,5]]},"131":{"position":[[252,5]]},"133":{"position":[[347,5]]},"135":{"position":[[426,5],[591,5]]},"148":{"position":[[264,5]]},"150":{"position":[[305,5]]},"152":{"position":[[309,5]]},"154":{"position":[[404,5]]},"156":{"position":[[483,5],[642,5]]},"166":{"position":[[285,5]]},"168":{"position":[[306,5]]},"170":{"position":[[323,5]]},"178":{"position":[[266,5]]},"180":{"position":[[287,5]]},"182":{"position":[[304,5]]},"191":{"position":[[211,5]]},"193":{"position":[[247,5]]},"200":{"position":[[415,5]]},"204":{"position":[[216,5]]},"206":{"position":[[252,5]]},"208":{"position":[[271,5]]},"215":{"position":[[230,5]]},"217":{"position":[[266,5]]},"225":{"position":[[258,5]]},"227":{"position":[[279,5]]},"229":{"position":[[296,5]]},"240":{"position":[[373,5]]},"242":{"position":[[414,5]]},"244":{"position":[[418,5]]},"246":{"position":[[513,5]]},"248":{"position":[[592,5],[758,5]]},"265":{"position":[[221,5]]},"267":{"position":[[257,5]]},"277":{"position":[[271,5]]},"279":{"position":[[292,5]]},"281":{"position":[[309,5]]},"304":{"position":[[131,5],[276,5],[429,5],[603,5],[763,5],[974,5],[1148,5],[1244,5],[1491,5],[1585,5]]}}}],["catch((err",{"_index":137,"t":{"8":{"position":[[1176,12]]},"42":{"position":[[620,12]]},"200":{"position":[[1426,12]]}}}],["catch(console.log",{"_index":838,"t":{"121":{"position":[[1806,19]]}}}],["catch(funct",{"_index":943,"t":{"200":{"position":[[1880,15]]}}}],["caus",{"_index":1138,"t":{"296":{"position":[[1407,5]]}}}],["caution",{"_index":519,"t":{"52":{"position":[[816,7]]},"296":{"position":[[387,7]]}}}],["cb",{"_index":157,"t":{"8":{"position":[[1835,3]]},"29":{"position":[[754,4]]},"257":{"position":[[190,3]]}}}],["cb(err",{"_index":166,"t":{"8":{"position":[[2196,8]]}}}],["cb(null",{"_index":159,"t":{"8":{"position":[[2065,8]]},"29":{"position":[[874,8]]},"257":{"position":[[391,9],[455,8]]}}}],["cd",{"_index":488,"t":{"52":{"position":[[189,2],[643,2]]}}}],["cert",{"_index":861,"t":{"133":{"position":[[245,5],[526,5]]},"135":{"position":[[217,4]]},"137":{"position":[[26,5],[156,4]]},"154":{"position":[[215,5],[571,5]]},"156":{"position":[[205,4]]},"158":{"position":[[26,5],[156,4]]},"246":{"position":[[268,5],[725,5]]},"248":{"position":[[213,4]]},"250":{"position":[[26,5],[156,4]]}}}],["cert.pem",{"_index":858,"t":{"133":{"position":[[76,8],[283,10],[326,11],[564,10],[607,11]]},"135":{"position":[[205,8]]},"154":{"position":[[64,8],[253,10],[296,11],[609,10],[652,11]]},"156":{"position":[[193,8]]},"246":{"position":[[72,8],[306,10],[349,11],[763,10],[806,11]]},"248":{"position":[[201,8]]}}}],["certs/ca",{"_index":857,"t":{"133":{"position":[[67,8]]},"154":{"position":[[55,8]]},"246":{"position":[[63,8]]}}}],["chang",{"_index":498,"t":{"52":{"position":[[420,7]]},"56":{"position":[[39,7],[106,8],[211,8],[227,6],[304,7],[344,7],[364,6]]},"101":{"position":[[24,7]]},"103":{"position":[[24,7]]},"105":{"position":[[24,7]]},"292":{"position":[[106,7]]},"296":{"position":[[301,7],[471,7],[747,8],[930,7]]}}}],["changedrow",{"_index":728,"t":{"101":{"position":[[148,11],[657,12]]},"103":{"position":[[554,12],[680,12]]},"105":{"position":[[869,12]]},"261":{"position":[[554,14]]},"298":{"position":[[572,14]]}}}],["changeus",{"_index":355,"t":{"29":{"position":[[963,12]]},"69":{"position":[[749,13]]}}}],["characterset",{"_index":375,"t":{"36":{"position":[[77,13]]},"257":{"position":[[839,13],[1247,13]]},"259":{"position":[[352,13]]}}}],["check",{"_index":35,"t":{"4":{"position":[[44,5]]},"14":{"position":[[7,5]]},"16":{"position":[[57,5]]},"64":{"position":[[13,5],[119,5],[158,6]]},"94":{"position":[[374,5]]},"109":{"position":[[13,5],[372,8],[477,8]]},"117":{"position":[[222,5]]}}}],["checkout",{"_index":510,"t":{"52":{"position":[[612,8]]}}}],["choos",{"_index":830,"t":{"121":{"position":[[475,6]]}}}],["ci",{"_index":490,"t":{"52":{"position":[[240,2],[679,2]]}}}],["clash",{"_index":839,"t":{"123":{"position":[[129,9]]}}}],["class",{"_index":12,"t":{"2":{"position":[[124,5]]},"109":{"position":[[628,5]]},"310":{"position":[[1428,5],[1669,5]]}}}],["classif",{"_index":1130,"t":{"296":{"position":[[1098,15]]}}}],["classifi",{"_index":1114,"t":{"296":{"position":[[618,10],[1354,10]]}}}],["clear",{"_index":587,"t":{"64":{"position":[[256,5],[292,5]]}}}],["cli",{"_index":506,"t":{"52":{"position":[[541,3]]},"200":{"position":[[2201,5]]}}}],["client",{"_index":28,"t":{"2":{"position":[[273,7]]},"8":{"position":[[51,6],[1577,6],[2656,6]]},"10":{"position":[[68,6]]},"12":{"position":[[384,6]]},"18":{"position":[[68,6],[143,7],[220,6]]},"23":{"position":[[171,6]]},"36":{"position":[[276,6],[383,7]]},"38":{"position":[[318,7]]},"81":{"position":[[237,6],[281,6]]},"111":{"position":[[6,6]]},"115":{"position":[[136,6],[863,6]]},"121":{"position":[[539,6]]}}}],["clientflag",{"_index":1023,"t":{"259":{"position":[[62,11]]}}}],["clientflags.compress",{"_index":1025,"t":{"259":{"position":[[397,21]]}}}],["clientplugindata(password1",{"_index":206,"t":{"10":{"position":[[789,27]]}}}],["clientplugindata(password2",{"_index":208,"t":{"10":{"position":[[929,27]]}}}],["clientplugindata(password3",{"_index":210,"t":{"10":{"position":[[1069,27]]}}}],["clone",{"_index":508,"t":{"52":{"position":[[557,5]]}}}],["close",{"_index":409,"t":{"38":{"position":[[405,5]]},"67":{"position":[[250,5]]},"69":{"position":[[72,6],[635,5]]},"71":{"position":[[187,7]]},"119":{"position":[[138,7]]},"296":{"position":[[895,5]]}}}],["co",{"_index":456,"t":{"46":{"position":[[39,2],[353,2]]},"200":{"position":[[1548,2],[2004,2]]}}}],["co(funct",{"_index":458,"t":{"46":{"position":[[59,12]]},"200":{"position":[[1568,12]]}}}],["co.j",{"_index":918,"t":{"200":{"position":[[9,5]]}}}],["code",{"_index":17,"t":{"2":{"position":[[165,4],[192,5]]},"8":{"position":[[821,4]]},"38":{"position":[[230,4]]},"60":{"position":[[172,4]]},"109":{"position":[[24,4]]},"137":{"position":[[98,4]]},"158":{"position":[[98,4]]},"250":{"position":[[98,4]]},"257":{"position":[[425,5],[498,5],[683,5]]},"292":{"position":[[66,4],[217,4]]}}}],["collat",{"_index":1097,"t":{"292":{"position":[[512,9]]}}}],["column",{"_index":611,"t":{"69":{"position":[[239,6],[334,6],[480,8]]},"123":{"position":[[16,7]]},"259":{"position":[[832,7],[955,7],[1029,9],[1066,9]]}}}],["columnlength",{"_index":1015,"t":{"257":{"position":[[1265,13]]}}}],["columntyp",{"_index":1017,"t":{"257":{"position":[[1284,11]]}}}],["come",{"_index":606,"t":{"69":{"position":[[37,5]]},"119":{"position":[[250,5]]}}}],["command",{"_index":380,"t":{"36":{"position":[[203,8]]},"38":{"position":[[6,7],[162,7],[222,7],[291,8]]},"64":{"position":[[466,7]]},"200":{"position":[[842,8]]},"296":{"position":[[547,7]]}}}],["commandcod",{"_index":400,"t":{"38":{"position":[[190,13]]}}}],["commit",{"_index":593,"t":{"64":{"position":[[495,7]]}}}],["commonli",{"_index":1099,"t":{"294":{"position":[[33,8]]}}}],["compat",{"_index":26,"t":{"2":{"position":[[250,10]]},"6":{"position":[[21,10]]},"60":{"position":[[188,10]]},"137":{"position":[[103,10]]},"158":{"position":[[103,10]]},"250":{"position":[[103,10]]},"292":{"position":[[283,10]]},"296":{"position":[[178,14],[290,10],[1122,13]]}}}],["compil",{"_index":527,"t":{"54":{"position":[[121,8]]},"81":{"position":[[101,9]]}}}],["complet",{"_index":504,"t":{"52":{"position":[[500,8]]},"54":{"position":[[52,8]]}}}],["complianc",{"_index":580,"t":{"64":{"position":[[49,10]]}}}],["compon",{"_index":523,"t":{"54":{"position":[[12,9],[165,11],[273,10]]},"56":{"position":[[12,9],[286,10]]},"58":{"position":[[204,10]]},"60":{"position":[[122,9],[230,10]]},"64":{"position":[[173,10]]}}}],["compress",{"_index":23,"t":{"2":{"position":[[218,10]]},"12":{"position":[[352,11]]},"111":{"position":[[123,12]]},"292":{"position":[[538,11]]}}}],["concept",{"_index":754,"t":{"109":{"position":[[89,9]]}}}],["config",{"_index":84,"t":{"8":{"position":[[126,6],[345,6],[1347,6]]},"10":{"position":[[354,6]]},"16":{"position":[[239,6]]},"23":{"position":[[75,6]]},"242":{"position":[[19,7]]},"244":{"position":[[19,7]]},"246":{"position":[[19,7]]},"248":{"position":[[19,7]]},"252":{"position":[[19,7]]}}}],["confirm",{"_index":1152,"t":{"302":{"position":[[59,9]]},"304":{"position":[[59,9]]}}}],["conn",{"_index":122,"t":{"8":{"position":[[832,4],[1682,4]]},"10":{"position":[[518,4]]},"44":{"position":[[75,4]]},"90":{"position":[[128,4]]},"92":{"position":[[116,4]]},"97":{"position":[[107,4],[552,4]]},"99":{"position":[[124,4]]},"101":{"position":[[363,4]]},"103":{"position":[[214,4]]},"105":{"position":[[342,4]]},"119":{"position":[[2166,4],[2425,5]]},"121":{"position":[[1634,4],[1721,4]]},"123":{"position":[[419,4],[537,4]]},"257":{"position":[[599,6]]},"259":{"position":[[201,6]]},"261":{"position":[[724,4]]},"274":{"position":[[418,4]]},"288":{"position":[[444,4]]},"290":{"position":[[455,4]]},"298":{"position":[[761,4]]},"308":{"position":[[481,4]]},"310":{"position":[[1450,5]]}}}],["conn.clos",{"_index":993,"t":{"257":{"position":[[700,13],[1482,13]]}}}],["conn.end",{"_index":445,"t":{"44":{"position":[[210,11]]},"121":{"position":[[1838,12]]},"261":{"position":[[2089,11]]},"274":{"position":[[1214,11]]},"288":{"position":[[1357,11]]},"290":{"position":[[1249,11]]},"298":{"position":[[2124,11]]},"308":{"position":[[1392,11]]}}}],["conn.execute('select",{"_index":444,"t":{"44":{"position":[[161,20]]},"94":{"position":[[108,20]]}}}],["conn.execute>(sql",{"_index":748,"t":{"105":{"position":[[651,53]]}}}],["conn.query>('cal",{"_index":1065,"t":{"261":{"position":[[1624,45]]},"298":{"position":[[1661,45]]}}}],["conn.query('drop",{"_index":1049,"t":{"261":{"position":[[823,33],[1343,33]]},"274":{"position":[[517,33]]},"288":{"position":[[543,33]]},"290":{"position":[[554,33]]},"298":{"position":[[860,33],[1380,33]]},"308":{"position":[[580,33]]}}}],["conn.query(sql",{"_index":733,"t":{"101":{"position":[[460,32]]}}}],["conn.query(sql",{"_index":739,"t":{"103":{"position":[[349,34]]}}}],["conn.query('select",{"_index":717,"t":{"97":{"position":[[185,35]]}}}],["conn.query('show",{"_index":718,"t":{"97":{"position":[[321,33],[797,33]]}}}],["conn.query(sql",{"_index":723,"t":{"99":{"position":[[279,34]]}}}],["conn.query Search the documentation - + diff --git a/zh-CN/404.html b/zh-CN/404.html index cdad1b0df6..237b95f5c5 100644 --- a/zh-CN/404.html +++ b/zh-CN/404.html @@ -4,7 +4,7 @@ 找不到页面 | Quickstart - + diff --git a/zh-CN/assets/js/11e11f3b.4f42d272.js b/zh-CN/assets/js/11e11f3b.4f42d272.js deleted file mode 100644 index e367e7dc79..0000000000 --- a/zh-CN/assets/js/11e11f3b.4f42d272.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8625],{3463:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>u,toc:()=>m});var r=s(5893),t=s(1151),o=s(4866),c=s(5162),l=s(6393),i=s(4379);const a={sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},d="createConnection",u={id:"examples/connections/create-connection",title:"createConnection",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-connection.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-connection",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-connection",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-connection.mdx",tags:[{label:"createConnection",permalink:"/node-mysql2/zh-CN/docs/tags/create-connection"},{label:"URI",permalink:"/node-mysql2/zh-CN/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/zh-CN/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/zh-CN/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/zh-CN/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/zh-CN/docs/tags/socks"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"Introduction",permalink:"/node-mysql2/zh-CN/docs/examples"},next:{title:"createPool",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-pool"}},h={},m=[{value:"createConnection(connectionUri)",id:"createconnectionconnectionuri",level:2},{value:"createConnection(config)",id:"createconnectionconfig",level:2},{value:"createConnection(config) \u2014 SHA1",id:"createconnectionconfig--sha1",level:2},{value:"createConnection(config) \u2014 SSL",id:"createconnectionconfig--ssl",level:2},{value:"createConnection(config) \u2014 RDS SSL",id:"createconnectionconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createConnection(config) \u2014 Socks",id:"createconnectionconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ConnectionOptions",id:"connectionoptions",level:3}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createconnection",children:"createConnection"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconnectionuri",children:"createConnection(connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"createConnection(connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n );\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n);\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig",children:"createConnection(config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--sha1",children:"createConnection(config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--ssl",children:"createConnection(config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsxs)(c.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--rds-ssl",children:"createConnection(config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(c.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await connection.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(c.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n connection.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--socks",children:"createConnection(config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst connection = mysql.createConnection({\n stream: socksProxy,\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsx)(c.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst connection = mysql.createConnection({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"connectionoptions",children:"ConnectionOptions"}),"\n",(0,r.jsx)(l.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>c});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var o=s(5893);function c(e){let{children:n,hidden:s,className:c}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,c),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>S});var r=s(7294),t=s(512),o=s(2466),c=s(6550),l=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const t=(0,c.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})}),[o,t])]}function g(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,o=h(e),[c,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[a,u]=p({queryString:s,groupId:t}),[g,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,o]=(0,d.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&o.set(e)}),[s,o])]}({groupId:t}),j=(()=>{const e=a??g;return m({value:e,tabValues:o})?e:null})();(0,l.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:c,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,o]),tabValues:o}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:c,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,o.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),t=l[s].value;t!==r&&(a(n),c(t))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:o}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...o,className:(0,t.Z)("tabs__item",j.tabItem,o?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:t}=e;const o=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),t=s(2263),o=s(9286),c=s(5893);const l=()=>(0,c.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,m]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!0),{siteConfig:x}=(0,t.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let o=!1,c=0,l="";for(const i of r)if(i.includes(t)&&(o=!0),o&&(i.includes("{")&&c++,l+=i+"\n",i.includes("}")&&(c--,0===c)))break;return l.trim()||e})(e,i,a):e;u(n||e),m(!1),g(!1)})).catch((()=>{g(!0),m(!1)})),()=>{e.abort()}}),[f,i,a]),(0,c.jsx)(c.Fragment,{children:h?(0,c.jsx)(l,{}):(0,c.jsx)(c.Fragment,{children:p?(0,c.jsxs)("div",{children:["Unable to access the requested link: ",(0,c.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,c.jsx)(o.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>o});var r=s(4673),t=s(5893);const o=e=>{let{children:n,open:s,title:o}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/11e11f3b.f32e41f2.js b/zh-CN/assets/js/11e11f3b.f32e41f2.js new file mode 100644 index 0000000000..76a291d3e2 --- /dev/null +++ b/zh-CN/assets/js/11e11f3b.f32e41f2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8625],{3463:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>u,toc:()=>m});var r=s(5893),t=s(1151),o=s(4866),c=s(5162),l=s(6393),i=s(4379);const a={sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},d="createConnection",u={id:"examples/connections/create-connection",title:"createConnection",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-connection.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-connection",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-connection",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-connection.mdx",tags:[{label:"createConnection",permalink:"/node-mysql2/zh-CN/docs/tags/create-connection"},{label:"URI",permalink:"/node-mysql2/zh-CN/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/zh-CN/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/zh-CN/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/zh-CN/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/zh-CN/docs/tags/socks"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["createConnection","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"Introduction",permalink:"/node-mysql2/zh-CN/docs/examples"},next:{title:"createPool",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-pool"}},h={},m=[{value:"createConnection(connectionUri)",id:"createconnectionconnectionuri",level:2},{value:"createConnection(config)",id:"createconnectionconfig",level:2},{value:"createConnection(config) \u2014 SHA1",id:"createconnectionconfig--sha1",level:2},{value:"createConnection(config) \u2014 SSL",id:"createconnectionconfig--ssl",level:2},{value:"createConnection(config) \u2014 RDS SSL",id:"createconnectionconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createConnection(config) \u2014 Socks",id:"createconnectionconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ConnectionOptions",id:"connectionoptions",level:3}];function p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createconnection",children:"createConnection"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconnectionuri",children:"createConnection(connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"createConnection(connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n );\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection(\n 'mysql://root:password@localhost:3306/test'\n);\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig",children:"createConnection(config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--sha1",children:"createConnection(config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--ssl",children:"createConnection(config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(c.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsxs)(c.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--rds-ssl",children:"createConnection(config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(c.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const connection = await mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // highlight-end\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await connection.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(c.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst connection = mysql.createConnection({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n connection.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"createconnectionconfig--socks",children:"createConnection(config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["createConnection(config: ",(0,r.jsx)(n.a,{href:"#connectionoptions",children:"ConnectionOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(c.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst connection = mysql.createConnection({\n stream: socksProxy,\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})}),(0,r.jsx)(c.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst connection = mysql.createConnection({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n\nconnection.addListener('error', (err) => {\n console.log(err);\n});\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\nconnection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"connectionoptions",children:"ConnectionOptions"}),"\n",(0,r.jsx)(l.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>c});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var o=s(5893);function c(e){let{children:n,hidden:s,className:c}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,c),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>S});var r=s(7294),t=s(512),o=s(2466),c=s(6550),l=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const t=(0,c.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(o),(0,r.useCallback)((e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})}),[o,t])]}function g(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,o=h(e),[c,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:o}))),[a,u]=p({queryString:s,groupId:t}),[g,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,o]=(0,d.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&o.set(e)}),[s,o])]}({groupId:t}),j=(()=>{const e=a??g;return m({value:e,tabValues:o})?e:null})();(0,l.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:c,selectValue:(0,r.useCallback)((e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,o]),tabValues:o}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:c,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,o.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),t=l[s].value;t!==r&&(a(n),c(t))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:l.map((e=>{let{value:n,label:s,attributes:o}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...o,className:(0,t.Z)("tabs__item",j.tabItem,o?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:t}=e;const o=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=o.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),t=s(2263),o=s(9286),c=s(5893);const l=()=>(0,c.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,m]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!0),{siteConfig:x}=(0,t.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let o=!1,c=0,l="";for(const i of r)if(i.includes(t)&&(o=!0),o&&(i.includes("{")&&c++,l+=i+"\n",i.includes("}")&&(c--,0===c)))break;return l.trim()||e})(e,i,a):e;u(n||e),m(!1),g(!1)})).catch((()=>{g(!0),m(!1)})),()=>{e.abort()}}),[f,i,a]),(0,c.jsx)(c.Fragment,{children:h?(0,c.jsx)(l,{}):(0,c.jsx)(c.Fragment,{children:p?(0,c.jsxs)("div",{children:["Unable to access the requested link: ",(0,c.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,c.jsx)(o.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>o});var r=s(4673),t=s(5893);const o=e=>{let{children:n,open:s,title:o}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/1568425c.44decca5.js b/zh-CN/assets/js/1568425c.44decca5.js new file mode 100644 index 0000000000..16e5bdc17d --- /dev/null +++ b/zh-CN/assets/js/1568425c.44decca5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9458],{904:(e,s,i)=>{i.r(s),i.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>n,metadata:()=>a,toc:()=>o});var r=i(5893),t=i(1151);const n={},l="Simple Queries",a={id:"examples/queries/simple-queries/index",title:"Simple Queries",description:"For Prepared Statements or Placeholders / Parameters examples, please see here.",source:"@site/docs/examples/queries/simple-queries/index.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster"},next:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert"}},c={},o=[];function d(e){const s={a:"a",admonition:"admonition",h1:"h1",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{id:"simple-queries",children:"Simple Queries"}),"\n",(0,r.jsx)(s.admonition,{type:"info",children:(0,r.jsxs)(s.p,{children:["For ",(0,r.jsx)(s.strong,{children:"Prepared Statements"})," or ",(0,r.jsx)(s.strong,{children:"Placeholders"})," / ",(0,r.jsx)(s.strong,{children:"Parameters"})," examples, please see ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements",children:"here"}),"."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,r.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/insert",children:(0,r.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/select",children:(0,r.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/update",children:(0,r.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/delete",children:(0,r.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function p(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},1151:(e,s,i)=>{i.d(s,{Z:()=>a,a:()=>l});var r=i(7294);const t={},n=r.createContext(t);function l(e){const s=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),r.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/1568425c.69831b13.js b/zh-CN/assets/js/1568425c.69831b13.js deleted file mode 100644 index 5fca327c11..0000000000 --- a/zh-CN/assets/js/1568425c.69831b13.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9458],{904:(e,s,i)=>{i.r(s),i.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>n,metadata:()=>a,toc:()=>o});var r=i(5893),t=i(1151);const n={},l="Simple Queries",a={id:"examples/queries/simple-queries/index",title:"Simple Queries",description:"For Prepared Statements or Placeholders / Parameters examples, please see here.",source:"@site/docs/examples/queries/simple-queries/index.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster"},next:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert"}},c={},o=[];function d(e){const s={a:"a",admonition:"admonition",h1:"h1",hr:"hr",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{id:"simple-queries",children:"Simple Queries"}),"\n",(0,r.jsx)(s.admonition,{type:"info",children:(0,r.jsxs)(s.p,{children:["For ",(0,r.jsx)(s.strong,{children:"Prepared Statements"})," or ",(0,r.jsx)(s.strong,{children:"Placeholders"})," / ",(0,r.jsx)(s.strong,{children:"Parameters"})," examples, please see ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements",children:"here"}),"."]})}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,r.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/insert",children:(0,r.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/select",children:(0,r.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/update",children:(0,r.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,r.jsxs)(s.li,{className:"task-list-item",children:[(0,r.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,r.jsx)(s.a,{href:"/docs/examples/queries/simple-queries/delete",children:(0,r.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function p(e={}){const{wrapper:s}={...(0,t.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},1151:(e,s,i)=>{i.d(s,{Z:()=>a,a:()=>l});var r=i(7294);const t={},n=r.createContext(t);function l(e){const s=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),r.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/1df93b7f.7c544ac9.js b/zh-CN/assets/js/1df93b7f.7c544ac9.js new file mode 100644 index 0000000000..33182a81c7 --- /dev/null +++ b/zh-CN/assets/js/1df93b7f.7c544ac9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{9754:(e,s,n)=>{n.r(s),n.d(s,{default:()=>i});var t=n(6550),c=n(2263),u=n(5893);const i=function(){const{i18n:e,siteConfig:s}=(0,c.Z)(),{baseUrl:n}=s,i=e.currentLocale,o="en"===i||n.includes(i)?`${n}docs`:`${n}${i}/docs`;return(0,u.jsx)(t.l_,{to:o})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/1df93b7f.8f7e93f0.js b/zh-CN/assets/js/1df93b7f.8f7e93f0.js deleted file mode 100644 index 6dfb81a400..0000000000 --- a/zh-CN/assets/js/1df93b7f.8f7e93f0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3237],{9754:(e,s,t)=>{t.r(s),t.d(s,{default:()=>r});var n=t(6550),c=t(2263),o=t(5893);const r=function(){const{i18n:e,siteConfig:s}=(0,c.Z)(),{baseUrl:t}=s,r=e.currentLocale,u="en"===r?`${t}docs`:`${t}${r}/docs`;return(0,o.jsx)(n.l_,{to:u})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/2bc14e22.53969db2.js b/zh-CN/assets/js/2bc14e22.53969db2.js new file mode 100644 index 0000000000..99905db130 --- /dev/null +++ b/zh-CN/assets/js/2bc14e22.53969db2.js @@ -0,0 +1,2 @@ +/*! For license information please see 2bc14e22.53969db2.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2839],{4760:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>x,frontMatter:()=>a,metadata:()=>i,toc:()=>h});var t=s(5893),r=s(1151),l=s(8609),c=s(3901);const a={},o="Using MySQL2 with TypeScript",i={id:"documentation/typescript-examples",title:"Using MySQL2 with TypeScript",description:"Installation",source:"@site/docs/documentation/typescript-examples.mdx",sourceDirName:"documentation",slug:"/documentation/typescript-examples",permalink:"/node-mysql2/zh-CN/docs/documentation/typescript-examples",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/typescript-examples.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Promise Wrappers",permalink:"/node-mysql2/zh-CN/docs/documentation/promise-wrapper"},next:{title:"API\u914d\u7f6e\u9879",permalink:"/node-mysql2/zh-CN/docs/api-and-configurations"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"Usage",id:"usage",level:2},{value:"Connection",id:"connection",level:3},{value:"Pool Connection",id:"pool-connection",level:3},{value:"Query and Execute",id:"query-and-execute",level:3},{value:"A simple query",id:"a-simple-query",level:4},{value:"Type Specification",id:"type-specification",level:2},{value:"RowDataPacket[]",id:"rowdatapacket",level:3},{value:"RowDataPacket[][]",id:"rowdatapacket-1",level:3},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"ResultSetHeader[]",id:"resultsetheader-1",level:3},{value:"ProcedureCallPacket",id:"procedurecallpacket",level:3},{value:"OkPacket",id:"okpacket",level:3},{value:"Examples",id:"examples",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"using-mysql2-with-typescript",children:"Using MySQL2 with TypeScript"}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"@types/node"})," ensure the proper interaction between ",(0,t.jsx)(n.strong,{children:"TypeScript"})," and the ",(0,t.jsx)(n.strong,{children:"Node.js"})," modules used by ",(0,t.jsx)(n.strong,{children:"MySQL2"})," (",(0,t.jsx)(n.em,{children:"net"}),", ",(0,t.jsx)(n.em,{children:"events"}),", ",(0,t.jsx)(n.em,{children:"stream"}),", ",(0,t.jsx)(n.em,{children:"tls"}),", etc.)."]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires ",(0,t.jsx)(n.strong,{children:"TypeScript"})," ",(0,t.jsx)(n.code,{children:">=4.5.2"}),"."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["You can import ",(0,t.jsx)(n.strong,{children:"MySQL2"})," in two ways:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"true"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql from 'mysql2';\nimport mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"false"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import * as mysql from 'mysql2';\nimport * as mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsx)(n.h3,{id:"connection",children:"Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ConnectionOptions } from 'mysql2';\n\nconst access: ConnectionOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createConnection(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"pool-connection",children:"Pool Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { PoolOptions } from 'mysql2';\n\nconst access: PoolOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createPool(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"query-and-execute",children:"Query and Execute"}),"\n",(0,t.jsx)(n.h4,{id:"a-simple-query",children:"A simple query"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\nconn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"rows"})," output will be these possible types:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[][]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"In this example, you need to manually check the output types"}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"type-specification",children:"Type Specification"}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket",children:"RowDataPacket[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(n.p,{children:"An array with the returned rows, for example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n// SELECT\nconn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { Tables_in_test: 'test' } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"rowsAsArray"})," option as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n rowsAsArray: true,\n});\n\n// SELECT\nconn.query(\n 'SELECT 1 + 1 AS test, 2 + 2 AS test;',\n (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 2, 4 ] ]\n */\n }\n);\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 'test' ] ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket-1",children:"RowDataPacket[][]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," option as ",(0,t.jsx)(n.code,{children:"true"})," with multiple queries:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SELECT 1 + 1 AS test;\n SELECT 2 + 2 AS test;\n`;\n\nconn.query(sql, (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"changedRows"})," option is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"affectedRows"})," instead."]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc.:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\nconst sql = `\n SET @1 = 1;\n`;\n\nconn.query(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader-1",children:"ResultSetHeader[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ResultSetHeader[]"})]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For multiples ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc. when using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SET @1 = 1;\n SET @2 = 2;\n`;\n\nconn.query(sql, (_err, results) => {\n console.log(results);\n /**\n * @results: [\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 10,\n warningStatus: 0,\n changedRows: 0\n },\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n ]\n */\n});\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"procedurecallpacket",children:"ProcedureCallPacket"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ProcedureCallPacket"})]})]}]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["By performing a ",(0,t.jsx)(n.strong,{children:"Call Procedure"})," using ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", etc., the return will be a ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})," (even if you perform multiples queries and set ",(0,t.jsx)(n.code,{children:"multipleStatements"})," to ",(0,t.jsx)(n.code,{children:"true"}),"):"]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n/** ResultSetHeader */\nconn.query('DROP PROCEDURE IF EXISTS myProcedure');\n\n/** ResultSetHeader */\nconn.query(`\n CREATE PROCEDURE myProcedure()\n BEGIN\n SET @1 = 1;\n SET @2 = 2;\n END\n `);\n\n/** ProcedureCallPacket */\nconst sql = 'CALL myProcedure()';\n\nconn.query>(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"CREATE PROCEDURE"})," and ",(0,t.jsx)(n.code,{children:"DROP PROCEDURE"}),", these returns will be the ",(0,t.jsx)(n.em,{children:"default"})," ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["By using ",(0,t.jsx)(n.code,{children:"SELECT"})," and ",(0,t.jsx)(n.code,{children:"SHOW"})," queries in a ",(0,t.jsx)(n.strong,{children:"Procedure Call"}),", it groups the results as:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"/** ProcedureCallPacket */\n[RowDataPacket[], ResultSetHeader]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"}),", please see the following examples."]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"okpacket",children:"OkPacket"}),"\n",(0,t.jsx)(c.X,{level:0,message:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,t.jsxs)(n.p,{children:["You can also check some code examples using ",(0,t.jsx)(n.strong,{children:"MySQL2"})," and ",(0,t.jsx)(n.strong,{children:"TypeScript"})," to understand advanced concepts:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/index",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array-multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"}),", ",(0,t.jsx)(n.code,{children:"rowAsArray"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/index",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/row-as-array",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/basic-custom-class",children:["Creating a basic custom ",(0,t.jsx)(n.strong,{children:"MySQL2"})," ",(0,t.jsx)(n.strong,{children:"Class"})]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4673:(e,n,s)=>{s.d(n,{Z:()=>p});var t=s(7294),r=s(512),l=s(2389),c=s(6043);const a={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var o=s(5893);function i(e){return!!e&&("SUMMARY"===e.tagName||i(e.parentElement))}function d(e,n){return!!e&&(e===n||d(e.parentElement,n))}function h(e){let{summary:n,children:s,...h}=e;const u=(0,l.Z)(),x=(0,t.useRef)(null),{collapsed:p,setCollapsed:j}=(0,c.u)({initialState:!h.open}),[m,y]=(0,t.useState)(h.open),g=t.isValidElement(n)?n:(0,o.jsx)("summary",{children:n??"Details"});return(0,o.jsxs)("details",{...h,ref:x,open:m,"data-collapsed":p,className:(0,r.Z)(a.details,u&&a.isBrowser,h.className),onMouseDown:e=>{i(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;i(n)&&d(n,x.current)&&(e.preventDefault(),p?(j(!1),y(!0)):j(!0))},children:[g,(0,o.jsx)(c.z,{lazy:!1,collapsed:p,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),y(!e)},children:(0,o.jsx)("div",{className:a.collapsibleContent,children:s})})]})}const u={details:"details_b_Ee"},x="alert alert--info";function p(e){let{...n}=e;return(0,o.jsx)(h,{...n,className:(0,r.Z)(x,u.details,n.className)})}},8609:(e,n,s)=>{s.d(n,{A:()=>c});var t=s(4673);const r=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var l=s(5893);const c=e=>{let{records:n,open:s}=e;return(0,l.jsx)(t.Z,{open:s,summary:(0,l.jsxs)("summary",{children:[(0,l.jsx)(r,{})," History"]}),className:"history",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Version"}),(0,l.jsx)("th",{children:"Changes"})]})}),(0,l.jsx)("tbody",{children:n.map(((e,n)=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,l.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>u});var t=s(3692),r=s(4297);const l=(0,r.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),c=(0,r.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),a=(0,r.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),o=(0,r.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),i=(0,r.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,r.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:n,message:s}=e;const r={0:{title:"Deprecated",icon:(0,h.jsx)(l,{})},1:{title:"Experimental",icon:(0,h.jsx)(c,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(a,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(o,{})},2:{title:"Stable",icon:(0,h.jsx)(i,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:r[n].title}),r[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(7294),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:o="",children:i,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...r,width:l,height:l,stroke:s,strokeWidth:a?24*Number(c)/Number(l):c,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,o].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(i)?i:[i]]);var u}));return s.displayName=`${e}`,s}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>c});var t=s(7294);const r={},l=t.createContext(r);function c(e){const n=t.useContext(l);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(r):e.components||r:c(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/2bc14e22.7a8d82bf.js.LICENSE.txt b/zh-CN/assets/js/2bc14e22.53969db2.js.LICENSE.txt similarity index 100% rename from zh-CN/assets/js/2bc14e22.7a8d82bf.js.LICENSE.txt rename to zh-CN/assets/js/2bc14e22.53969db2.js.LICENSE.txt diff --git a/zh-CN/assets/js/2bc14e22.7a8d82bf.js b/zh-CN/assets/js/2bc14e22.7a8d82bf.js deleted file mode 100644 index ce51a5828f..0000000000 --- a/zh-CN/assets/js/2bc14e22.7a8d82bf.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 2bc14e22.7a8d82bf.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2839],{4760:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>x,frontMatter:()=>a,metadata:()=>i,toc:()=>h});var t=s(5893),r=s(1151),l=s(8609),c=s(3901);const a={},o="Using MySQL2 with TypeScript",i={id:"documentation/typescript-examples",title:"Using MySQL2 with TypeScript",description:"Installation",source:"@site/docs/documentation/typescript-examples.mdx",sourceDirName:"documentation",slug:"/documentation/typescript-examples",permalink:"/node-mysql2/zh-CN/docs/documentation/typescript-examples",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/typescript-examples.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Promise Wrappers",permalink:"/node-mysql2/zh-CN/docs/documentation/promise-wrapper"},next:{title:"API\u914d\u7f6e\u9879",permalink:"/node-mysql2/zh-CN/docs/api-and-configurations"}},d={},h=[{value:"Installation",id:"installation",level:2},{value:"Usage",id:"usage",level:2},{value:"Connection",id:"connection",level:3},{value:"Pool Connection",id:"pool-connection",level:3},{value:"Query and Execute",id:"query-and-execute",level:3},{value:"A simple query",id:"a-simple-query",level:4},{value:"Type Specification",id:"type-specification",level:2},{value:"RowDataPacket[]",id:"rowdatapacket",level:3},{value:"RowDataPacket[][]",id:"rowdatapacket-1",level:3},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"ResultSetHeader[]",id:"resultsetheader-1",level:3},{value:"ProcedureCallPacket",id:"procedurecallpacket",level:3},{value:"OkPacket",id:"okpacket",level:3},{value:"Examples",id:"examples",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"using-mysql2-with-typescript",children:"Using MySQL2 with TypeScript"}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"@types/node"})," ensure the proper interaction between ",(0,t.jsx)(n.strong,{children:"TypeScript"})," and the ",(0,t.jsx)(n.strong,{children:"Node.js"})," modules used by ",(0,t.jsx)(n.strong,{children:"MySQL2"})," (",(0,t.jsx)(n.em,{children:"net"}),", ",(0,t.jsx)(n.em,{children:"events"}),", ",(0,t.jsx)(n.em,{children:"stream"}),", ",(0,t.jsx)(n.em,{children:"tls"}),", etc.)."]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires ",(0,t.jsx)(n.strong,{children:"TypeScript"})," ",(0,t.jsx)(n.code,{children:">=4.5.2"}),"."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["You can import ",(0,t.jsx)(n.strong,{children:"MySQL2"})," in two ways:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"true"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql from 'mysql2';\nimport mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["By setting the ",(0,t.jsx)(n.code,{children:"esModuleInterop"})," option to ",(0,t.jsx)(n.code,{children:"false"})," in ",(0,t.jsx)(n.code,{children:"tsconfig.json"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import * as mysql from 'mysql2';\nimport * as mysql from 'mysql2/promise';\n"})}),"\n",(0,t.jsx)(n.h3,{id:"connection",children:"Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ConnectionOptions } from 'mysql2';\n\nconst access: ConnectionOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createConnection(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"pool-connection",children:"Pool Connection"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { PoolOptions } from 'mysql2';\n\nconst access: PoolOptions = {\n user: 'test',\n database: 'test',\n};\n\nconst conn = mysql.createPool(access);\n"})}),"\n",(0,t.jsx)(n.h3,{id:"query-and-execute",children:"Query and Execute"}),"\n",(0,t.jsx)(n.h4,{id:"a-simple-query",children:"A simple query"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\nconn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"rows"})," output will be these possible types:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"RowDataPacket[][]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ResultSetHeader[]"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"In this example, you need to manually check the output types"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"type-specification",children:"Type Specification"}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket",children:"RowDataPacket[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(n.p,{children:"An array with the returned rows, for example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n// SELECT\nconn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { test: 2 } ]\n */\n});\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ { Tables_in_test: 'test' } ]\n */\n});\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"rowsAsArray"})," option as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n rowsAsArray: true,\n});\n\n// SELECT\nconn.query(\n 'SELECT 1 + 1 AS test, 2 + 2 AS test;',\n (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 2, 4 ] ]\n */\n }\n);\n\n// SHOW\nconn.query('SHOW TABLES FROM `test`;', (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ 'test' ] ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"rowdatapacket-1",children:"RowDataPacket[][]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsxs)(n.p,{children:["Using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," option as ",(0,t.jsx)(n.code,{children:"true"})," with multiple queries:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { RowDataPacket } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SELECT 1 + 1 AS test;\n SELECT 2 + 2 AS test;\n`;\n\nconn.query(sql, (_err, rows) => {\n console.log(rows);\n /**\n * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"changedRows"})," option is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"affectedRows"})," instead."]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc.:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\nconst sql = `\n SET @1 = 1;\n`;\n\nconn.query(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader-1",children:"ResultSetHeader[]"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ResultSetHeader[]"})]})]}]}),"\n",(0,t.jsxs)(n.p,{children:["For multiples ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", ",(0,t.jsx)(n.code,{children:"DELETE"}),", ",(0,t.jsx)(n.code,{children:"TRUNCATE"}),", etc. when using ",(0,t.jsx)(n.code,{children:"multipleStatements"})," as ",(0,t.jsx)(n.code,{children:"true"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n multipleStatements: true,\n});\n\nconst sql = `\n SET @1 = 1;\n SET @2 = 2;\n`;\n\nconn.query(sql, (_err, results) => {\n console.log(results);\n /**\n * @results: [\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 10,\n warningStatus: 0,\n changedRows: 0\n },\n ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n ]\n */\n});\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"procedurecallpacket",children:"ProcedureCallPacket"}),"\n",(0,t.jsx)(c.X,{level:2}),"\n",(0,t.jsx)(l.A,{records:[{version:"3.5.1",changes:[(0,t.jsxs)(t.Fragment,{children:["Introduce ",(0,t.jsx)(n.strong,{children:"ProcedureCallPacket"})]})]}]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["By performing a ",(0,t.jsx)(n.strong,{children:"Call Procedure"})," using ",(0,t.jsx)(n.code,{children:"INSERT"}),", ",(0,t.jsx)(n.code,{children:"UPDATE"}),", etc., the return will be a ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})," (even if you perform multiples queries and set ",(0,t.jsx)(n.code,{children:"multipleStatements"})," to ",(0,t.jsx)(n.code,{children:"true"}),"):"]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-ts",children:"import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2';\n\nconst conn = mysql.createConnection({\n user: 'test',\n database: 'test',\n});\n\n/** ResultSetHeader */\nconn.query('DROP PROCEDURE IF EXISTS myProcedure');\n\n/** ResultSetHeader */\nconn.query(`\n CREATE PROCEDURE myProcedure()\n BEGIN\n SET @1 = 1;\n SET @2 = 2;\n END\n `);\n\n/** ProcedureCallPacket */\nconst sql = 'CALL myProcedure()';\n\nconn.query>(sql, (_err, result) => {\n console.log(result);\n /**\n * @result: ResultSetHeader {\n fieldCount: 0,\n affectedRows: 0,\n insertId: 0,\n info: '',\n serverStatus: 2,\n warningStatus: 0,\n changedRows: 0\n }\n */\n});\n"})}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"CREATE PROCEDURE"})," and ",(0,t.jsx)(n.code,{children:"DROP PROCEDURE"}),", these returns will be the ",(0,t.jsx)(n.em,{children:"default"})," ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["By using ",(0,t.jsx)(n.code,{children:"SELECT"})," and ",(0,t.jsx)(n.code,{children:"SHOW"})," queries in a ",(0,t.jsx)(n.strong,{children:"Procedure Call"}),", it groups the results as:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"/** ProcedureCallPacket */\n[RowDataPacket[], ResultSetHeader]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"}),", please see the following examples."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"okpacket",children:"OkPacket"}),"\n",(0,t.jsx)(c.X,{level:0,message:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.strong,{children:"OkPacket"})," is deprecated and might be removed in the future major release.",(0,t.jsx)(n.br,{}),"Please use ",(0,t.jsx)(n.strong,{children:"ResultSetHeader"})," instead."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,t.jsxs)(n.p,{children:["You can also check some code examples using ",(0,t.jsx)(n.strong,{children:"MySQL2"})," and ",(0,t.jsx)(n.strong,{children:"TypeScript"})," to understand advanced concepts:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/index",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/row-data/row-as-array-multi-statements",children:["Extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"}),", ",(0,t.jsx)(n.code,{children:"rowAsArray"})," and ",(0,t.jsx)(n.code,{children:"multipleStatements"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/index",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/procedure-call/row-as-array",children:["Checking for ",(0,t.jsx)(n.code,{children:"ResultSetHeader"}),", extending and using ",(0,t.jsx)(n.strong,{children:"Interfaces"})," with ",(0,t.jsx)(n.code,{children:"RowDataPacket"})," and ",(0,t.jsx)(n.code,{children:"rowAsArray"})," from ",(0,t.jsx)(n.code,{children:"ProcedureCallPacket"})]})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsxs)(n.a,{href:"/docs/examples/typescript/basic-custom-class",children:["Creating a basic custom ",(0,t.jsx)(n.strong,{children:"MySQL2"})," ",(0,t.jsx)(n.strong,{children:"Class"})]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4673:(e,n,s)=>{s.d(n,{Z:()=>p});var t=s(7294),r=s(512),l=s(2389),c=s(6043);const a={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var o=s(5893);function i(e){return!!e&&("SUMMARY"===e.tagName||i(e.parentElement))}function d(e,n){return!!e&&(e===n||d(e.parentElement,n))}function h(e){let{summary:n,children:s,...h}=e;const u=(0,l.Z)(),x=(0,t.useRef)(null),{collapsed:p,setCollapsed:j}=(0,c.u)({initialState:!h.open}),[m,y]=(0,t.useState)(h.open),g=t.isValidElement(n)?n:(0,o.jsx)("summary",{children:n??"Details"});return(0,o.jsxs)("details",{...h,ref:x,open:m,"data-collapsed":p,className:(0,r.Z)(a.details,u&&a.isBrowser,h.className),onMouseDown:e=>{i(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;i(n)&&d(n,x.current)&&(e.preventDefault(),p?(j(!1),y(!0)):j(!0))},children:[g,(0,o.jsx)(c.z,{lazy:!1,collapsed:p,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),y(!e)},children:(0,o.jsx)("div",{className:a.collapsibleContent,children:s})})]})}const u={details:"details_b_Ee"},x="alert alert--info";function p(e){let{...n}=e;return(0,o.jsx)(h,{...n,className:(0,r.Z)(x,u.details,n.className)})}},8609:(e,n,s)=>{s.d(n,{A:()=>c});var t=s(4673);const r=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var l=s(5893);const c=e=>{let{records:n,open:s}=e;return(0,l.jsx)(t.Z,{open:s,summary:(0,l.jsxs)("summary",{children:[(0,l.jsx)(r,{})," History"]}),className:"history",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Version"}),(0,l.jsx)("th",{children:"Changes"})]})}),(0,l.jsx)("tbody",{children:n.map(((e,n)=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,l.jsx)("td",{children:(0,l.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,l.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>u});var t=s(3692),r=s(4297);const l=(0,r.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),c=(0,r.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),a=(0,r.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),o=(0,r.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),i=(0,r.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,r.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:n,message:s}=e;const r={0:{title:"Deprecated",icon:(0,h.jsx)(l,{})},1:{title:"Experimental",icon:(0,h.jsx)(c,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(a,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(o,{})},2:{title:"Stable",icon:(0,h.jsx)(i,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:r[n].title}),r[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(7294),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:o="",children:i,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...r,width:l,height:l,stroke:s,strokeWidth:a?24*Number(c)/Number(l):c,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,o].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(i)?i:[i]]);var u}));return s.displayName=`${e}`,s}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>c});var t=s(7294);const r={},l=t.createContext(r);function c(e){const n=t.useContext(l);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(r):e.components||r:c(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/54768732.5f0e7323.js b/zh-CN/assets/js/54768732.5f0e7323.js new file mode 100644 index 0000000000..5e98de09de --- /dev/null +++ b/zh-CN/assets/js/54768732.5f0e7323.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[576],{3990:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>u,metadata:()=>d,toc:()=>p});var t=r(5893),s=r(1151),l=r(4866),a=r(5162),o=r(6393),i=r(4379);const u={sidebar_position:2,tags:["query"]},c="UPDATE",d={id:"examples/queries/simple-queries/update",title:"UPDATE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/update.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/update",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/update.mdx",tags:[{label:"query",permalink:"/node-mysql2/zh-CN/docs/tags/query"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["query"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select"},next:{title:"DELETE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,t.jsxs)(n.p,{children:["The examples below also work for the ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,t.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["query(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>a});r(7294);var t=r(512);const s={tabItem:"tabItem_Ymn6"};var l=r(5893);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var t=r(7294),s=r(512),l=r(2466),a=r(6550),o=r(469),i=r(1980),u=r(7392),c=r(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,u.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[u,d]=m({queryString:r,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,c.Nk)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),b=(()=>{const e=u??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=r(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=r(5893);function j(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.o5)(),c=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(u(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:c,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function q(e){let{lazy:n,children:r,selectedValue:s}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function y(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...n}),(0,g.jsx)(q,{...e,...n})]})}function v(e){const n=(0,f.Z)();return(0,g.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var t=r(7294),s=r(2263),l=r(9286),a=r(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:u}=e;const[c,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(n)?`${b}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(g,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&u?((e,n,r)=>{const t=e.split("\n"),s=`${r} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,u):e;d(n||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,u]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${r}`,children:c})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var t=r(4673),s=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,s.jsx)(t.Z,{open:r,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/54768732.8a0b1c4d.js b/zh-CN/assets/js/54768732.8a0b1c4d.js deleted file mode 100644 index 762e230f2c..0000000000 --- a/zh-CN/assets/js/54768732.8a0b1c4d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[576],{3990:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>u,metadata:()=>d,toc:()=>p});var t=n(5893),s=n(1151),l=n(4866),a=n(5162),o=n(6393),i=n(4379);const u={sidebar_position:2,tags:["query"]},c="UPDATE",d={id:"examples/queries/simple-queries/update",title:"UPDATE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/update.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/update",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/update.mdx",tags:[{label:"query",permalink:"/node-mysql2/zh-CN/docs/tags/query"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["query"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select"},next:{title:"DELETE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const r={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.h1,{id:"update",children:"UPDATE"}),"\n",(0,t.jsxs)(r.p,{children:["The examples below also work for the ",(0,t.jsx)(r.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,t.jsx)(r.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(r.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsxs)(r.strong,{children:["query(options: ",(0,t.jsx)(r.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(r.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(r.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,r,n)=>{n.d(r,{Z:()=>a});n(7294);var t=n(512);const s={tabItem:"tabItem_Ymn6"};var l=n(5893);function a(e){let{children:r,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:n,children:r})}},4866:(e,r,n)=>{n.d(r,{Z:()=>v});var t=n(7294),s=n(512),l=n(2466),a=n(6550),o=n(469),i=n(1980),u=n(7392),c=n(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:n}=e;return(0,t.useMemo)((()=>{const e=r??function(e){return d(e).map((e=>{let{props:{value:r,label:n,attributes:t,default:s}}=e;return{value:r,label:n,attributes:t,default:s}}))}(n);return function(e){const r=(0,u.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,n])}function p(e){let{value:r,tabValues:n}=e;return n.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:n}=e;const s=(0,a.k6)(),l=function(e){let{queryString:r=!1,groupId:n}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:r,groupId:n});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const r=new URLSearchParams(s.location.search);r.set(l,e),s.replace({...s.location,search:r.toString()})}),[l,s])]}function x(e){const{defaultValue:r,queryString:n=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:r,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:r,tabValues:l}))),[u,d]=m({queryString:n,groupId:s}),[x,f]=function(e){let{groupId:r}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,l]=(0,c.Nk)(n);return[s,(0,t.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:s}),b=(()=>{const e=u??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(5893);function j(e){let{className:r,block:n,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.o5)(),c=e=>{const r=e.currentTarget,n=i.indexOf(r),s=o[n].value;s!==t&&(u(r),a(s))},d=e=>{let r=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;r=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;r=i[n]??i[i.length-1];break}}r?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},r),children:o.map((e=>{let{value:r,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===r?0:-1,"aria-selected":t===r,ref:e=>i.push(e),onKeyDown:d,onClick:c,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===r}),children:n??r},r)}))})}function q(e){let{lazy:r,children:n,selectedValue:s}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(r){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,r)=>(0,t.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function y(e){const r=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...r}),(0,g.jsx)(q,{...e,...r})]})}function v(e){const r=(0,f.Z)();return(0,g.jsx)(y,{...e,children:d(e.children)},String(r))}},4379:(e,r,n)=>{n.d(r,{I:()=>i});var t=n(7294),s=n(2263),l=n(9286),a=n(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:r,language:n,extractMethod:i,methodType:u}=e;const[c,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(r)?`${b}${r}`:r;return(0,t.useEffect)((()=>{const e=new AbortController,r=e.signal;return fetch(g,{signal:r}).then((e=>e.text())).then((e=>{const r=i&&u?((e,r,n)=>{const t=e.split("\n"),s=`${n} ${r}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,u):e;d(r||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,u]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${n}`,children:c})})})}},6393:(e,r,n)=>{n.d(r,{Z:()=>l});var t=n(4673),s=n(5893);const l=e=>{let{children:r,open:n,title:l}=e;return(0,s.jsx)(t.Z,{open:n,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:r})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/54eaaaae.18d06985.js b/zh-CN/assets/js/54eaaaae.18d06985.js deleted file mode 100644 index 234ec7a64b..0000000000 --- a/zh-CN/assets/js/54eaaaae.18d06985.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1420],{1:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>h,toc:()=>p});var s=o(5893),r=o(1151),l=o(4866),t=o(5162),c=o(6393),i=o(4379);const a={sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},d="createPool",h={id:"examples/connections/create-pool",title:"createPool",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-pool.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-pool",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-pool",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-pool.mdx",tags:[{label:"createPool",permalink:"/node-mysql2/zh-CN/docs/tags/create-pool"},{label:"URI",permalink:"/node-mysql2/zh-CN/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/zh-CN/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/zh-CN/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/zh-CN/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/zh-CN/docs/tags/socks"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createConnection",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-connection"},next:{title:"createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster"}},u={},p=[{value:"createPool(connectionUri)",id:"createpoolconnectionuri",level:2},{value:"createPool(config)",id:"createpoolconfig",level:2},{value:"createPool(config) \u2014 SHA1",id:"createpoolconfig--sha1",level:2},{value:"createPool(config) \u2014 SSL",id:"createpoolconfig--ssl",level:2},{value:"createPool(config) \u2014 RDS SSL",id:"createpoolconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createPool(config) \u2014 Socks",id:"createpoolconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"createpool",children:"createPool"}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["For queries please see the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,s.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,s.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconnectionuri",children:"createPool(connectionUri)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"createPool(connectionUri: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig",children:"createPool(config)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--sha1",children:"createPool(config) \u2014 SHA1"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--ssl",children:"createPool(config) \u2014 SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,s.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,s.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["See ",(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--rds-ssl",children:"createPool(config) \u2014 RDS SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can use ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,s.jsxs)(n.p,{children:["In that case ",(0,s.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await pool.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,s.jsxs)(t.Z,{value:"callback.js",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n pool.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Issues"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--socks",children:"createPool(config) \u2014 Socks"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"A.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst pool = mysql.createPool({\n stream: socksProxy,\n});\n// highlight-end\n"})})}),(0,s.jsx)(t.Z,{value:"B.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst pool = mysql.createPool({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,s.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),"\n",(0,s.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})}),"\n"]}),"\n",(0,s.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},5162:(e,n,o)=>{o.d(n,{Z:()=>t});o(7294);var s=o(512);const r={tabItem:"tabItem_Ymn6"};var l=o(5893);function t(e){let{children:n,hidden:o,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,t),hidden:o,children:n})}},4866:(e,n,o)=>{o.d(n,{Z:()=>S});var s=o(7294),r=o(512),l=o(2466),t=o(6550),c=o(469),i=o(1980),a=o(7392),d=o(12);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:o,attributes:s,default:r}}=e;return{value:n,label:o,attributes:s,default:r}}))}(o);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function p(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:o}=e;const r=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function g(e){const{defaultValue:n,queryString:o=!1,groupId:r}=e,l=u(e),[t,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=o.find((e=>e.default))??o[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[a,h]=m({queryString:o,groupId:r}),[g,x]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,d.Nk)(o);return[r,(0,s.useCallback)((e=>{o&&l.set(e)}),[o,l])]}({groupId:r}),j=(()=>{const e=a??g;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)}),[h,x,l]),tabValues:l}}var x=o(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=o(5893);function y(e){let{className:n,block:o,selectedValue:s,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,o=i.indexOf(n),r=c[o].value;r!==s&&(a(n),t(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":o},n),children:c.map((e=>{let{value:n,label:o,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:h,onClick:d,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:o??n},n)}))})}function b(e){let{lazy:n,children:o,selectedValue:r}=e;const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:h(e.children)},String(n))}},4379:(e,n,o)=>{o.d(n,{I:()=>i});var s=o(7294),r=o(2263),l=o(9286),t=o(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:o,extractMethod:i,methodType:a}=e;const[d,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(!0),[m,g]=(0,s.useState)(!0),{siteConfig:x}=(0,r.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,o)=>{const s=e.split("\n"),r=`${o} ${n}`;let l=!1,t=0,c="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;h(n||e),p(!1),g(!1)})).catch((()=>{g(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:u?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:m?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${o}`,children:d})})})}},6393:(e,n,o)=>{o.d(n,{Z:()=>l});var s=o(4673),r=o(5893);const l=e=>{let{children:n,open:o,title:l}=e;return(0,r.jsx)(s.Z,{open:o,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/54eaaaae.40d8eca5.js b/zh-CN/assets/js/54eaaaae.40d8eca5.js new file mode 100644 index 0000000000..616fc5332e --- /dev/null +++ b/zh-CN/assets/js/54eaaaae.40d8eca5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1420],{1:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>g,frontMatter:()=>a,metadata:()=>h,toc:()=>p});var s=o(5893),r=o(1151),l=o(4866),t=o(5162),c=o(6393),i=o(4379);const a={sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},d="createPool",h={id:"examples/connections/create-pool",title:"createPool",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/create-pool.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/create-pool",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-pool",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/create-pool.mdx",tags:[{label:"createPool",permalink:"/node-mysql2/zh-CN/docs/tags/create-pool"},{label:"URI",permalink:"/node-mysql2/zh-CN/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/zh-CN/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/zh-CN/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/zh-CN/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/zh-CN/docs/tags/socks"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["createPool","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createConnection",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-connection"},next:{title:"createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster"}},u={},p=[{value:"createPool(connectionUri)",id:"createpoolconnectionuri",level:2},{value:"createPool(config)",id:"createpoolconfig",level:2},{value:"createPool(config) \u2014 SHA1",id:"createpoolconfig--sha1",level:2},{value:"createPool(config) \u2014 SSL",id:"createpoolconfig--ssl",level:2},{value:"createPool(config) \u2014 RDS SSL",id:"createpoolconfig--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"createPool(config) \u2014 Socks",id:"createpoolconfig--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"createpool",children:"createPool"}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["For queries please see the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,s.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,s.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconnectionuri",children:"createPool(connectionUri)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"createPool(connectionUri: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool('mysql://root:password@localhost:3306/test');\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig",children:"createPool(config)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--sha1",children:"createPool(config) \u2014 SHA1"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--ssl",children:"createPool(config) \u2014 SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(t.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,s.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,s.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["See ",(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--rds-ssl",children:"createPool(config) \u2014 RDS SSL"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can use ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,s.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,s.jsxs)(n.p,{children:["In that case ",(0,s.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n const connection = await pool.getConnection();\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await pool.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,s.jsxs)(t.Z,{value:"callback.js",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n\npool.getConnection(function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n pool.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"pool.releaseConnection(connection)"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,s.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Issues"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"createpoolconfig--socks",children:"createPool(config) \u2014 Socks"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["createPool(config: ",(0,s.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(t.Z,{value:"A.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst pool = mysql.createPool({\n stream: socksProxy,\n});\n// highlight-end\n"})})}),(0,s.jsx)(t.Z,{value:"B.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst pool = mysql.createPool({\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// highlight-end\n"})})})]}),"\n",(0,s.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,s.jsxs)("blockquote",{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,s.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),(0,s.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]}),"\n",(0,s.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function g(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},5162:(e,n,o)=>{o.d(n,{Z:()=>t});o(7294);var s=o(512);const r={tabItem:"tabItem_Ymn6"};var l=o(5893);function t(e){let{children:n,hidden:o,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,t),hidden:o,children:n})}},4866:(e,n,o)=>{o.d(n,{Z:()=>S});var s=o(7294),r=o(512),l=o(2466),t=o(6550),c=o(469),i=o(1980),a=o(7392),d=o(12);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return h(e).map((e=>{let{props:{value:n,label:o,attributes:s,default:r}}=e;return{value:n,label:o,attributes:s,default:r}}))}(o);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function p(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:o}=e;const r=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function g(e){const{defaultValue:n,queryString:o=!1,groupId:r}=e,l=u(e),[t,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=o.find((e=>e.default))??o[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[a,h]=m({queryString:o,groupId:r}),[g,x]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,d.Nk)(o);return[r,(0,s.useCallback)((e=>{o&&l.set(e)}),[o,l])]}({groupId:r}),j=(()=>{const e=a??g;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)}),[h,x,l]),tabValues:l}}var x=o(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=o(5893);function y(e){let{className:n,block:o,selectedValue:s,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,o=i.indexOf(n),r=c[o].value;r!==s&&(a(n),t(r))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":o},n),children:c.map((e=>{let{value:n,label:o,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:h,onClick:d,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:o??n},n)}))})}function b(e){let{lazy:n,children:o,selectedValue:r}=e;const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function q(e){const n=g(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function S(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:h(e.children)},String(n))}},4379:(e,n,o)=>{o.d(n,{I:()=>i});var s=o(7294),r=o(2263),l=o(9286),t=o(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:o,extractMethod:i,methodType:a}=e;const[d,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(!0),[m,g]=(0,s.useState)(!0),{siteConfig:x}=(0,r.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,o)=>{const s=e.split("\n"),r=`${o} ${n}`;let l=!1,t=0,c="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;h(n||e),p(!1),g(!1)})).catch((()=>{g(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:u?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:m?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${o}`,children:d})})})}},6393:(e,n,o)=>{o.d(n,{Z:()=>l});var s=o(4673),r=o(5893);const l=e=>{let{children:n,open:o,title:l}=e;return(0,r.jsx)(s.Z,{open:o,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/57495183.26b902a6.js b/zh-CN/assets/js/57495183.26b902a6.js new file mode 100644 index 0000000000..cd71497ffe --- /dev/null +++ b/zh-CN/assets/js/57495183.26b902a6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5003],{4304:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>t,metadata:()=>c,toc:()=>o});var r=s(5893),i=s(1151);const t={},l="MySQL Server API",c={id:"documentation/mysql-server",title:"MySQL Server API",description:"Server",source:"@site/docs/documentation/mysql-server.mdx",sourceDirName:"documentation",slug:"/documentation/mysql-server",permalink:"/node-mysql2/zh-CN/docs/documentation/mysql-server",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/mysql-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Extra Features",permalink:"/node-mysql2/zh-CN/docs/documentation/extras"},next:{title:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/documentation/prepared-statements"}},d={},o=[{value:"Server",id:"server",level:2},{value:"Events",id:"events",level:3},{value:"Connection",id:"connection",level:2},{value:"Events",id:"events-1",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"mysql-server-api",children:"MySQL Server API"}),"\n",(0,r.jsx)(n.h2,{id:"server",children:"Server"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"createServer()"})," - creates server instance"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Server.listen"})," - listen port / unix socket (same arguments as ",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback",children:"net.Server.listen"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events",children:"Events"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"connect"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"new incoming connection."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"connection",children:"Connection"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send server handshake initialisation packet, wait handshake response and start listening for commands"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeOk({ affectedRows: num, insertId: num })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["send ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/overview.html#packet-OK_Packet",children:"OK packet"})," to client"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeEof(warnings, statusFlags)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send EOF packet"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextResult(rows, fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["write query result to client. Rows and fields are in the same format as in ",(0,r.jsx)(n.code,{children:"connection.query"})," callback."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeColumns(fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write fields + EOF packets."}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextRow(row)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write array (not hash!) of values as result row"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"TODO:"})," binary protocol"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events-1",children:"Events"}),"\n",(0,r.jsxs)(n.p,{children:["Every command packet received by the server will be emitted as a ",(0,r.jsx)(n.strong,{children:"packet"})," event with the parameters:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"packet:"})," Packet","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The packet itself"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"knownCommand:"})," boolean","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"is this command known to the server"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"*commandCode:"})," number","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"the parsed command code (first byte)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["In addition special events are emitted for ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/text-protocol.html",children:"commands"})," received from the client. If no listener is present a fallback behavior will be invoked."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"quit()"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: close the connection"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"init_db(schemaName: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return OK"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"query(sql: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"field_list(table: string, fields: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return ER_WARN_DEPRECATED_SYNTAX"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"ping()"})," - Default: return OK"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>l});var r=s(7294);const i={},t=r.createContext(i);function l(e){const n=r.useContext(t);return r.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(i):e.components||i:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/57495183.339d0eab.js b/zh-CN/assets/js/57495183.339d0eab.js deleted file mode 100644 index e23da5b664..0000000000 --- a/zh-CN/assets/js/57495183.339d0eab.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5003],{4304:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>t,metadata:()=>c,toc:()=>o});var r=s(5893),i=s(1151);const t={},l="MySQL Server API",c={id:"documentation/mysql-server",title:"MySQL Server API",description:"Server",source:"@site/docs/documentation/mysql-server.mdx",sourceDirName:"documentation",slug:"/documentation/mysql-server",permalink:"/node-mysql2/zh-CN/docs/documentation/mysql-server",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/mysql-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Extra Features",permalink:"/node-mysql2/zh-CN/docs/documentation/extras"},next:{title:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/documentation/prepared-statements"}},d={},o=[{value:"Server",id:"server",level:2},{value:"Events",id:"events",level:3},{value:"Connection",id:"connection",level:2},{value:"Events",id:"events-1",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"mysql-server-api",children:"MySQL Server API"}),"\n",(0,r.jsx)(n.h2,{id:"server",children:"Server"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"createServer()"})," - creates server instance"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Server.listen"})," - listen port / unix socket (same arguments as ",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback",children:"net.Server.listen"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events",children:"Events"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"connect"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"new incoming connection."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"connection",children:"Connection"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send server handshake initialisation packet, wait handshake response and start listening for commands"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeOk({ affectedRows: num, insertId: num })"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["send ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/overview.html#packet-OK_Packet",children:"OK packet"})," to client"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeEof(warnings, statusFlags)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"send EOF packet"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextResult(rows, fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["write query result to client. Rows and fields are in the same format as in ",(0,r.jsx)(n.code,{children:"connection.query"})," callback."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeColumns(fields)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write fields + EOF packets."}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"writeTextRow(row)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"write array (not hash!) of values as result row"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"TODO:"})," binary protocol"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"events-1",children:"Events"}),"\n",(0,r.jsxs)(n.p,{children:["Every command packet received by the server will be emitted as a ",(0,r.jsx)(n.strong,{children:"packet"})," event with the parameters:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"packet:"})," Packet","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"The packet itself"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"knownCommand:"})," boolean","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"is this command known to the server"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"*commandCode:"})," number","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"the parsed command code (first byte)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["In addition special events are emitted for ",(0,r.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/text-protocol.html",children:"commands"})," received from the client. If no listener is present a fallback behavior will be invoked."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"quit()"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: close the connection"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"init_db(schemaName: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return OK"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"query(sql: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"field_list(table: string, fields: string)"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Default: return ER_WARN_DEPRECATED_SYNTAX"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"ping()"})," - Default: return OK"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},1151:(e,n,s)=>{s.d(n,{Z:()=>c,a:()=>l});var r=s(7294);const i={},t=r.createContext(i);function l(e){const n=r.useContext(t);return r.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(i):e.components||i:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/59e52bc2.0388a862.js b/zh-CN/assets/js/59e52bc2.0388a862.js deleted file mode 100644 index dcd5c6764d..0000000000 --- a/zh-CN/assets/js/59e52bc2.0388a862.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[641],{8602:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>h,contentTitle:()=>u,default:()=>x,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=n(5893),s=n(1151),l=n(4866),a=n(5162),o=n(6393),i=n(4379);const c={sidebar_position:3,tags:["query"]},u="DELETE",d={id:"examples/queries/simple-queries/delete",title:"DELETE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/delete.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/delete",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/delete.mdx",tags:[{label:"query",permalink:"/node-mysql2/zh-CN/docs/tags/query"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["query"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update"},next:{title:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const r={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.h1,{id:"delete",children:"DELETE"}),"\n",(0,t.jsxs)(r.p,{children:["The examples below also work for the ",(0,t.jsx)(r.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,t.jsx)(r.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(r.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(r.blockquote,{children:["\n",(0,t.jsx)(r.p,{children:(0,t.jsxs)(r.strong,{children:["query(options: ",(0,t.jsx)(r.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"result"}),": contains a ",(0,t.jsx)(r.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(r.admonition,{type:"info",children:(0,t.jsxs)(r.p,{children:["The connection used for the query (",(0,t.jsx)(r.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(r.code,{children:"createConnection"}),", ",(0,t.jsx)(r.code,{children:"createPool"})," or ",(0,t.jsx)(r.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(r.hr,{}),"\n",(0,t.jsx)(r.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(r.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(r.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,r,n)=>{n.d(r,{Z:()=>a});n(7294);var t=n(512);const s={tabItem:"tabItem_Ymn6"};var l=n(5893);function a(e){let{children:r,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:n,children:r})}},4866:(e,r,n)=>{n.d(r,{Z:()=>v});var t=n(7294),s=n(512),l=n(2466),a=n(6550),o=n(469),i=n(1980),c=n(7392),u=n(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:n}=e;return(0,t.useMemo)((()=>{const e=r??function(e){return d(e).map((e=>{let{props:{value:r,label:n,attributes:t,default:s}}=e;return{value:r,label:n,attributes:t,default:s}}))}(n);return function(e){const r=(0,c.l)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,n])}function p(e){let{value:r,tabValues:n}=e;return n.some((e=>e.value===r))}function m(e){let{queryString:r=!1,groupId:n}=e;const s=(0,a.k6)(),l=function(e){let{queryString:r=!1,groupId:n}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:r,groupId:n});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const r=new URLSearchParams(s.location.search);r.set(l,e),s.replace({...s.location,search:r.toString()})}),[l,s])]}function x(e){const{defaultValue:r,queryString:n=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:r,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:r,tabValues:l}))),[c,d]=m({queryString:n,groupId:s}),[x,f]=function(e){let{groupId:r}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,l]=(0,u.Nk)(n);return[s,(0,t.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:s}),b=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=n(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(5893);function j(e){let{className:r,block:n,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const r=e.currentTarget,n=i.indexOf(r),s=o[n].value;s!==t&&(c(r),a(s))},d=e=>{let r=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;r=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;r=i[n]??i[i.length-1];break}}r?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},r),children:o.map((e=>{let{value:r,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===r?0:-1,"aria-selected":t===r,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===r}),children:n??r},r)}))})}function y(e){let{lazy:r,children:n,selectedValue:s}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(r){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,r)=>(0,t.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function q(e){const r=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...r}),(0,g.jsx)(y,{...e,...r})]})}function v(e){const r=(0,f.Z)();return(0,g.jsx)(q,{...e,children:d(e.children)},String(r))}},4379:(e,r,n)=>{n.d(r,{I:()=>i});var t=n(7294),s=n(2263),l=n(9286),a=n(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:r,language:n,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(r)?`${b}${r}`:r;return(0,t.useEffect)((()=>{const e=new AbortController,r=e.signal;return fetch(g,{signal:r}).then((e=>e.text())).then((e=>{const r=i&&c?((e,r,n)=>{const t=e.split("\n"),s=`${n} ${r}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(r||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${n}`,children:u})})})}},6393:(e,r,n)=>{n.d(r,{Z:()=>l});var t=n(4673),s=n(5893);const l=e=>{let{children:r,open:n,title:l}=e;return(0,s.jsx)(t.Z,{open:n,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:r})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/59e52bc2.4de73c5b.js b/zh-CN/assets/js/59e52bc2.4de73c5b.js new file mode 100644 index 0000000000..2b3fa26b34 --- /dev/null +++ b/zh-CN/assets/js/59e52bc2.4de73c5b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[641],{8602:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>x,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=r(5893),s=r(1151),l=r(4866),a=r(5162),o=r(6393),i=r(4379);const c={sidebar_position:3,tags:["query"]},u="DELETE",d={id:"examples/queries/simple-queries/delete",title:"DELETE",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/delete.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/delete",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/delete.mdx",tags:[{label:"query",permalink:"/node-mysql2/zh-CN/docs/tags/query"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["query"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update"},next:{title:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions-1",level:3}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,t.jsxs)(n.p,{children:["The examples below also work for the ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,t.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,t.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-next-line\n const [result, fields] = await connection.query(sql);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(sql, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["query(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\n // highlight-start\n const [result, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function x(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>a});r(7294);var t=r(512);const s={tabItem:"tabItem_Ymn6"};var l=r(5893);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(s.tabItem,a),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var t=r(7294),s=r(512),l=r(2466),a=r(6550),o=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function m(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=m({queryString:r,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,u.Nk)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),b=(()=>{const e=c??x;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{b&&i(b)}),[b]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=r(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=r(5893);function j(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),s=o[r].value;s!==t&&(c(n),a(s))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":r},n),children:o.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,s.Z)("tabs__item",b.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:s}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s})))})}function q(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,s.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(j,{...e,...n}),(0,g.jsx)(y,{...e,...n})]})}function v(e){const n=(0,f.Z)();return(0,g.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var t=r(7294),s=r(2263),l=r(9286),a=r(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[m,x]=(0,t.useState)(!0),{siteConfig:f}=(0,s.Z)(),b=f.baseUrl.replace(/\/$/,""),g=/^\//.test(n)?`${b}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(g,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const t=e.split("\n"),s=`${r} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(s)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),x(!1)})).catch((()=>{x(!0),p(!1)})),()=>{e.abort()}}),[g,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:g}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var t=r(4673),s=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,s.jsx)(t.Z,{open:r,className:"faq",summary:(0,s.jsx)("summary",{children:(0,s.jsx)("strong",{children:l})}),children:(0,s.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/7ccab252.674014b3.js b/zh-CN/assets/js/7ccab252.674014b3.js deleted file mode 100644 index 942685ad2a..0000000000 --- a/zh-CN/assets/js/7ccab252.674014b3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8054],{3467:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>a,metadata:()=>d,toc:()=>l});var n=t(5893),r=t(1151);const a={},i="Prepared Statements",d={id:"examples/queries/prepared-statements/index",title:"Prepared Statements",description:"MySQL2 provides execute helper which will prepare and query the statement.",source:"@site/docs/examples/queries/prepared-statements/index.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"DELETE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete"},next:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert"}},c={},l=[];function p(e){const s={a:"a",admonition:"admonition",code:"code",h1:"h1",hr:"hr",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h1,{id:"prepared-statements",children:"Prepared Statements"}),"\n",(0,n.jsxs)(s.p,{children:["MySQL2 provides ",(0,n.jsx)(s.code,{children:"execute"})," helper which will prepare and query the statement.\nYou can also manually prepare / unprepare statement with ",(0,n.jsx)(s.code,{children:"prepare"})," / ",(0,n.jsx)(s.code,{children:"unprepare"})," methods."]}),"\n",(0,n.jsxs)(s.p,{children:["See detailed documentaion in ",(0,n.jsx)(s.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"}),"."]}),"\n",(0,n.jsx)(s.admonition,{type:"tip",children:(0,n.jsxs)(s.p,{children:["If you execute same statement again, it will be picked form a ",(0,n.jsx)(s.strong,{children:"LRU cache"})," which will save query preparation time and give better performance."]})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,n.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/insert",children:(0,n.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,n.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,n.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,n.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function o(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},1151:(e,s,t)=>{t.d(s,{Z:()=>d,a:()=>i});var n=t(7294);const r={},a=n.createContext(r);function i(e){const s=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/7ccab252.f3964949.js b/zh-CN/assets/js/7ccab252.f3964949.js new file mode 100644 index 0000000000..e04d283ae1 --- /dev/null +++ b/zh-CN/assets/js/7ccab252.f3964949.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8054],{3467:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>a,metadata:()=>d,toc:()=>l});var n=t(5893),r=t(1151);const a={},i="Prepared Statements",d={id:"examples/queries/prepared-statements/index",title:"Prepared Statements",description:"MySQL2 provides execute helper which will prepare and query the statement.",source:"@site/docs/examples/queries/prepared-statements/index.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"DELETE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete"},next:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert"}},c={},l=[];function p(e){const s={a:"a",admonition:"admonition",code:"code",h1:"h1",input:"input",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h1,{id:"prepared-statements",children:"Prepared Statements"}),"\n",(0,n.jsxs)(s.p,{children:["MySQL2 provides ",(0,n.jsx)(s.code,{children:"execute"})," helper which will prepare and query the statement.\nYou can also manually prepare / unprepare statement with ",(0,n.jsx)(s.code,{children:"prepare"})," / ",(0,n.jsx)(s.code,{children:"unprepare"})," methods."]}),"\n",(0,n.jsxs)(s.p,{children:["See detailed documentaion in ",(0,n.jsx)(s.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"}),"."]}),"\n",(0,n.jsx)(s.admonition,{type:"tip",children:(0,n.jsxs)(s.p,{children:["If you execute same statement again, it will be picked form a ",(0,n.jsx)(s.strong,{children:"LRU cache"})," which will save query preparation time and give better performance."]})}),"\n",(0,n.jsx)("hr",{}),"\n",(0,n.jsx)(s.p,{children:"Usage examples:"}),"\n",(0,n.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/insert",children:(0,n.jsx)(s.strong,{children:"INSERT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,n.jsx)(s.strong,{children:"SELECT"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/update",children:(0,n.jsx)(s.strong,{children:"UPDATE"})})]}),"\n",(0,n.jsxs)(s.li,{className:"task-list-item",children:[(0,n.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,n.jsx)(s.a,{href:"/docs/examples/queries/prepared-statements/delete",children:(0,n.jsx)(s.strong,{children:"DELETE"})})]}),"\n"]})]})}function o(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},1151:(e,s,t)=>{t.d(s,{Z:()=>d,a:()=>i});var n=t(7294);const r={},a=n.createContext(r);function i(e){const s=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/7fbd6b3a.e052fa1c.js b/zh-CN/assets/js/7fbd6b3a.e052fa1c.js new file mode 100644 index 0000000000..49d5f3b6a7 --- /dev/null +++ b/zh-CN/assets/js/7fbd6b3a.e052fa1c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9964],{8937:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>i,metadata:()=>d,toc:()=>p});var r=s(5893),t=s(1151),l=s(4866),a=s(5162),o=s(6393),c=s(4379);const i={sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="SELECT",d={id:"examples/queries/prepared-statements/select",title:"SELECT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/select.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/select",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/select.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,r.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-next-line\n const [rows, fields] = await connection.execute(sql, values);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(sql, values, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,r.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,r.jsx)(c.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var r=s(7294),t=s(512),l=s(2466),a=s(6550),o=s(469),c=s(1980),i=s(7392),u=s(12);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,i.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const t=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,l=h(e),[a,c]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[i,d]=x({queryString:s,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:t}),j=(()=>{const e=i??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&c(j)}),[j]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:r,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),t=o[s].value;t!==r&&(i(n),a(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>c.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:t}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var r=s(7294),t=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:i}=e;const[u,d]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[x,m]=(0,r.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&i?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let l=!1,a=0,o="";for(const c of r)if(c.includes(t)&&(l=!0),l&&(c.includes("{")&&a++,o+=c+"\n",c.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,c,i):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,c,i]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),t=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/7fbd6b3a.e365c3b2.js b/zh-CN/assets/js/7fbd6b3a.e365c3b2.js deleted file mode 100644 index a74b067de7..0000000000 --- a/zh-CN/assets/js/7fbd6b3a.e365c3b2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9964],{8937:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>i,metadata:()=>d,toc:()=>p});var r=s(5893),t=s(1151),l=s(4866),a=s(5162),o=s(6393),c=s(4379);const i={sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="SELECT",d={id:"examples/queries/prepared-statements/select",title:"SELECT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/select.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/select",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/select.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,r.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-next-line\n const [rows, fields] = await connection.execute(sql, values);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(sql, values, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["execute(options: ",(0,r.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\n const values = ['Page', 45];\n\n // highlight-start\n const [rows, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(a.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?';\nconst values = ['Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The connection used for the query (",(0,r.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,r.jsx)(n.code,{children:"createConnection"}),", ",(0,r.jsx)(n.code,{children:"createPool"})," or ",(0,r.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,r.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,r.jsx)(c.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var r=s(512);const t={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(t.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var r=s(7294),t=s(512),l=s(2466),a=s(6550),o=s(469),c=s(1980),i=s(7392),u=s(12);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}))}(s);return function(e){const n=(0,i.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const t=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,l=h(e),[a,c]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[i,d]=x({queryString:s,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(s);return[t,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:t}),j=(()=>{const e=i??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&c(j)}),[j]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:r,selectValue:a,tabValues:o}=e;const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),t=o[s].value;t!==r&&(i(n),a(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>c.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:t}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var r=s(7294),t=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:i}=e;const[u,d]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[x,m]=(0,r.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&i?((e,n,s)=>{const r=e.split("\n"),t=`${s} ${n}`;let l=!1,a=0,o="";for(const c of r)if(c.includes(t)&&(l=!0),l&&(c.includes("{")&&a++,o+=c+"\n",c.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,c,i):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,c,i]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),t=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,t.jsx)(r.Z,{open:s,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/8b8ccc10.9bf8a5cf.js b/zh-CN/assets/js/8b8ccc10.9bf8a5cf.js deleted file mode 100644 index b2f740bb3e..0000000000 --- a/zh-CN/assets/js/8b8ccc10.9bf8a5cf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8534],{3961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="DELETE",d={id:"examples/queries/prepared-statements/delete",title:"DELETE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/delete.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/delete",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/delete.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update"},next:{title:"Binlog Watcher",permalink:"/node-mysql2/zh-CN/docs/examples/binlog-watcher"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/8b8ccc10.e5751b58.js b/zh-CN/assets/js/8b8ccc10.e5751b58.js new file mode 100644 index 0000000000..e1a9821c0d --- /dev/null +++ b/zh-CN/assets/js/8b8ccc10.e5751b58.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8534],{3961:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="DELETE",d={id:"examples/queries/prepared-statements/delete",title:"DELETE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/delete.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/delete",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/delete.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update"},next:{title:"Binlog Watcher",permalink:"/node-mysql2/zh-CN/docs/examples/binlog-watcher"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"delete",children:"DELETE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\n const values = ['Page'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1';\nconst values = ['Page'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/8fcb4d7f.8743faa4.js b/zh-CN/assets/js/8fcb4d7f.8743faa4.js new file mode 100644 index 0000000000..3a347f5788 --- /dev/null +++ b/zh-CN/assets/js/8fcb4d7f.8743faa4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[81],{3050:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=r(5893),t=r(1151),l=r(4866),o=r(5162),a=r(6393),i=r(4379);const c={sidebar_position:1,tags:["query"]},u="SELECT",d={id:"examples/queries/simple-queries/select",title:"SELECT",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/select.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/select",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/select.mdx",tags:[{label:"query",permalink:"/node-mysql2/zh-CN/docs/tags/query"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["query"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"query(options) \u2014 Row as Array",id:"queryoptions--row-as-array",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions-1",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,s.jsxs)(n.p,{children:["The examples below also work for the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,s.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,s.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-next-line\n const [rows, fields] = await connection.query(sql);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(sql, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions--row-as-array",children:"query(options) \u2014 Row as Array"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n rowsAsArray: true,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n rowsAsArray: true,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server as array"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,s.jsx)(a.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>o});r(7294);var s=r(512);const t={tabItem:"tabItem_Ymn6"};var l=r(5893);function o(e){let{children:n,hidden:r,className:o}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(t.tabItem,o),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var s=r(7294),t=r(512),l=r(2466),o=r(6550),a=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:s,default:t}}=e;return{value:n,label:r,attributes:s,default:t}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:r}=e;const t=(0,o.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:r=!1,groupId:t}=e,l=h(e),[o,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=r.find((e=>e.default))??r[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:r,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(r);return[t,(0,s.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:t}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,a.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:o,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=r(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=r(5893);function b(e){let{className:n,block:r,selectedValue:s,selectValue:o,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),t=a[r].value;t!==s&&(c(n),o(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":r},n),children:a.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:t}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(y,{...e,...n})]})}function v(e){const n=(0,g.Z)();return(0,f.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var s=r(7294),t=r(2263),l=r(9286),o=r(5893);const a=()=>(0,o.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const s=e.split("\n"),t=`${r} ${n}`;let l=!1,o=0,a="";for(const i of s)if(i.includes(t)&&(l=!0),l&&(i.includes("{")&&o++,a+=i+"\n",i.includes("}")&&(o--,0===o)))break;return a.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,o.jsx)(o.Fragment,{children:h?(0,o.jsx)(a,{}):(0,o.jsx)(o.Fragment,{children:x?(0,o.jsxs)("div",{children:["Unable to access the requested link: ",(0,o.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,o.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var s=r(4673),t=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/8fcb4d7f.b5ad74bd.js b/zh-CN/assets/js/8fcb4d7f.b5ad74bd.js deleted file mode 100644 index 913799d72b..0000000000 --- a/zh-CN/assets/js/8fcb4d7f.b5ad74bd.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[81],{3050:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=r(5893),t=r(1151),l=r(4866),o=r(5162),a=r(6393),i=r(4379);const c={sidebar_position:1,tags:["query"]},u="SELECT",d={id:"examples/queries/simple-queries/select",title:"SELECT",description:"The examples below also work for the execute method.",source:"@site/docs/examples/queries/simple-queries/select.mdx",sourceDirName:"examples/queries/simple-queries",slug:"/examples/queries/simple-queries/select",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/simple-queries/select.mdx",tags:[{label:"query",permalink:"/node-mysql2/zh-CN/docs/tags/query"}],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,tags:["query"]},sidebar:"examples",previous:{title:"INSERT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert"},next:{title:"UPDATE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update"}},h={},p=[{value:"query(sql)",id:"querysql",level:2},{value:"query(options)",id:"queryoptions",level:2},{value:"query(options) \u2014 Row as Array",id:"queryoptions--row-as-array",level:2},{value:"Glossary",id:"glossary",level:2},{value:"QueryOptions",id:"queryoptions-1",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"select",children:"SELECT"}),"\n",(0,s.jsxs)(n.p,{children:["The examples below also work for the ",(0,s.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements/select",children:(0,s.jsx)(n.code,{children:"execute"})})," method."]}),"\n",(0,s.jsx)(n.h2,{id:"querysql",children:"query(sql)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"query(sql: string)"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-next-line\n const [rows, fields] = await connection.query(sql);\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(sql, (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions",children:"query(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"queryoptions--row-as-array",children:"query(options) \u2014 Row as Array"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["query(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(o.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\n // highlight-start\n const [rows, fields] = await connection.query({\n sql,\n rowsAsArray: true,\n // ... other options\n });\n // highlight-end\n\n console.log(rows);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(o.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45';\n\nconnection.query(\n {\n sql,\n rowsAsArray: true,\n // ... other options\n },\n (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"rows"})," contains rows returned by server as array"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about rows, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:".query()"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions-1",children:"QueryOptions"}),"\n",(0,s.jsx)(a.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,r)=>{r.d(n,{Z:()=>o});r(7294);var s=r(512);const t={tabItem:"tabItem_Ymn6"};var l=r(5893);function o(e){let{children:n,hidden:r,className:o}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(t.tabItem,o),hidden:r,children:n})}},4866:(e,n,r)=>{r.d(n,{Z:()=>v});var s=r(7294),t=r(512),l=r(2466),o=r(6550),a=r(469),i=r(1980),c=r(7392),u=r(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:r,attributes:s,default:t}}=e;return{value:n,label:r,attributes:s,default:t}}))}(r);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function p(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:r}=e;const t=(0,o.k6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function m(e){const{defaultValue:n,queryString:r=!1,groupId:t}=e,l=h(e),[o,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=r.find((e=>e.default))??r[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:r,groupId:t}),[m,g]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,u.Nk)(r);return[t,(0,s.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:t}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,a.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:o,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=r(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=r(5893);function b(e){let{className:n,block:r,selectedValue:s,selectValue:o,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,r=i.indexOf(n),t=a[r].value;t!==s&&(c(n),o(t))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;n=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;n=i[r]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.Z)("tabs",{"tabs--block":r},n),children:a.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":s===n}),children:r??n},n)}))})}function y(e){let{lazy:n,children:r,selectedValue:t}=e;const l=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,t.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(y,{...e,...n})]})}function v(e){const n=(0,g.Z)();return(0,f.jsx)(q,{...e,children:d(e.children)},String(n))}},4379:(e,n,r)=>{r.d(n,{I:()=>i});var s=r(7294),t=r(2263),l=r(9286),o=r(5893);const a=()=>(0,o.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:r,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:g}=(0,t.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,r)=>{const s=e.split("\n"),t=`${r} ${n}`;let l=!1,o=0,a="";for(const i of s)if(i.includes(t)&&(l=!0),l&&(i.includes("{")&&o++,a+=i+"\n",i.includes("}")&&(o--,0===o)))break;return a.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,o.jsx)(o.Fragment,{children:h?(0,o.jsx)(a,{}):(0,o.jsx)(o.Fragment,{children:x?(0,o.jsxs)("div",{children:["Unable to access the requested link: ",(0,o.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,o.jsx)(l.Z,{className:`language-${r}`,children:u})})})}},6393:(e,n,r)=>{r.d(n,{Z:()=>l});var s=r(4673),t=r(5893);const l=e=>{let{children:n,open:r,title:l}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:l})}),children:(0,t.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/9df47158.3745d328.js b/zh-CN/assets/js/9df47158.3745d328.js new file mode 100644 index 0000000000..0d5613a18b --- /dev/null +++ b/zh-CN/assets/js/9df47158.3745d328.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9010],{9964:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>d,toc:()=>h});var t=s(5893),o=s(1151),r=s(4866),l=s(5162),a=s(4442);const i={slug:"/",position:1,title:"Quickstart",description:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316"},c="MySQL2",d={id:"index",title:"Quickstart",description:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316",source:"@site/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.mdx",sourceDirName:".",slug:"/",permalink:"/node-mysql2/zh-CN/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/index.mdx",tags:[],version:"current",frontMatter:{slug:"/",position:1,title:"Quickstart",description:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316"},sidebar:"docs",next:{title:"MySQL2\u7684\u5386\u53f2\u4ee5\u53ca\u9009\u62e9\u539f\u56e0",permalink:"/node-mysql2/zh-CN/docs/history-and-why-mysq2"}},u={},h=[{value:"\u5b89\u88c5",id:"\u5b89\u88c5",level:2},{value:"\u67e5\u8be2\u6570\u636e",id:"\u67e5\u8be2\u6570\u636e",level:3},{value:"SQL\u9884\u5904\u7406\u7684\u4f7f\u7528",id:"sql\u9884\u5904\u7406\u7684\u4f7f\u7528",level:3},{value:"\u8fde\u63a5\u6c60\u7684\u4f7f\u7528",id:"using-connection-pools",level:3},{value:"Promise\u5c01\u88c5",id:"promise\u5c01\u88c5",level:3},{value:"\u7ed3\u679c\u8fd4\u56de",id:"\u7ed3\u679c\u8fd4\u56de",level:3},{value:"\u8fde\u63a5\u7ea7\u522b",id:"\u8fde\u63a5\u7ea7\u522b",level:4},{value:"\u67e5\u8be2\u7ea7\u522b",id:"\u67e5\u8be2\u7ea7\u522b",level:4}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.V,{title:"MySQL2 | Quickstart"}),"\n",(0,t.jsx)(n.h1,{id:"mysql2",children:"MySQL2"}),"\n","\n",(0,t.jsx)(n.p,{children:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316\u3002\u652f\u6301SQL\u9884\u5904\u7406\u3001\u975eUTF-8\u7f16\u7801\u652f\u6301\u3001\u4e8c\u8fdb\u5236\u6587\u4ef6\u7f16\u7801\u652f\u6301\u3001\u538b\u7f29\u548cSSL\u7b49\u7b49 \u67e5\u770b\u66f4\u591a\u3002"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/v/mysql2.svg",alt:"NPM Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/dm/mysql2.svg",alt:"NPM Downloads"})}),"\n",(0,t.jsx)(n.a,{href:"https://nodejs.org/download/",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/node/v/mysql2.svg",alt:"Node.js Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/blob/master/License",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000",alt:"License"})})]}),"\n",(0,t.jsx)(n.h2,{id:"\u5b89\u88c5",children:"\u5b89\u88c5"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 \u53ef\u4ee5\u8de8\u5e73\u53f0\u4f7f\u7528\uff0c\u6beb\u65e0\u7591\u95ee\u53ef\u4ee5\u5b89\u88c5\u5728 Linux\u3001Mac OS \u6216 Windows \u4e0a\u3002"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\n"})})}),(0,t.jsxs)(l.Z,{value:"TypeScript",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),(0,t.jsxs)(n.p,{children:["For TypeScript documentation and examples, see ",(0,t.jsx)(n.a,{href:"/docs/documentation/typescript-examples",children:"here"}),"."]})]})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"\u67e5\u8be2\u6570\u636e",children:"\u67e5\u8be2\u6570\u636e"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more queries examples, please visit the example sections ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,t.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// \u5bfc\u5165\u6a21\u5757\nimport mysql from 'mysql2/promise';\n\n// \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// \u7b80\u5355\u67e5\u8be2\ntry {\n const [results, fields] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45'\n );\n\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n} catch (err) {\n console.log(err);\n}\n\n// \u4f7f\u7528\u5360\u4f4d\u7b26\ntry {\n const [results] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45]\n );\n\n console.log(results);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// \u5bfc\u5165\u6a21\u5757\nconst mysql = require('mysql2');\n\n// \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// \u7b80\u5355\u67e5\u8be2\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45',\n function (err, results, fields) {\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n }\n);\n\n// \u4f7f\u7528\u5360\u4f4d\u7b26\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45],\n function (err, results) {\n console.log(results);\n }\n);\n"})})})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"sql\u9884\u5904\u7406\u7684\u4f7f\u7528",children:"SQL\u9884\u5904\u7406\u7684\u4f7f\u7528"}),"\n",(0,t.jsx)(n.p,{children:"\u4f7f\u7528 MySQL2\uff0c\u60a8\u8fd8\u53ef\u4ee5\u63d0\u524d\u51c6\u5907\u597dSQL\u9884\u5904\u7406\u8bed\u53e5\u3002 \u4f7f\u7528\u51c6\u5907\u597d\u7684SQL\u9884\u5904\u7406\u8bed\u53e5\uff0cMySQL \u4e0d\u5fc5\u6bcf\u6b21\u90fd\u4e3a\u76f8\u540c\u7684\u67e5\u8be2\u505a\u51c6\u5907\uff0c\u8fd9\u4f1a\u5e26\u6765\u66f4\u597d\u7684\u6027\u80fd\u3002 \u5982\u679c\u60a8\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u5b83\u4eec\u5f88\u91cd\u8981\uff0c\u8bf7\u67e5\u770b\u8fd9\u4e9b\u8ba8\u8bba\uff1a"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks",children:"\u5982\u4f55\u9632\u6b62\u9884\u5904\u7406\u8bed\u53e5SQL\u6ce8\u5165\u653b\u51fb"})}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u63d0\u4f9b\u4e86 ",(0,t.jsx)(n.code,{children:"execute"})," \u8f85\u52a9\u51fd\u6570\uff0c\u5b83\u5c06\u51c6\u5907\u548c\u67e5\u8be2\u8bed\u53e5\u3002 \u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"prepare"})," / ",(0,t.jsx)(n.code,{children:"unprepare"})," \u65b9\u6cd5\u624b\u52a8\u51c6\u5907/\u53d6\u6d88\u51c6\u5907\u3002"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Prepared Statements and Placeholders examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // execute \u5c06\u5728\u5185\u90e8\u8c03\u7528 prepare \u548c query\n const [results, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53]\n );\n\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// execute \u5c06\u5728\u5185\u90e8\u8c03\u7528 prepare \u548c query\nconnection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53],\n function (err, results, fields) {\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsx)(n.p,{children:"\u5982\u679c\u518d\u6b21\u6267\u884c\u76f8\u540c\u7684\u8bed\u53e5\uff0c\u4ed6\u5c06\u4ece\u7f13\u5b58\u4e2d\u9009\u53d6\uff0c\u8fd9\u80fd\u6709\u6548\u7684\u8282\u7701\u51c6\u5907\u67e5\u8be2\u65f6\u95f4\u83b7\u5f97\u66f4\u597d\u7684\u6027\u80fd\u3002"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"using-connection-pools",children:"\u8fde\u63a5\u6c60\u7684\u4f7f\u7528"}),"\n",(0,t.jsx)(n.p,{children:"\u8fde\u63a5\u6c60\u901a\u8fc7\u91cd\u7528\u4ee5\u524d\u7684\u8fde\u63a5\u6765\u5e2e\u52a9\u51cf\u5c11\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u6240\u82b1\u8d39\u7684\u65f6\u95f4\uff0c\u5f53\u4f60\u5b8c\u6210\u5b83\u4eec\u65f6\u8ba9\u5b83\u4eec\u4fdd\u6301\u6253\u5f00\u800c\u4e0d\u662f\u5173\u95ed\u3002"}),"\n",(0,t.jsx)(n.p,{children:"\u8fd9\u6539\u5584\u4e86\u67e5\u8be2\u7684\u5ef6\u8fdf\uff0c\u56e0\u4e3a\u60a8\u907f\u514d\u4e86\u5efa\u7acb\u65b0\u8fde\u63a5\u6240\u5e26\u6765\u7684\u6240\u6709\u5f00\u9500\u3002"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Connection Pools examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/connections/create-pool",children:(0,t.jsx)(n.strong,{children:"createPool"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\n// \u521b\u5efa\u8fde\u63a5\u6c60\uff0c\u8bbe\u7f6e\u8fde\u63a5\u6c60\u7684\u53c2\u6570\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// \u521b\u5efa\u8fde\u63a5\u6c60\uff0c\u8bbe\u7f6e\u8fde\u63a5\u6c60\u7684\u53c2\u6570\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"\u8be5\u6c60\u4e0d\u4f1a\u9884\u5148\u521b\u5efa\u6240\u6709\u8fde\u63a5\uff0c\u800c\u662f\u6839\u636e\u9700\u8981\u521b\u5efa\u5b83\u4eec\uff0c\u76f4\u5230\u8fbe\u5230\u8fde\u63a5\u9650\u5236\u3002"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsxs)(n.p,{children:["\u60a8\u53ef\u4ee5\u50cf\u76f4\u63a5\u8fde\u63a5\u4e00\u6837\u4f7f\u7528\u6c60\uff08\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"pool.query()"})," \u548c ",(0,t.jsx)(n.code,{children:"pool.execute()"}),"\uff09\uff1a"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n // For pool initialization, see above\n const [rows, fields] = await pool.query('SELECT `field` FROM `table`');\n // Connection is automatically released when query resolves\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.query('SELECT `field` FROM `table`', function (err, rows, fields) {\n // Connection is automatically released when query resolves\n});\n"})})})]}),"\n",(0,t.jsx)(n.p,{children:"\u6216\u8005\uff0c\u4e5f\u53ef\u4ee5\u624b\u52a8\u4ece\u6c60\u4e2d\u83b7\u53d6\u8fde\u63a5\u5e76\u7a0d\u540e\u8fd4\u56de\uff1a"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\nconst conn = await pool.getConnection();\n\n// Do something with the connection\nawait conn.query(/* ... */);\n\n// Don't forget to release the connection when finished!\npool.releaseConnection(conn);\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.getConnection(function (err, conn) {\n // Do something with the connection\n conn.query(/* ... */);\n\n // Don't forget to release the connection when finished!\n pool.releaseConnection(conn);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Additionally, directly release the connection using the ",(0,t.jsx)(n.code,{children:"connection"})," object:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"conn.release();\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"promise\u5c01\u88c5",children:"Promise\u5c01\u88c5"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 \u4e5f\u652f\u6301 Promise API\u3002 \u8fd9\u4e0e ES7 \u5f02\u6b65\u7b49\u5f85\u975e\u5e38\u6709\u6548\u3002"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nasync function main() {\n // create the connection\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // query database\n const [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n );\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u4f7f\u7528\u8303\u56f4\u5185\u53ef\u7528\u7684\u9ed8\u8ba4 ",(0,t.jsx)(n.code,{children:"Promise"})," \u5bf9\u8c61\u3002 \u4f46\u662f\u4f60\u53ef\u4ee5\u9009\u62e9\u4f60\u60f3\u4f7f\u7528\u7684 ",(0,t.jsx)(n.code,{children:"Promise"})," \u5b9e\u73b0\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// \u5bfc\u5165\u6a21\u5757\nimport mysql from 'mysql2/promise';\n\n// get the promise implementation, we will use bluebird\nimport bluebird from 'bluebird';\n\n// create the connection, specify bluebird as Promise\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n Promise: bluebird,\n});\n\n// query database\nconst [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n);\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u8fd8\u5728 Pools \u4e0a\u516c\u5f00\u4e86\u4e00\u4e2a ",(0,t.jsx)(n.code,{children:".promise()"}),"\u51fd\u6570\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u4ece\u540c\u4e00\u4e2a\u6c60\u521b\u5efa\u4e00\u4e2a promise/non-promise \u8fde\u63a5\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2';\n\nasync function main() {\n // create the pool\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // now get a Promise wrapped instance of that pool\n const promisePool = pool.promise();\n\n // query database using promises\n const [rows, fields] = await promisePool.query('SELECT 1');\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u5728 Connections \u4e0a\u516c\u5f00\u4e86\u4e00\u4e2a ",(0,t.jsx)(n.code,{children:".promise()"}),"\u51fd\u6570\uff0c\u4ee5\u201c\u5347\u7ea7\u201d\u73b0\u6709\u7684 non-promise \u8fde\u63a5\u4ee5\u4f7f\u7528 Promise\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const mysql = require('mysql2');\n\n// create the connection\nconst conn = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\nconn\n .promise()\n .query('SELECT 1')\n .then(([rows, fields]) => {\n console.log(rows);\n })\n .catch(console.log)\n .then(() => conn.end());\n"})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"\u7ed3\u679c\u8fd4\u56de",children:"\u7ed3\u679c\u8fd4\u56de"}),"\n",(0,t.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u6709\u4e24\u4e2a\u76f8\u540c\u540d\u79f0\u7684\u5217\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u4ee5\u6570\u7ec4\u800c\u4e0d\u662f\u5bf9\u8c61\u7684\u5f62\u5f0f\u83b7\u53d6\u7ed3\u679c\uff0c\u4e3a\u4e86\u9632\u6b62\u51b2\u7a81\uff0c\u8fd9\u662f\u4e0e ",(0,t.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," \u5e93\u7684\u533a\u522b\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u4f8b\u5982\uff1a ",(0,t.jsx)(n.code,{children:"SELECT 1 AS `foo`, 2 AS `foo`"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"\u60a8\u53ef\u4ee5\u5728\u8fde\u63a5\u7ea7\u522b\uff08\u9002\u7528\u4e8e\u6240\u6709\u67e5\u8be2\uff09\u6216\u67e5\u8be2\u7ea7\u522b\uff08\u4ec5\u9002\u7528\u4e8e\u8be5\u7279\u5b9a\u67e5\u8be2\uff09\u542f\u7528\u6b64\u8bbe\u7f6e\u3002"}),"\n",(0,t.jsx)(n.h4,{id:"\u8fde\u63a5\u7ea7\u522b",children:"\u8fde\u63a5\u7ea7\u522b"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = await mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})})]}),"\n",(0,t.jsx)(n.h4,{id:"\u67e5\u8be2\u7ea7\u522b",children:"\u67e5\u8be2\u7ea7\u522b"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"try {\n const [results, fields] = await conn.query({\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n });\n\n console.log(results); // \u8fd4\u56de\u6570\u7ec4\u800c\u4e0d\u662f\u6570\u7ec4\u5bf9\u8c61\n console.log(fields); // \u65e0\u53d8\u5316\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"conn.query(\n {\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n },\n function (err, results, fields) {\n console.log(results); // in this query, results will be an array of arrays rather than an array of objects\n console.log(fields); // fields are unchanged\n }\n);\n"})})})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.admonition,{title:"Getting Help",type:"tip",children:(0,t.jsxs)(n.p,{children:["Need help? Ask your question on ",(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/tagged/mysql2",children:"Stack Overflow"})," or ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions",children:"GitHub"}),".\nIf you've encountered an issue, please ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues",children:"file it on GitHub"}),"."]})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>l});s(7294);var t=s(512);const o={tabItem:"tabItem_Ymn6"};var r=s(5893);function l(e){let{children:n,hidden:s,className:l}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.Z)(o.tabItem,l),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),o=s(512),r=s(2466),l=s(6550),a=s(469),i=s(1980),c=s(7392),d=s(12);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:o}}=e;return{value:n,label:s,attributes:t,default:o}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const o=(0,l.k6)(),r=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(r),(0,t.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(o.location.search);n.set(r,e),o.replace({...o.location,search:n.toString()})}),[r,o])]}function x(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=h(e),[l,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r}))),[c,u]=p({queryString:s,groupId:o}),[x,j]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,r]=(0,d.Nk)(s);return[o,(0,t.useCallback)((e=>{s&&r.set(e)}),[s,r])]}({groupId:o}),g=(()=>{const e=c??x;return m({value:e,tabValues:r})?e:null})();(0,a.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:l,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),j(e)}),[u,j,r]),tabValues:r}}var j=s(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:t,selectValue:l,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=a[s].value;o!==t&&(c(n),l(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:a.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...r,className:(0,o.Z)("tabs__item",g.tabItem,r?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const r=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===o));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function v(e){const n=x(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(v,{...e,children:u(e.children)},String(n))}},4442:(e,n,s)=>{s.d(n,{V:()=>r});var t=s(5742),o=s(5893);const r=e=>{let{title:n}=e;return(0,o.jsx)(t.Z,{children:(0,o.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>l});var t=s(7294);const o={},r=t.createContext(o);function l(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(o):e.components||o:l(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/9df47158.c7301fcf.js b/zh-CN/assets/js/9df47158.c7301fcf.js deleted file mode 100644 index 2f1b38da14..0000000000 --- a/zh-CN/assets/js/9df47158.c7301fcf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9010],{9964:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>d,toc:()=>h});var t=s(5893),o=s(1151),r=s(4866),l=s(5162),a=s(4442);const i={slug:"/",position:1,title:"Quickstart",description:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316"},c="MySQL2",d={id:"index",title:"Quickstart",description:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316",source:"@site/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.mdx",sourceDirName:".",slug:"/",permalink:"/node-mysql2/zh-CN/docs/",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/index.mdx",tags:[],version:"current",frontMatter:{slug:"/",position:1,title:"Quickstart",description:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316"},sidebar:"docs",next:{title:"MySQL2\u7684\u5386\u53f2\u4ee5\u53ca\u9009\u62e9\u539f\u56e0",permalink:"/node-mysql2/zh-CN/docs/history-and-why-mysq2"}},u={},h=[{value:"\u5b89\u88c5",id:"\u5b89\u88c5",level:2},{value:"\u67e5\u8be2\u6570\u636e",id:"\u67e5\u8be2\u6570\u636e",level:3},{value:"SQL\u9884\u5904\u7406\u7684\u4f7f\u7528",id:"sql\u9884\u5904\u7406\u7684\u4f7f\u7528",level:3},{value:"\u8fde\u63a5\u6c60\u7684\u4f7f\u7528",id:"using-connection-pools",level:3},{value:"Promise\u5c01\u88c5",id:"promise\u5c01\u88c5",level:3},{value:"\u7ed3\u679c\u8fd4\u56de",id:"\u7ed3\u679c\u8fd4\u56de",level:3},{value:"\u8fde\u63a5\u7ea7\u522b",id:"\u8fde\u63a5\u7ea7\u522b",level:4},{value:"\u67e5\u8be2\u7ea7\u522b",id:"\u67e5\u8be2\u7ea7\u522b",level:4}];function m(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.V,{title:"MySQL2 | Quickstart"}),"\n",(0,t.jsx)(n.h1,{id:"mysql2",children:"MySQL2"}),"\n","\n",(0,t.jsx)(n.p,{children:"\u9002\u7528\u4e8eNode.js\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u4e13\u6ce8\u4e8e\u6027\u80fd\u4f18\u5316\u3002\u652f\u6301SQL\u9884\u5904\u7406\u3001\u975eUTF-8\u7f16\u7801\u652f\u6301\u3001\u4e8c\u8fdb\u5236\u6587\u4ef6\u7f16\u7801\u652f\u6301\u3001\u538b\u7f29\u548cSSL\u7b49\u7b49 \u67e5\u770b\u66f4\u591a\u3002"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/v/mysql2.svg",alt:"NPM Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://npmjs.org/package/mysql2",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/dm/mysql2.svg",alt:"NPM Downloads"})}),"\n",(0,t.jsx)(n.a,{href:"https://nodejs.org/download/",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/node/v/mysql2.svg",alt:"Node.js Version"})}),"\n",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/blob/master/License",children:(0,t.jsx)(n.img,{src:"https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000",alt:"License"})})]}),"\n",(0,t.jsx)(n.h2,{id:"\u5b89\u88c5",children:"\u5b89\u88c5"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 \u53ef\u4ee5\u8de8\u5e73\u53f0\u4f7f\u7528\uff0c\u6beb\u65e0\u7591\u95ee\u53ef\u4ee5\u5b89\u88c5\u5728 Linux\u3001Mac OS \u6216 Windows \u4e0a\u3002"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\n"})})}),(0,t.jsxs)(l.Z,{value:"TypeScript",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save mysql2\nnpm install --save-dev @types/node\n"})}),(0,t.jsxs)(n.p,{children:["For TypeScript documentation and examples, see ",(0,t.jsx)(n.a,{href:"/docs/documentation/typescript-examples",children:"here"}),"."]})]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"\u67e5\u8be2\u6570\u636e",children:"\u67e5\u8be2\u6570\u636e"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more queries examples, please visit the example sections ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,t.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// \u5bfc\u5165\u6a21\u5757\nimport mysql from 'mysql2/promise';\n\n// \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// \u7b80\u5355\u67e5\u8be2\ntry {\n const [results, fields] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45'\n );\n\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n} catch (err) {\n console.log(err);\n}\n\n// \u4f7f\u7528\u5360\u4f4d\u7b26\ntry {\n const [results] = await connection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45]\n );\n\n console.log(results);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// \u5bfc\u5165\u6a21\u5757\nconst mysql = require('mysql2');\n\n// \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// \u7b80\u5355\u67e5\u8be2\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45',\n function (err, results, fields) {\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n }\n);\n\n// \u4f7f\u7528\u5360\u4f4d\u7b26\nconnection.query(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Page', 45],\n function (err, results) {\n console.log(results);\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"sql\u9884\u5904\u7406\u7684\u4f7f\u7528",children:"SQL\u9884\u5904\u7406\u7684\u4f7f\u7528"}),"\n",(0,t.jsx)(n.p,{children:"\u4f7f\u7528 MySQL2\uff0c\u60a8\u8fd8\u53ef\u4ee5\u63d0\u524d\u51c6\u5907\u597dSQL\u9884\u5904\u7406\u8bed\u53e5\u3002 \u4f7f\u7528\u51c6\u5907\u597d\u7684SQL\u9884\u5904\u7406\u8bed\u53e5\uff0cMySQL \u4e0d\u5fc5\u6bcf\u6b21\u90fd\u4e3a\u76f8\u540c\u7684\u67e5\u8be2\u505a\u51c6\u5907\uff0c\u8fd9\u4f1a\u5e26\u6765\u66f4\u597d\u7684\u6027\u80fd\u3002 \u5982\u679c\u60a8\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u5b83\u4eec\u5f88\u91cd\u8981\uff0c\u8bf7\u67e5\u770b\u8fd9\u4e9b\u8ba8\u8bba\uff1a"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks",children:"\u5982\u4f55\u9632\u6b62\u9884\u5904\u7406\u8bed\u53e5SQL\u6ce8\u5165\u653b\u51fb"})}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u63d0\u4f9b\u4e86 ",(0,t.jsx)(n.code,{children:"execute"})," \u8f85\u52a9\u51fd\u6570\uff0c\u5b83\u5c06\u51c6\u5907\u548c\u67e5\u8be2\u8bed\u53e5\u3002 \u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"prepare"})," / ",(0,t.jsx)(n.code,{children:"unprepare"})," \u65b9\u6cd5\u624b\u52a8\u51c6\u5907/\u53d6\u6d88\u51c6\u5907\u3002"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Prepared Statements and Placeholders examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,t.jsx)(n.strong,{children:"Prepared Statements"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // execute \u5c06\u5728\u5185\u90e8\u8c03\u7528 prepare \u548c query\n const [results, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53]\n );\n\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\nconst connection = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\n// execute \u5c06\u5728\u5185\u90e8\u8c03\u7528 prepare \u548c query\nconnection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Rick C-137', 53],\n function (err, results, fields) {\n console.log(results); // \u7ed3\u679c\u96c6\n console.log(fields); // \u989d\u5916\u7684\u5143\u6570\u636e\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsx)(n.p,{children:"\u5982\u679c\u518d\u6b21\u6267\u884c\u76f8\u540c\u7684\u8bed\u53e5\uff0c\u4ed6\u5c06\u4ece\u7f13\u5b58\u4e2d\u9009\u53d6\uff0c\u8fd9\u80fd\u6709\u6548\u7684\u8282\u7701\u51c6\u5907\u67e5\u8be2\u65f6\u95f4\u83b7\u5f97\u66f4\u597d\u7684\u6027\u80fd\u3002"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"using-connection-pools",children:"\u8fde\u63a5\u6c60\u7684\u4f7f\u7528"}),"\n",(0,t.jsx)(n.p,{children:"\u8fde\u63a5\u6c60\u901a\u8fc7\u91cd\u7528\u4ee5\u524d\u7684\u8fde\u63a5\u6765\u5e2e\u52a9\u51cf\u5c11\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u6240\u82b1\u8d39\u7684\u65f6\u95f4\uff0c\u5f53\u4f60\u5b8c\u6210\u5b83\u4eec\u65f6\u8ba9\u5b83\u4eec\u4fdd\u6301\u6253\u5f00\u800c\u4e0d\u662f\u5173\u95ed\u3002"}),"\n",(0,t.jsx)(n.p,{children:"\u8fd9\u6539\u5584\u4e86\u67e5\u8be2\u7684\u5ef6\u8fdf\uff0c\u56e0\u4e3a\u60a8\u907f\u514d\u4e86\u5efa\u7acb\u65b0\u8fde\u63a5\u6240\u5e26\u6765\u7684\u6240\u6709\u5f00\u9500\u3002"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["To explore more Connection Pools examples, please visit the example section ",(0,t.jsx)(n.a,{href:"/docs/examples/connections/create-pool",children:(0,t.jsx)(n.strong,{children:"createPool"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\n// \u521b\u5efa\u8fde\u63a5\u6c60\uff0c\u8bbe\u7f6e\u8fde\u63a5\u6c60\u7684\u53c2\u6570\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\n// \u521b\u5efa\u8fde\u63a5\u6c60\uff0c\u8bbe\u7f6e\u8fde\u63a5\u6c60\u7684\u53c2\u6570\nconst pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n waitForConnections: true,\n connectionLimit: 10,\n maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`\n idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000\n queueLimit: 0,\n enableKeepAlive: true,\n keepAliveInitialDelay: 0,\n});\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"\u8be5\u6c60\u4e0d\u4f1a\u9884\u5148\u521b\u5efa\u6240\u6709\u8fde\u63a5\uff0c\u800c\u662f\u6839\u636e\u9700\u8981\u521b\u5efa\u5b83\u4eec\uff0c\u76f4\u5230\u8fbe\u5230\u8fde\u63a5\u9650\u5236\u3002"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsxs)(n.p,{children:["\u60a8\u53ef\u4ee5\u50cf\u76f4\u63a5\u8fde\u63a5\u4e00\u6837\u4f7f\u7528\u6c60\uff08\u4f7f\u7528 ",(0,t.jsx)(n.code,{children:"pool.query()"})," \u548c ",(0,t.jsx)(n.code,{children:"pool.execute()"}),"\uff09\uff1a"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n // For pool initialization, see above\n const [rows, fields] = await pool.query('SELECT `field` FROM `table`');\n // Connection is automatically released when query resolves\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.query('SELECT `field` FROM `table`', function (err, rows, fields) {\n // Connection is automatically released when query resolves\n});\n"})})})]}),"\n",(0,t.jsx)(n.p,{children:"\u6216\u8005\uff0c\u4e5f\u53ef\u4ee5\u624b\u52a8\u4ece\u6c60\u4e2d\u83b7\u53d6\u8fde\u63a5\u5e76\u7a0d\u540e\u8fd4\u56de\uff1a"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\nconst conn = await pool.getConnection();\n\n// Do something with the connection\nawait conn.query(/* ... */);\n\n// Don't forget to release the connection when finished!\npool.releaseConnection(conn);\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// For pool initialization, see above\npool.getConnection(function (err, conn) {\n // Do something with the connection\n conn.query(/* ... */);\n\n // Don't forget to release the connection when finished!\n pool.releaseConnection(conn);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Additionally, directly release the connection using the ",(0,t.jsx)(n.code,{children:"connection"})," object:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"conn.release();\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"promise\u5c01\u88c5",children:"Promise\u5c01\u88c5"}),"\n",(0,t.jsx)(n.p,{children:"MySQL2 \u4e5f\u652f\u6301 Promise API\u3002 \u8fd9\u4e0e ES7 \u5f02\u6b65\u7b49\u5f85\u975e\u5e38\u6709\u6548\u3002"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nasync function main() {\n // create the connection\n const connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // query database\n const [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n );\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u4f7f\u7528\u8303\u56f4\u5185\u53ef\u7528\u7684\u9ed8\u8ba4 ",(0,t.jsx)(n.code,{children:"Promise"})," \u5bf9\u8c61\u3002 \u4f46\u662f\u4f60\u53ef\u4ee5\u9009\u62e9\u4f60\u60f3\u4f7f\u7528\u7684 ",(0,t.jsx)(n.code,{children:"Promise"})," \u5b9e\u73b0\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"// \u5bfc\u5165\u6a21\u5757\nimport mysql from 'mysql2/promise';\n\n// get the promise implementation, we will use bluebird\nimport bluebird from 'bluebird';\n\n// create the connection, specify bluebird as Promise\nconst connection = await mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n Promise: bluebird,\n});\n\n// query database\nconst [rows, fields] = await connection.execute(\n 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',\n ['Morty', 14]\n);\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u8fd8\u5728 Pools \u4e0a\u516c\u5f00\u4e86\u4e00\u4e2a ",(0,t.jsx)(n.code,{children:".promise()"}),"\u51fd\u6570\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u4ece\u540c\u4e00\u4e2a\u6c60\u521b\u5efa\u4e00\u4e2a promise/non-promise \u8fde\u63a5\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2';\n\nasync function main() {\n // create the pool\n const pool = mysql.createPool({\n host: 'localhost',\n user: 'root',\n database: 'test',\n });\n\n // now get a Promise wrapped instance of that pool\n const promisePool = pool.promise();\n\n // query database using promises\n const [rows, fields] = await promisePool.query('SELECT 1');\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["MySQL2 \u5728 Connections \u4e0a\u516c\u5f00\u4e86\u4e00\u4e2a ",(0,t.jsx)(n.code,{children:".promise()"}),"\u51fd\u6570\uff0c\u4ee5\u201c\u5347\u7ea7\u201d\u73b0\u6709\u7684 non-promise \u8fde\u63a5\u4ee5\u4f7f\u7528 Promise\u3002"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const mysql = require('mysql2');\n\n// create the connection\nconst conn = mysql.createConnection({\n host: 'localhost',\n user: 'root',\n database: 'test',\n});\n\nconn\n .promise()\n .query('SELECT 1')\n .then(([rows, fields]) => {\n console.log(rows);\n })\n .catch(console.log)\n .then(() => conn.end());\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"\u7ed3\u679c\u8fd4\u56de",children:"\u7ed3\u679c\u8fd4\u56de"}),"\n",(0,t.jsxs)(n.p,{children:["\u5982\u679c\u4f60\u6709\u4e24\u4e2a\u76f8\u540c\u540d\u79f0\u7684\u5217\uff0c\u4f60\u53ef\u80fd\u5e0c\u671b\u4ee5\u6570\u7ec4\u800c\u4e0d\u662f\u5bf9\u8c61\u7684\u5f62\u5f0f\u83b7\u53d6\u7ed3\u679c\uff0c\u4e3a\u4e86\u9632\u6b62\u51b2\u7a81\uff0c\u8fd9\u662f\u4e0e ",(0,t.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," \u5e93\u7684\u533a\u522b\u3002"]}),"\n",(0,t.jsxs)(n.p,{children:["\u4f8b\u5982\uff1a ",(0,t.jsx)(n.code,{children:"SELECT 1 AS `foo`, 2 AS `foo`"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"\u60a8\u53ef\u4ee5\u5728\u8fde\u63a5\u7ea7\u522b\uff08\u9002\u7528\u4e8e\u6240\u6709\u67e5\u8be2\uff09\u6216\u67e5\u8be2\u7ea7\u522b\uff08\u4ec5\u9002\u7528\u4e8e\u8be5\u7279\u5b9a\u67e5\u8be2\uff09\u542f\u7528\u6b64\u8bbe\u7f6e\u3002"}),"\n",(0,t.jsx)(n.h4,{id:"\u8fde\u63a5\u7ea7\u522b",children:"\u8fde\u63a5\u7ea7\u522b"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = await mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{5}",children:"const conn = mysql.createConnection({\n host: 'localhost',\n database: 'test',\n user: 'root',\n rowsAsArray: true,\n});\n"})})})]}),"\n",(0,t.jsx)(n.h4,{id:"\u67e5\u8be2\u7ea7\u522b",children:"\u67e5\u8be2\u7ea7\u522b"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"Promise",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"try {\n const [results, fields] = await conn.query({\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n });\n\n console.log(results); // \u8fd4\u56de\u6570\u7ec4\u800c\u4e0d\u662f\u6570\u7ec4\u5bf9\u8c61\n console.log(fields); // \u65e0\u53d8\u5316\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(l.Z,{value:"Callback",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:"{4}",children:"conn.query(\n {\n sql: 'SELECT 1 AS `foo`, 2 AS `foo`',\n rowsAsArray: true,\n },\n function (err, results, fields) {\n console.log(results); // in this query, results will be an array of arrays rather than an array of objects\n console.log(fields); // fields are unchanged\n }\n);\n"})})})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.admonition,{title:"Getting Help",type:"tip",children:(0,t.jsxs)(n.p,{children:["Need help? Ask your question on ",(0,t.jsx)(n.a,{href:"https://stackoverflow.com/questions/tagged/mysql2",children:"Stack Overflow"})," or ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions",children:"GitHub"}),".\nIf you've encountered an issue, please ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues",children:"file it on GitHub"}),"."]})})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>l});s(7294);var t=s(512);const o={tabItem:"tabItem_Ymn6"};var r=s(5893);function l(e){let{children:n,hidden:s,className:l}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.Z)(o.tabItem,l),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),o=s(512),r=s(2466),l=s(6550),a=s(469),i=s(1980),c=s(7392),d=s(12);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:o}}=e;return{value:n,label:s,attributes:t,default:o}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function m(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:s}=e;const o=(0,l.k6)(),r=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(r),(0,t.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(o.location.search);n.set(r,e),o.replace({...o.location,search:n.toString()})}),[r,o])]}function x(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=h(e),[l,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r}))),[c,u]=p({queryString:s,groupId:o}),[x,j]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,r]=(0,d.Nk)(s);return[o,(0,t.useCallback)((e=>{s&&r.set(e)}),[s,r])]}({groupId:o}),g=(()=>{const e=c??x;return m({value:e,tabValues:r})?e:null})();(0,a.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:l,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),j(e)}),[u,j,r]),tabValues:r}}var j=s(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:t,selectValue:l,tabValues:a}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=a[s].value;o!==t&&(c(n),l(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:a.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...r,className:(0,o.Z)("tabs__item",g.tabItem,r?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const r=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===o));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function v(e){const n=x(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(v,{...e,children:u(e.children)},String(n))}},4442:(e,n,s)=>{s.d(n,{V:()=>r});var t=s(5742),o=s(5893);const r=e=>{let{title:n}=e;return(0,o.jsx)(t.Z,{children:(0,o.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>a,a:()=>l});var t=s(7294);const o={},r=t.createContext(o);function l(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(o):e.components||o:l(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/9e767aa9.64c9ba6e.js b/zh-CN/assets/js/9e767aa9.64c9ba6e.js new file mode 100644 index 0000000000..cff9793a53 --- /dev/null +++ b/zh-CN/assets/js/9e767aa9.64c9ba6e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8806],{7372:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>h});var i=s(5893),t=s(1151),o=s(4442);const r={slug:"/documentation",title:"Introduction"},l="Documentation",c={id:"documentation/index",title:"Introduction",description:"[node-mysql]//github.com/mysqljs/mysql",source:"@site/docs/documentation/00-index.mdx",sourceDirName:"documentation",slug:"/documentation",permalink:"/node-mysql2/zh-CN/docs/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/00-index.mdx",tags:[],version:"current",sidebarPosition:0,frontMatter:{slug:"/documentation",title:"Introduction"},sidebar:"docs",previous:{title:"Stability Badges",permalink:"/node-mysql2/zh-CN/docs/stability-badges"},next:{title:"Authentication Switch Request",permalink:"/node-mysql2/zh-CN/docs/documentation/authentication-switch"}},d={},h=[{value:"Examples",id:"examples",level:2},{value:"Known incompatibilities with Node MySQL",id:"known-incompatibilities-with-node-mysql",level:2},{value:"Other Resources",id:"other-resources",level:2},{value:"Benchmarks",id:"benchmarks",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.V,{title:"Documentation"}),"\n",(0,i.jsx)(n.h1,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n.p,{children:["MySQL2 aims to be a drop in replacement for ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["If you see any API incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", please report via github issue."]})})}),"\n",(0,i.jsxs)(n.p,{children:["Not only ",(0,i.jsx)(n.strong,{children:"MySQL2"})," offers better performance over ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", we also support these additional features:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/promise-wrapper",children:"Promise Wrapper"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/authentication-switch",children:"Authentication Switch"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/extras",children:"More Features"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/mysql-server",children:"MySQL Server"})}),"\n",(0,i.jsx)(n.li,{children:"Pooling"}),"\n",(0,i.jsx)(n.li,{children:"SSL"}),"\n",(0,i.jsx)(n.li,{children:"MySQL Compression"}),"\n",(0,i.jsx)(n.li,{children:"Binary Log Protocol Client"}),"\n"]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,i.jsxs)(n.p,{children:["Please check these ",(0,i.jsx)(n.a,{href:"/docs/examples",children:"examples"})," for ",(0,i.jsx)(n.strong,{children:"MySQL2"}),"."]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsxs)(n.h2,{id:"known-incompatibilities-with-node-mysql",children:["Known incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"zeroFill"})," flag is ignored in type conversion.\nYou need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"DECIMAL"})," and ",(0,i.jsx)(n.code,{children:"NEWDECIMAL"})," types always returned as ",(0,i.jsx)(n.code,{children:"string"})," unless you pass this config option:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"{\n decimalNumbers: true,\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"This option could lose precision on the number as Javascript Number is a Float!"})}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"other-resources",children:"Other Resources"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/client-server-protocol.html",children:"Wire protocol documentation"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," - Most popular node.js mysql client library"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mariasql/",children:"node-mariasql"})," - Bindings to libmariasql. One of the fastest clients"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/Sannis/node-mysql-libmysqlclient",children:"node-libmysqlclient"})," - Bindings to libmysqlclient"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/siddontang/go-mysql",children:"go-mysql"})," - MySQL Go client (prepared statements, binlog protocol, server)"]}),"\n"]}),"\n",(0,i.jsx)("hr",{}),"\n",(0,i.jsx)(n.h2,{id:"benchmarks",children:"Benchmarks"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b",children:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"npm run benchmarks"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mysql-benchmarks",children:"node-mysql-benchmarks"})}),"\n",(0,i.jsxs)(n.li,{children:["try to run example ",(0,i.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/benchmarks",children:"benchmarks"})," on your system"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},4442:(e,n,s)=>{s.d(n,{V:()=>o});var i=s(5742),t=s(5893);const o=e=>{let{title:n}=e;return(0,t.jsx)(i.Z,{children:(0,t.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>r});var i=s(7294);const t={},o=i.createContext(t);function r(e){const n=i.useContext(o);return i.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(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/9e767aa9.ba9d70bd.js b/zh-CN/assets/js/9e767aa9.ba9d70bd.js deleted file mode 100644 index 3d47411e92..0000000000 --- a/zh-CN/assets/js/9e767aa9.ba9d70bd.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8806],{7372:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>h});var i=s(5893),t=s(1151),o=s(4442);const r={slug:"/documentation",title:"Introduction"},l="Documentation",c={id:"documentation/index",title:"Introduction",description:"[node-mysql]//github.com/mysqljs/mysql",source:"@site/docs/documentation/00-index.mdx",sourceDirName:"documentation",slug:"/documentation",permalink:"/node-mysql2/zh-CN/docs/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/documentation/00-index.mdx",tags:[],version:"current",sidebarPosition:0,frontMatter:{slug:"/documentation",title:"Introduction"},sidebar:"docs",previous:{title:"Stability Badges",permalink:"/node-mysql2/zh-CN/docs/stability-badges"},next:{title:"Authentication Switch Request",permalink:"/node-mysql2/zh-CN/docs/documentation/authentication-switch"}},d={},h=[{value:"Examples",id:"examples",level:2},{value:"Known incompatibilities with Node MySQL",id:"known-incompatibilities-with-node-mysql",level:2},{value:"Other Resources",id:"other-resources",level:2},{value:"Benchmarks",id:"benchmarks",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.V,{title:"Documentation"}),"\n",(0,i.jsx)(n.h1,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n.p,{children:["MySQL2 aims to be a drop in replacement for ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:(0,i.jsxs)(n.em,{children:["If you see any API incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", please report via github issue."]})})}),"\n",(0,i.jsxs)(n.p,{children:["Not only ",(0,i.jsx)(n.strong,{children:"MySQL2"})," offers better performance over ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"}),", we also support these additional features:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/prepared-statements",children:"Prepared Statements"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/promise-wrapper",children:"Promise Wrapper"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/authentication-switch",children:"Authentication Switch"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/extras",children:"More Features"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/documentation/mysql-server",children:"MySQL Server"})}),"\n",(0,i.jsx)(n.li,{children:"Pooling"}),"\n",(0,i.jsx)(n.li,{children:"SSL"}),"\n",(0,i.jsx)(n.li,{children:"MySQL Compression"}),"\n",(0,i.jsx)(n.li,{children:"Binary Log Protocol Client"}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,i.jsxs)(n.p,{children:["Please check these ",(0,i.jsx)(n.a,{href:"/docs/examples",children:"examples"})," for ",(0,i.jsx)(n.strong,{children:"MySQL2"}),"."]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsxs)(n.h2,{id:"known-incompatibilities-with-node-mysql",children:["Known incompatibilities with ",(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"zeroFill"})," flag is ignored in type conversion.\nYou need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"DECIMAL"})," and ",(0,i.jsx)(n.code,{children:"NEWDECIMAL"})," types always returned as ",(0,i.jsx)(n.code,{children:"string"})," unless you pass this config option:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"{\n decimalNumbers: true,\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"This option could lose precision on the number as Javascript Number is a Float!"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"other-resources",children:"Other Resources"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://dev.mysql.com/doc/internals/en/client-server-protocol.html",children:"Wire protocol documentation"})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mysqljs/mysql",children:"Node MySQL"})," - Most popular node.js mysql client library"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mariasql/",children:"node-mariasql"})," - Bindings to libmariasql. One of the fastest clients"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/Sannis/node-mysql-libmysqlclient",children:"node-libmysqlclient"})," - Bindings to libmysqlclient"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://github.com/siddontang/go-mysql",children:"go-mysql"})," - MySQL Go client (prepared statements, binlog protocol, server)"]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"benchmarks",children:"Benchmarks"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b",children:"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"npm run benchmarks"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://github.com/mscdex/node-mysql-benchmarks",children:"node-mysql-benchmarks"})}),"\n",(0,i.jsxs)(n.li,{children:["try to run example ",(0,i.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/benchmarks",children:"benchmarks"})," on your system"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},4442:(e,n,s)=>{s.d(n,{V:()=>o});var i=s(5742),t=s(5893);const o=e=>{let{title:n}=e;return(0,t.jsx)(i.Z,{children:(0,t.jsx)("title",{children:n})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>r});var i=s(7294);const t={},o=i.createContext(t);function r(e){const n=i.useContext(o);return i.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(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/b07748b5.26915157.js b/zh-CN/assets/js/b07748b5.26915157.js deleted file mode 100644 index 0f4d146b12..0000000000 --- a/zh-CN/assets/js/b07748b5.26915157.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4403],{214:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>u,toc:()=>p});var r=s(5893),o=s(1151),l=s(4866),t=s(5162),c=s(6393),i=s(4379);const a={sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},d="createPoolCluster",u={id:"examples/connections/createPoolCluster",title:"createPoolCluster",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/createPoolCluster.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/createPoolCluster.mdx",tags:[{label:"createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/tags/create-pool-cluster"},{label:"URI",permalink:"/node-mysql2/zh-CN/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/zh-CN/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/zh-CN/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/zh-CN/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/zh-CN/docs/tags/socks"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createPool",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-pool"},next:{title:"Simple Queries",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/"}},h={},p=[{value:"add(group, connectionUri)",id:"addgroup-connectionuri",level:2},{value:"add(group, config)",id:"addgroup-config",level:2},{value:"add(group, config) \u2014 SHA1",id:"addgroup-config--sha1",level:2},{value:"add(group, config) \u2014 SSL",id:"addgroup-config--ssl",level:2},{value:"add(group, config) \u2014 RDS SSL",id:"addgroup-config--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"add(group, config) \u2014 Socks",id:"addgroup-config--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function g(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createpoolcluster",children:"createPoolCluster"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-connectionuri",children:"add(group, connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"add(group: string, connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config",children:"add(group, config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--sha1",children:"add(group, config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--ssl",children:"add(group, config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,r.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--rds-ssl",children:"add(group, config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await poolCluster.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(t.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n poolCluster.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--socks",children:"add(group, config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n stream: socksProxy,\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})}),(0,r.jsx)(t.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,r.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),"\n",(0,r.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})}),"\n"]}),"\n",(0,r.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var r=s(512);const o={tabItem:"tabItem_Ymn6"};var l=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>C});var r=s(7294),o=s(512),l=s(2466),t=s(6550),c=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:o}}=e;return{value:n,label:s,attributes:r,default:o}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:s}=e;const o=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(o.location.search);n.set(l,e),o.replace({...o.location,search:n.toString()})}),[l,o])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,l=h(e),[t,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[a,u]=g({queryString:s,groupId:o}),[m,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,l]=(0,d.Nk)(s);return[o,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:o}),j=(()=>{const e=a??m;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,l]),tabValues:l}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=c[s].value;o!==r&&(a(n),t(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:c.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...l,className:(0,o.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function C(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),o=s(2263),l=s(9286),t=s(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[g,m]=(0,r.useState)(!0),{siteConfig:x}=(0,o.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),o=`${s} ${n}`;let l=!1,t=0,c="";for(const i of r)if(i.includes(o)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;u(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:h?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:g?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),o=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,o.jsx)(r.Z,{open:s,className:"faq",summary:(0,o.jsx)("summary",{children:(0,o.jsx)("strong",{children:l})}),children:(0,o.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/b07748b5.3a6e81fe.js b/zh-CN/assets/js/b07748b5.3a6e81fe.js new file mode 100644 index 0000000000..c37ebff90f --- /dev/null +++ b/zh-CN/assets/js/b07748b5.3a6e81fe.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4403],{214:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>u,toc:()=>p});var r=s(5893),o=s(1151),l=s(4866),t=s(5162),c=s(6393),i=s(4379);const a={sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},d="createPoolCluster",u={id:"examples/connections/createPoolCluster",title:"createPoolCluster",description:"For queries please see the Simple Queries and Prepared Statements examples.",source:"@site/docs/examples/connections/createPoolCluster.mdx",sourceDirName:"examples/connections",slug:"/examples/connections/createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/connections/createPoolCluster.mdx",tags:[{label:"createPoolCluster",permalink:"/node-mysql2/zh-CN/docs/tags/create-pool-cluster"},{label:"URI",permalink:"/node-mysql2/zh-CN/docs/tags/uri"},{label:"SHA1",permalink:"/node-mysql2/zh-CN/docs/tags/sha-1"},{label:"RDS",permalink:"/node-mysql2/zh-CN/docs/tags/rds"},{label:"SSL",permalink:"/node-mysql2/zh-CN/docs/tags/ssl"},{label:"Socks",permalink:"/node-mysql2/zh-CN/docs/tags/socks"}],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3,tags:["createPoolCluster","URI","SHA1","RDS","SSL","Socks"]},sidebar:"examples",previous:{title:"createPool",permalink:"/node-mysql2/zh-CN/docs/examples/connections/create-pool"},next:{title:"Simple Queries",permalink:"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/"}},h={},p=[{value:"add(group, connectionUri)",id:"addgroup-connectionuri",level:2},{value:"add(group, config)",id:"addgroup-config",level:2},{value:"add(group, config) \u2014 SHA1",id:"addgroup-config--sha1",level:2},{value:"add(group, config) \u2014 SSL",id:"addgroup-config--ssl",level:2},{value:"add(group, config) \u2014 RDS SSL",id:"addgroup-config--rds-ssl",level:2},{value:"Related Links",id:"related-links",level:3},{value:"add(group, config) \u2014 Socks",id:"addgroup-config--socks",level:2},{value:"Glossary",id:"glossary",level:2},{value:"PoolOptions",id:"pooloptions",level:3}];function g(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"createpoolcluster",children:"createPoolCluster"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["For queries please see the ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/simple-queries",children:(0,r.jsx)(n.strong,{children:"Simple Queries"})})," and ",(0,r.jsx)(n.a,{href:"/docs/examples/queries/prepared-statements",children:(0,r.jsx)(n.strong,{children:"Prepared Statements"})})," examples."]})}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-connectionuri",children:"add(group, connectionUri)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"add(group: string, connectionUri: string)"})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test');\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config",children:"add(group, config)"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n host: 'localhost',\n user: 'root',\n database: 'test',\n // port: 3306,\n // password: '',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--sha1",children:"add(group, config) \u2014 SHA1"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from(\n '8bb6118f8fd6935ad0876a3be34a717d32708ffd',\n 'hex'\n ),\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'),\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--ssl",children:"add(group, config) \u2014 SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"promise.js",default:!0,children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,r.jsx)(t.Z,{value:"callback.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n ssl: {\n // key: fs.readFileSync('./certs/client-key.pem'),\n // cert: fs.readFileSync('./certs/client-cert.pem')\n ca: fs.readFileSync('./certs/ca-cert.pem'),\n },\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})})}),(0,r.jsxs)(t.Z,{value:"certs/ca-cert.pem",children:[(0,r.jsx)(i.I,{language:"plan",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/test/fixtures/ssl/certs/ca.pem"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["See ",(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/tree/master/test/fixtures/ssl/certs",children:"ssl/certs"}),"."]}),"\n"]})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--rds-ssl",children:"add(group, config) \u2014 RDS SSL"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," string as value to ssl property to connect to ",(0,r.jsx)(n.strong,{children:"Amazon RDS"})," MySQL over SSL."]}),"\n",(0,r.jsxs)(n.p,{children:["In that case ",(0,r.jsx)(n.a,{href:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem",children:"https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem"})," CA cert is used:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(t.Z,{value:"promise.js",default:!0,children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n // highlight-start\n const poolCluster = mysql.createPoolCluster();\n\n poolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n });\n // poolCluster.add('clusterB', '...');\n\n const connection = await poolCluster.getConnection('clusterA');\n // highlight-end\n // ... some query\n\n // highlight-next-line\n connection.release();\n} catch (err) {\n console.log(err);\n}\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"try {\n const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"');\n await poolCluster.end();\n\n console.log(res);\n} catch (err) {\n console.log(err);\n}\n"})})})]}),(0,r.jsxs)(t.Z,{value:"callback.js",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n // ...\n host: 'db.id.ap-southeast-2.rds.amazonaws.com',\n ssl: 'Amazon RDS',\n});\n// poolCluster.add('clusterB', '...');\n\npoolCluster.getConnection('clusterA', function (err, connection) {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n // ... some query\n\n connection.release();\n});\n"})}),(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) {\n poolCluster.end();\n\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(res);\n});\n"})})})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"warning",children:[(0,r.jsx)(n.p,{children:"Don't forget to release the connection when finished by using:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"connection.release()"})}),"\n"]})]}),"\n",(0,r.jsx)(n.h3,{id:"related-links",children:"Related Links"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Issues"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/issues/2130",children:"#2130 \u2014 Update TLS certs for Amazon RDS instances"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Pull Requests"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2119",children:"#2119 \u2014 fix: make startTls code compatible with Bun"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/pull/2131",children:"#2131 \u2014 Update Amazon RDS SSL CA cert"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"addgroup-config--socks",children:"add(group, config) \u2014 Socks"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["add(group: string, config: ",(0,r.jsx)(n.a,{href:"#pooloptions",children:"PoolOptions"}),")"]})}),"\n"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(t.Z,{value:"A.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\nconst socksProxy = new SocksConnection({ port: 3306 });\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n stream: socksProxy,\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})}),(0,r.jsx)(t.Z,{value:"B.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\nconst SocksConnection = require('socksjs');\n\n// highlight-start\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('clusterA', {\n debug: 1,\n stream: function () {\n return new SocksConnection({ port: 3306 });\n },\n});\n// poolCluster.add('clusterB', '...');\n\nconst poolNamespace = poolCluster.of('clusterA');\n// highlight-end\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"Testing",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n\npoolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(rows, fields);\n});\n"})})}),"\n",(0,r.jsx)("hr",{}),"\n",(0,r.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,r.jsx)(n.h3,{id:"pooloptions",children:"PoolOptions"}),"\n",(0,r.jsxs)("blockquote",{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"PoolOptions"})," extends all options from ",(0,r.jsx)(n.strong,{children:"ConnectionOptions"}),":"]}),(0,r.jsx)(c.Z,{title:"ConnectionOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts",extractMethod:"ConnectionOptions",methodType:"interface"})})]}),"\n",(0,r.jsx)(c.Z,{title:"PoolOptions Specification",children:(0,r.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Pool.d.ts",extractMethod:"PoolOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>t});s(7294);var r=s(512);const o={tabItem:"tabItem_Ymn6"};var l=s(5893);function t(e){let{children:n,hidden:s,className:t}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,t),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>C});var r=s(7294),o=s(512),l=s(2466),t=s(6550),c=s(469),i=s(1980),a=s(7392),d=s(12);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:s,attributes:r,default:o}}=e;return{value:n,label:s,attributes:r,default:o}}))}(s);return function(e){const n=(0,a.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:s}=e;const o=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(o.location.search);n.set(l,e),o.replace({...o.location,search:n.toString()})}),[l,o])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,l=h(e),[t,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[a,u]=g({queryString:s,groupId:o}),[m,x]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,l]=(0,d.Nk)(s);return[o,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:o}),j=(()=>{const e=a??m;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:t,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),u(e),x(e)}),[u,x,l]),tabValues:l}}var x=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function y(e){let{className:n,block:s,selectedValue:r,selectValue:t,tabValues:c}=e;const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.o5)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),o=c[s].value;o!==r&&(a(n),t(o))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:c.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:u,onClick:d,...l,className:(0,o.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":r===n}),children:s??n},n)}))})}function b(e){let{lazy:n,children:s,selectedValue:o}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function q(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,o.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(y,{...e,...n}),(0,f.jsx)(b,{...e,...n})]})}function C(e){const n=(0,x.Z)();return(0,f.jsx)(q,{...e,children:u(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var r=s(7294),o=s(2263),l=s(9286),t=s(5893);const c=()=>(0,t.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:a}=e;const[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!0),[g,m]=(0,r.useState)(!0),{siteConfig:x}=(0,o.Z)(),j=x.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,r.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&a?((e,n,s)=>{const r=e.split("\n"),o=`${s} ${n}`;let l=!1,t=0,c="";for(const i of r)if(i.includes(o)&&(l=!0),l&&(i.includes("{")&&t++,c+=i+"\n",i.includes("}")&&(t--,0===t)))break;return c.trim()||e})(e,i,a):e;u(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,a]),(0,t.jsx)(t.Fragment,{children:h?(0,t.jsx)(c,{}):(0,t.jsx)(t.Fragment,{children:g?(0,t.jsxs)("div",{children:["Unable to access the requested link: ",(0,t.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,t.jsx)(l.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var r=s(4673),o=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,o.jsx)(r.Z,{open:s,className:"faq",summary:(0,o.jsx)("summary",{children:(0,o.jsx)("strong",{children:l})}),children:(0,o.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/b80d201b.44ad2ef4.js b/zh-CN/assets/js/b80d201b.44ad2ef4.js deleted file mode 100644 index 091b4882b4..0000000000 --- a/zh-CN/assets/js/b80d201b.44ad2ef4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6061],{1384:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="UPDATE",d={id:"examples/queries/prepared-statements/update",title:"UPDATE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/update.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/update",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/update.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select"},next:{title:"DELETE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),g=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),j(e)}),[d,j,l]),tabValues:l}}var j=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:j}=(0,r.Z)(),g=j.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${g}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/b80d201b.500ffac6.js b/zh-CN/assets/js/b80d201b.500ffac6.js new file mode 100644 index 0000000000..4756f234b3 --- /dev/null +++ b/zh-CN/assets/js/b80d201b.500ffac6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6061],{1384:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var s=t(5893),r=t(1151),l=t(4866),a=t(5162),o=t(6393),i=t(4379);const c={sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="UPDATE",d={id:"examples/queries/prepared-statements/update",title:"UPDATE",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/update.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/update",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/update.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"SELECT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select"},next:{title:"DELETE",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"update",children:"UPDATE"}),"\n",(0,s.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:(0,s.jsxs)(n.strong,{children:["execute(options: ",(0,s.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\n const values = [20, 'Josh'];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,s.jsx)(a.Z,{value:"callback.js",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1';\nconst values = [20, 'Josh'];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"result"}),": contains a ",(0,s.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["The connection used for the query (",(0,s.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"})," or ",(0,s.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,s.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,s.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,s.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,s.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,s.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>a});t(7294);var s=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function a(e){let{children:n,hidden:t,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,s.Z)(r.tabItem,a),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>q});var s=t(7294),r=t(512),l=t(2466),a=t(6550),o=t(469),i=t(1980),c=t(7392),u=t(12);function d(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:t}=e;return(0,s.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}))}(t);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function p(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:t}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i._X)(l),(0,s.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=h(e),[a,i]=(0,s.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const s=t.find((e=>e.default))??t[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:t,groupId:r}),[m,j]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(t);return[r,(0,s.useCallback)((e=>{t&&l.set(e)}),[t,l])]}({groupId:r}),g=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{g&&i(g)}),[g]);return{selectedValue:a,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),j(e)}),[d,j,l]),tabValues:l}}var j=t(2389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(5893);function b(e){let{className:n,block:t,selectedValue:s,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,t=i.indexOf(n),r=o[t].value;r!==s&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:o.map((e=>{let{value:n,label:t,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":s===n}),children:t??n},n)}))})}function v(e){let{lazy:n,children:t,selectedValue:r}=e;const l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,j.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,t)=>{t.d(n,{I:()=>i});var s=t(7294),r=t(2263),l=t(9286),a=t(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:t,extractMethod:i,methodType:c}=e;const[u,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!0),[x,m]=(0,s.useState)(!0),{siteConfig:j}=(0,r.Z)(),g=j.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${g}${n}`:n;return(0,s.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,t)=>{const s=e.split("\n"),r=`${t} ${n}`;let l=!1,a=0,o="";for(const i of s)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${t}`,children:u})})})}},6393:(e,n,t)=>{t.d(n,{Z:()=>l});var s=t(4673),r=t(5893);const l=e=>{let{children:n,open:t,title:l}=e;return(0,r.jsx)(s.Z,{open:t,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/cdbda324.498ff172.js b/zh-CN/assets/js/cdbda324.498ff172.js new file mode 100644 index 0000000000..5d043a1d0e --- /dev/null +++ b/zh-CN/assets/js/cdbda324.498ff172.js @@ -0,0 +1,2 @@ +/*! For license information please see cdbda324.498ff172.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4116],{1851:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>i,default:()=>g,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var s=r(5893),t=r(1151),o=r(6393),l=r(3901);const c={},i="How to handle errors?",a={id:"faq/how-to-handle-errors",title:"How to handle errors?",description:"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.",source:"@site/docs/faq/how-to-handle-errors.mdx",sourceDirName:"faq",slug:"/faq/how-to-handle-errors",permalink:"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/faq/how-to-handle-errors.mdx",tags:[],version:"current",frontMatter:{},sidebar:"faq",previous:{title:"Introduction",permalink:"/node-mysql2/zh-CN/docs/faq"}},h={},d=[{value:"Using callbacks",id:"using-callbacks",level:2},{value:"Using promises",id:"using-promises",level:2},{value:"Related Links",id:"related-links",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"how-to-handle-errors",children:"How to handle errors?"}),"\n",(0,s.jsxs)(n.p,{children:["This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"}),", ",(0,s.jsx)(n.code,{children:"createPoolCluster"}),", ",(0,s.jsx)(n.code,{children:"execute"})," and ",(0,s.jsx)(n.code,{children:"query"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"using-callbacks",children:"Using callbacks"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsx)(n.p,{children:"Handling connection errors by adding an error event listener:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconnection = mysql.createConnection({\n host: '',\n user: '',\n database: '',\n});\n\n// highlight-start\nconnection.addListener('error', (err) => {\n if (err instanceof Error) {\n console.log(`createConnection error:`, err);\n }\n});\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\npool.getConnection((err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('pool.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\npoolCluster.getConnection('NodeI', (err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('poolCluster.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.execute('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('execute error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.query('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('query error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.h2,{id:"using-promises",children:"Using promises"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n const connection = await mysql.createConnection({\n host: '',\n user: '',\n database: '',\n });\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n const connection = await pool.getConnection();\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n await poolCluster.getConnection('NodeI');\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('createConnection error:', err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.execute('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('execute error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.query('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('query error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)("hr",{}),"\n",(0,s.jsx)(n.h2,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Discussions","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/1998",children:"#1998"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/2282",children:"#2282"})}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},4673:(e,n,r)=>{r.d(n,{Z:()=>x});var s=r(7294),t=r(512),o=r(2389),l=r(6043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var i=r(5893);function a(e){return!!e&&("SUMMARY"===e.tagName||a(e.parentElement))}function h(e,n){return!!e&&(e===n||h(e.parentElement,n))}function d(e){let{summary:n,children:r,...d}=e;const u=(0,o.Z)(),g=(0,s.useRef)(null),{collapsed:x,setCollapsed:j}=(0,l.u)({initialState:!d.open}),[p,m]=(0,s.useState)(d.open),y=s.isValidElement(n)?n:(0,i.jsx)("summary",{children:n??"Details"});return(0,i.jsxs)("details",{...d,ref:g,open:p,"data-collapsed":x,className:(0,t.Z)(c.details,u&&c.isBrowser,d.className),onMouseDown:e=>{a(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;a(n)&&h(n,g.current)&&(e.preventDefault(),x?(j(!1),m(!0)):j(!0))},children:[y,(0,i.jsx)(l.z,{lazy:!1,collapsed:x,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),m(!e)},children:(0,i.jsx)("div",{className:c.collapsibleContent,children:r})})]})}const u={details:"details_b_Ee"},g="alert alert--info";function x(e){let{...n}=e;return(0,i.jsx)(d,{...n,className:(0,t.Z)(g,u.details,n.className)})}},6393:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(4673),t=r(5893);const o=e=>{let{children:n,open:r,title:o}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}},3901:(e,n,r)=>{r.d(n,{X:()=>u});var s=r(3692),t=r(4297);const o=(0,t.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,t.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),c=(0,t.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),i=(0,t.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,t.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),h=(0,t.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var d=r(5893);const u=e=>{let{level:n,message:r}=e;const t={0:{title:"Deprecated",icon:(0,d.jsx)(o,{})},1:{title:"Experimental",icon:(0,d.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,d.jsx)(c,{})},1.2:{title:"Release Candidate",icon:(0,d.jsx)(i,{})},2:{title:"Stable",icon:(0,d.jsx)(a,{})},3:{title:"Legacy",icon:(0,d.jsx)(h,{})}};return(0,d.jsxs)("section",{className:"stability","data-level":n,children:[(0,d.jsx)(s.Z,{to:"/docs/stability-badges",children:(0,d.jsxs)("header",{children:[(0,d.jsx)("strong",{children:n}),(0,d.jsx)("span",{children:t[n].title}),t[n].icon]})}),r?(0,d.jsx)("p",{children:r}):null]})}},4297:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(7294),t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const o=(e,n)=>{const r=(0,s.forwardRef)((({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:i="",children:a,...h},d)=>{return(0,s.createElement)("svg",{ref:d,...t,width:o,height:o,stroke:r,strokeWidth:c?24*Number(l)/Number(o):l,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...h},[...n.map((([e,n])=>(0,s.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var u}));return r.displayName=`${e}`,r}},1151:(e,n,r)=>{r.d(n,{Z:()=>c,a:()=>l});var s=r(7294);const t={},o=s.createContext(t);function l(e){const n=s.useContext(o);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:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/cdbda324.4bee815a.js.LICENSE.txt b/zh-CN/assets/js/cdbda324.498ff172.js.LICENSE.txt similarity index 100% rename from zh-CN/assets/js/cdbda324.4bee815a.js.LICENSE.txt rename to zh-CN/assets/js/cdbda324.498ff172.js.LICENSE.txt diff --git a/zh-CN/assets/js/cdbda324.4bee815a.js b/zh-CN/assets/js/cdbda324.4bee815a.js deleted file mode 100644 index 689d5d6881..0000000000 --- a/zh-CN/assets/js/cdbda324.4bee815a.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see cdbda324.4bee815a.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4116],{1851:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>h,contentTitle:()=>i,default:()=>g,frontMatter:()=>c,metadata:()=>a,toc:()=>d});var s=r(5893),t=r(1151),o=r(6393),l=r(3901);const c={},i="How to handle errors?",a={id:"faq/how-to-handle-errors",title:"How to handle errors?",description:"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.",source:"@site/docs/faq/how-to-handle-errors.mdx",sourceDirName:"faq",slug:"/faq/how-to-handle-errors",permalink:"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/faq/how-to-handle-errors.mdx",tags:[],version:"current",frontMatter:{},sidebar:"faq",previous:{title:"Introduction",permalink:"/node-mysql2/zh-CN/docs/faq"}},h={},d=[{value:"Using callbacks",id:"using-callbacks",level:2},{value:"Using promises",id:"using-promises",level:2},{value:"Related Links",id:"related-links",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"how-to-handle-errors",children:"How to handle errors?"}),"\n",(0,s.jsxs)(n.p,{children:["This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as ",(0,s.jsx)(n.code,{children:"createConnection"}),", ",(0,s.jsx)(n.code,{children:"createPool"}),", ",(0,s.jsx)(n.code,{children:"createPoolCluster"}),", ",(0,s.jsx)(n.code,{children:"execute"})," and ",(0,s.jsx)(n.code,{children:"query"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"using-callbacks",children:"Using callbacks"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsx)(n.p,{children:"Handling connection errors by adding an error event listener:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconnection = mysql.createConnection({\n host: '',\n user: '',\n database: '',\n});\n\n// highlight-start\nconnection.addListener('error', (err) => {\n if (err instanceof Error) {\n console.log(`createConnection error:`, err);\n }\n});\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\npool.getConnection((err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('pool.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const mysql = require('mysql2');\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\npoolCluster.getConnection('NodeI', (err, connection) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('poolCluster.getConnection error:', err);\n return;\n }\n // highlight-end\n});\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.execute('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('execute error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through callback's ",(0,s.jsx)(n.code,{children:"err"})," parameter:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"connection.query('SELEC 1 + 1', (err, rows) => {\n // highlight-start\n if (err instanceof Error) {\n console.log('query error:', err);\n return;\n }\n // highlight-end\n\n console.log(rows);\n});\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.h2,{id:"using-promises",children:"Using promises"}),"\n",(0,s.jsxs)(o.Z,{title:"createConnection",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested and confirmed as the correct answer."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\ntry {\n const connection = await mysql.createConnection({\n host: '',\n user: '',\n database: '',\n });\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPool",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst pool = mysql.createPool({\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n const connection = await pool.getConnection();\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log(err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"createPoolCluster",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling connection errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import mysql from 'mysql2/promise';\n\nconst poolCluster = mysql.createPoolCluster();\n\npoolCluster.add('NodeI', {\n host: '',\n user: '',\n database: '',\n});\n\ntry {\n await poolCluster.getConnection('NodeI');\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('createConnection error:', err);\n }\n}\n// highlight-end\n"})})]}),"\n",(0,s.jsxs)(o.Z,{title:"execute",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"execute"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.execute('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('execute error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsxs)(o.Z,{title:"query",children:[(0,s.jsx)(l.X,{level:2,message:"This solution has been tested."}),(0,s.jsxs)(n.p,{children:["Handling ",(0,s.jsx)(n.code,{children:"query"})," errors through ",(0,s.jsx)(n.code,{children:"try-catch"})," block:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"try {\n const [rows] = await connection.query('SELEC 1 + 1');\n console.log(rows);\n // highlight-start\n} catch (err) {\n if (err instanceof Error) {\n console.log('query error:', err);\n }\n}\n// highlight-end\n"})}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["It will work for both ",(0,s.jsx)(n.strong,{children:"createConnection"}),", ",(0,s.jsx)(n.strong,{children:"createPool"})," and ",(0,s.jsx)(n.strong,{children:"createPoolCluster"})," connections."]}),"\n"]})]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsx)(n.h2,{id:"related-links",children:"Related Links"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Discussions","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/1998",children:"#1998"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2/discussions/2282",children:"#2282"})}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},4673:(e,n,r)=>{r.d(n,{Z:()=>x});var s=r(7294),t=r(512),o=r(2389),l=r(6043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};var i=r(5893);function a(e){return!!e&&("SUMMARY"===e.tagName||a(e.parentElement))}function h(e,n){return!!e&&(e===n||h(e.parentElement,n))}function d(e){let{summary:n,children:r,...d}=e;const u=(0,o.Z)(),g=(0,s.useRef)(null),{collapsed:x,setCollapsed:j}=(0,l.u)({initialState:!d.open}),[p,m]=(0,s.useState)(d.open),y=s.isValidElement(n)?n:(0,i.jsx)("summary",{children:n??"Details"});return(0,i.jsxs)("details",{...d,ref:g,open:p,"data-collapsed":x,className:(0,t.Z)(c.details,u&&c.isBrowser,d.className),onMouseDown:e=>{a(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;a(n)&&h(n,g.current)&&(e.preventDefault(),x?(j(!1),m(!0)):j(!0))},children:[y,(0,i.jsx)(l.z,{lazy:!1,collapsed:x,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{j(e),m(!e)},children:(0,i.jsx)("div",{className:c.collapsibleContent,children:r})})]})}const u={details:"details_b_Ee"},g="alert alert--info";function x(e){let{...n}=e;return(0,i.jsx)(d,{...n,className:(0,t.Z)(g,u.details,n.className)})}},6393:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(4673),t=r(5893);const o=e=>{let{children:n,open:r,title:o}=e;return(0,t.jsx)(s.Z,{open:r,className:"faq",summary:(0,t.jsx)("summary",{children:(0,t.jsx)("strong",{children:o})}),children:(0,t.jsx)("section",{children:n})})}},3901:(e,n,r)=>{r.d(n,{X:()=>u});var s=r(3692),t=r(4297);const o=(0,t.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,t.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),c=(0,t.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),i=(0,t.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,t.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),h=(0,t.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var d=r(5893);const u=e=>{let{level:n,message:r}=e;const t={0:{title:"Deprecated",icon:(0,d.jsx)(o,{})},1:{title:"Experimental",icon:(0,d.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,d.jsx)(c,{})},1.2:{title:"Release Candidate",icon:(0,d.jsx)(i,{})},2:{title:"Stable",icon:(0,d.jsx)(a,{})},3:{title:"Legacy",icon:(0,d.jsx)(h,{})}};return(0,d.jsxs)("section",{className:"stability","data-level":n,children:[(0,d.jsx)(s.Z,{to:"/docs/stability-badges",children:(0,d.jsxs)("header",{children:[(0,d.jsx)("strong",{children:n}),(0,d.jsx)("span",{children:t[n].title}),t[n].icon]})}),r?(0,d.jsx)("p",{children:r}):null]})}},4297:(e,n,r)=>{r.d(n,{Z:()=>o});var s=r(7294),t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const o=(e,n)=>{const r=(0,s.forwardRef)((({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:i="",children:a,...h},d)=>{return(0,s.createElement)("svg",{ref:d,...t,width:o,height:o,stroke:r,strokeWidth:c?24*Number(l)/Number(o):l,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,i].join(" "),...h},[...n.map((([e,n])=>(0,s.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var u}));return r.displayName=`${e}`,r}},1151:(e,n,r)=>{r.d(n,{Z:()=>c,a:()=>l});var s=r(7294);const t={},o=s.createContext(t);function l(e){const n=s.useContext(o);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:l(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/db044f71.24186b99.js b/zh-CN/assets/js/db044f71.24186b99.js new file mode 100644 index 0000000000..f5c698002d --- /dev/null +++ b/zh-CN/assets/js/db044f71.24186b99.js @@ -0,0 +1,2 @@ +/*! For license information please see db044f71.24186b99.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6159],{8009:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>d});var a=s(5893),i=s(1151),n=s(3901);const r={},o="Stability Badges",l={id:"stability-badges",title:"Stability Badges",description:"The Stability Badges are indications of a section's stability.",source:"@site/docs/stability-badges.mdx",sourceDirName:".",slug:"/stability-badges",permalink:"/node-mysql2/zh-CN/docs/stability-badges",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/stability-badges.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"MySQL2\u7684\u5386\u53f2\u4ee5\u53ca\u9009\u62e9\u539f\u56e0",permalink:"/node-mysql2/zh-CN/docs/history-and-why-mysq2"},next:{title:"Introduction",permalink:"/node-mysql2/zh-CN/docs/documentation"}},c={},d=[];function h(e){const t={blockquote:"blockquote",h1:"h1",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"stability-badges",children:"Stability Badges"}),"\n",(0,a.jsxs)(t.p,{children:["The ",(0,a.jsx)(t.strong,{children:"Stability Badges"})," are indications of a section's stability."]}),"\n",(0,a.jsx)(t.p,{children:"The stability indices are as follows:"}),"\n",(0,a.jsx)(n.X,{level:0,message:"The feature might generate warnings and does not assure backward compatibility."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.strong,{children:"Experimental"}),": These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged."]}),"\n",(0,a.jsxs)(t.blockquote,{children:["\n",(0,a.jsx)(t.p,{children:"Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features."}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"Experimental features are classified into stages:"}),"\n",(0,a.jsx)(n.X,{level:1,message:"Experimental features at this stage are currently in development and prone to considerable changes."}),"\n",(0,a.jsx)(n.X,{level:1.1,message:"Experimental features at this stage are approaching minimum viability."}),"\n",(0,a.jsx)(n.X,{level:1.2,message:"Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsx)(n.X,{level:2,message:"Compatibility with the MySQL ecosystem is a high priority."}),"\n",(0,a.jsx)("hr",{}),"\n",(0,a.jsx)(n.X,{level:3,message:"This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available."}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed."}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},3901:(e,t,s)=>{s.d(t,{X:()=>u});var a=s(3692),i=s(4297);const n=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),r=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),l=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),c=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const u=e=>{let{level:t,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(n,{})},1:{title:"Experimental",icon:(0,h.jsx)(r,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(l,{})},2:{title:"Stable",icon:(0,h.jsx)(c,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":t,children:[(0,h.jsx)(a.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:t}),(0,h.jsx)("span",{children:i[t].title}),i[t].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const n=(e,t)=>{const s=(0,a.forwardRef)((({color:s="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>{return(0,a.createElement)("svg",{ref:h,...i,width:n,height:n,stroke:s,strokeWidth:o?24*Number(r)/Number(n):r,className:["lucide",`lucide-${u=e,u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,l].join(" "),...d},[...t.map((([e,t])=>(0,a.createElement)(e,t))),...Array.isArray(c)?c:[c]]);var u}));return s.displayName=`${e}`,s}},1151:(e,t,s)=>{s.d(t,{Z:()=>o,a:()=>r});var a=s(7294);const i={},n=a.createContext(i);function r(e){const t=a.useContext(n);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(n.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/db044f71.ad539a4f.js.LICENSE.txt b/zh-CN/assets/js/db044f71.24186b99.js.LICENSE.txt similarity index 100% rename from zh-CN/assets/js/db044f71.ad539a4f.js.LICENSE.txt rename to zh-CN/assets/js/db044f71.24186b99.js.LICENSE.txt diff --git a/zh-CN/assets/js/e19cd79a.5eae6886.js b/zh-CN/assets/js/e19cd79a.5eae6886.js deleted file mode 100644 index 883d3b56e3..0000000000 --- a/zh-CN/assets/js/e19cd79a.5eae6886.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1429],{2998:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=s(5893),r=s(1151),l=s(4866),a=s(5162),o=s(6393),i=s(4379);const c={sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="INSERT",d={id:"examples/queries/prepared-statements/insert",title:"INSERT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/insert.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/insert",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/insert.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:0,frontMatter:{sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/"},next:{title:"SELECT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"insert",children:"INSERT"}),"\n",(0,t.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const r={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),r=s(512),l=s(2466),a=s(6550),o=s(469),i=s(1980),c=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:r}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:s,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(s);return[r,(0,t.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=i.indexOf(n),r=o[s].value;r!==t&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:r}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var t=s(7294),r=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[x,m]=(0,t.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,s)=>{const t=e.split("\n"),r=`${s} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(4673),r=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,r.jsx)(t.Z,{open:s,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/e19cd79a.7bd849d7.js b/zh-CN/assets/js/e19cd79a.7bd849d7.js new file mode 100644 index 0000000000..cc39867208 --- /dev/null +++ b/zh-CN/assets/js/e19cd79a.7bd849d7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1429],{2998:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>u,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>p});var t=s(5893),r=s(1151),l=s(4866),a=s(5162),o=s(6393),i=s(4379);const c={sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},u="INSERT",d={id:"examples/queries/prepared-statements/insert",title:"INSERT",description:"execute(sql, values)",source:"@site/docs/examples/queries/prepared-statements/insert.mdx",sourceDirName:"examples/queries/prepared-statements",slug:"/examples/queries/prepared-statements/insert",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/examples/queries/prepared-statements/insert.mdx",tags:[{label:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/tags/prepared-statements"},{label:"Placeholders",permalink:"/node-mysql2/zh-CN/docs/tags/placeholders"},{label:"Parameters",permalink:"/node-mysql2/zh-CN/docs/tags/parameters"},{label:"execute",permalink:"/node-mysql2/zh-CN/docs/tags/execute"}],version:"current",sidebarPosition:0,frontMatter:{sidebar_position:0,tags:["Prepared Statements","Placeholders","Parameters","execute"]},sidebar:"examples",previous:{title:"Prepared Statements",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/"},next:{title:"SELECT",permalink:"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select"}},h={},p=[{value:"execute(sql, values)",id:"executesql-values",level:2},{value:"execute(options)",id:"executeoptions",level:2},{value:"execute(options, values)",id:"executeoptions-values",level:2},{value:"Glossary",id:"glossary",level:2},{value:"ResultSetHeader",id:"resultsetheader",level:3},{value:"QueryOptions",id:"queryoptions",level:3}];function x(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"insert",children:"INSERT"}),"\n",(0,t.jsx)(n.h2,{id:"executesql-values",children:"execute(sql, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"execute(sql: string, values: any[])"})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-next-line\n const [result, fields] = await connection.execute(sql, values);\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(sql, values, (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n});\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions",children:"execute(options)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),")"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute({\n sql,\n values,\n // ... other options\n });\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n values,\n // ... other options\n },\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"executeoptions-values",children:"execute(options, values)"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["execute(options: ",(0,t.jsx)(n.a,{href:"#queryoptions",children:"QueryOptions"}),", values: any[])"]})}),"\n"]}),"\n",(0,t.jsxs)(l.Z,{children:[(0,t.jsx)(a.Z,{value:"promise.js",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"try {\n const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\n const values = ['Josh', 19, 'Page', 45];\n\n // highlight-start\n const [result, fields] = await connection.execute(\n {\n sql,\n // ... other options\n },\n values\n );\n // highlight-end\n\n console.log(result);\n console.log(fields);\n} catch (err) {\n console.log(err);\n}\n"})})}),(0,t.jsx)(a.Z,{value:"callback.js",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)';\nconst values = ['Josh', 19, 'Page', 45];\n\nconnection.execute(\n {\n sql,\n // ... other options\n },\n values,\n (err, result, fields) => {\n if (err instanceof Error) {\n console.log(err);\n return;\n }\n\n console.log(result);\n console.log(fields);\n }\n);\n"})})})]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"result"}),": contains a ",(0,t.jsx)(n.a,{href:"#resultsetheader",children:"ResultSetHeader"})," object, which provides details about the operation executed by the server."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"fields"})," contains extra meta data about the operation, if available"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["The connection used for the query (",(0,t.jsx)(n.code,{children:"execute"}),") can be obtained through the ",(0,t.jsx)(n.code,{children:"createConnection"}),", ",(0,t.jsx)(n.code,{children:"createPool"})," or ",(0,t.jsx)(n.code,{children:"createPoolCluster"})," methods."]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"glossary",children:"Glossary"}),"\n",(0,t.jsx)(n.h3,{id:"resultsetheader",children:"ResultSetHeader"}),"\n",(0,t.jsx)(o.Z,{title:"ResultSetHeader Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts",extractMethod:"ResultSetHeader",methodType:"interface"})}),"\n",(0,t.jsx)(n.h3,{id:"queryoptions",children:"QueryOptions"}),"\n",(0,t.jsx)(o.Z,{title:"QueryOptions Specification",children:(0,t.jsx)(i.I,{language:"ts",url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/protocol/sequences/Query.d.ts",extractMethod:"QueryOptions",methodType:"interface"})})]})}function m(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},5162:(e,n,s)=>{s.d(n,{Z:()=>a});s(7294);var t=s(512);const r={tabItem:"tabItem_Ymn6"};var l=s(5893);function a(e){let{children:n,hidden:s,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,a),hidden:s,children:n})}},4866:(e,n,s)=>{s.d(n,{Z:()=>q});var t=s(7294),r=s(512),l=s(2466),a=s(6550),o=s(469),i=s(1980),c=s(7392),u=s(12);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:s}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}))}(s);return function(e){const n=(0,c.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const r=(0,a.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,i._X)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(r.location.search);n.set(l,e),r.replace({...r.location,search:n.toString()})}),[l,r])]}function m(e){const{defaultValue:n,queryString:s=!1,groupId:r}=e,l=h(e),[a,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=s.find((e=>e.default))??s[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,d]=x({queryString:s,groupId:r}),[m,g]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[r,l]=(0,u.Nk)(s);return[r,(0,t.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:r}),j=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.Z)((()=>{j&&i(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=s(5893);function b(e){let{className:n,block:s,selectedValue:t,selectValue:a,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.o5)(),u=e=>{const n=e.currentTarget,s=i.indexOf(n),r=o[s].value;r!==t&&(c(n),a(r))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},n),children:o.map((e=>{let{value:n,label:s,attributes:l}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,r.Z)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:s??n},n)}))})}function v(e){let{lazy:n,children:s,selectedValue:r}=e;const l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r})))})}function y(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,r.Z)("tabs-container",j.tabList),children:[(0,f.jsx)(b,{...e,...n}),(0,f.jsx)(v,{...e,...n})]})}function q(e){const n=(0,g.Z)();return(0,f.jsx)(y,{...e,children:d(e.children)},String(n))}},4379:(e,n,s)=>{s.d(n,{I:()=>i});var t=s(7294),r=s(2263),l=s(9286),a=s(5893);const o=()=>(0,a.jsx)("span",{className:"loader"}),i=e=>{let{url:n,language:s,extractMethod:i,methodType:c}=e;const[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(!0),[x,m]=(0,t.useState)(!0),{siteConfig:g}=(0,r.Z)(),j=g.baseUrl.replace(/\/$/,""),f=/^\//.test(n)?`${j}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(f,{signal:n}).then((e=>e.text())).then((e=>{const n=i&&c?((e,n,s)=>{const t=e.split("\n"),r=`${s} ${n}`;let l=!1,a=0,o="";for(const i of t)if(i.includes(r)&&(l=!0),l&&(i.includes("{")&&a++,o+=i+"\n",i.includes("}")&&(a--,0===a)))break;return o.trim()||e})(e,i,c):e;d(n||e),p(!1),m(!1)})).catch((()=>{m(!0),p(!1)})),()=>{e.abort()}}),[f,i,c]),(0,a.jsx)(a.Fragment,{children:h?(0,a.jsx)(o,{}):(0,a.jsx)(a.Fragment,{children:x?(0,a.jsxs)("div",{children:["Unable to access the requested link: ",(0,a.jsx)("code",{children:f}),". Please verify the link or try again later."]}):(0,a.jsx)(l.Z,{className:`language-${s}`,children:u})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>l});var t=s(4673),r=s(5893);const l=e=>{let{children:n,open:s,title:l}=e;return(0,r.jsx)(t.Z,{open:s,className:"faq",summary:(0,r.jsx)("summary",{children:(0,r.jsx)("strong",{children:l})}),children:(0,r.jsx)("section",{children:n})})}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/f8d74a12.4dfb495f.js b/zh-CN/assets/js/f8d74a12.4dfb495f.js new file mode 100644 index 0000000000..5ebe8e2e67 --- /dev/null +++ b/zh-CN/assets/js/f8d74a12.4dfb495f.js @@ -0,0 +1,2 @@ +/*! For license information please see f8d74a12.4dfb495f.js.LICENSE.txt */ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5807],{7330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>x,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>h,toc:()=>m});var t=s(5893),i=s(1151),r=s(6393),l=s(8609),o=s(3901),c=s(4379);const a={title:"Documentation Site"},d="Website Contributing Guidelines",h={id:"contributing/website",title:"Documentation Site",description:"This website is built using Docusaurus 3, a modern static website generator.",source:"@site/docs/contributing/website.mdx",sourceDirName:"contributing",slug:"/contributing/website",permalink:"/node-mysql2/zh-CN/docs/contributing/website",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/contributing/website.mdx",tags:[],version:"current",frontMatter:{title:"Documentation Site"},sidebar:"docs",previous:{title:"MySQL2",permalink:"/node-mysql2/zh-CN/docs/contributing"}},x={},m=[{value:"Environment",id:"environment",level:2},{value:"Development",id:"development",level:2},{value:"Extras Components",id:"extras-components",level:2},{value:"History",id:"history",level:3},{value:"Stability",id:"stability",level:3},{value:"FAQ",id:"faq",level:3},{value:"ExternalCodeEmbed",id:"externalcodeembed",level:3},{value:"Running Tests",id:"running-tests",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"website-contributing-guidelines",children:"Website Contributing Guidelines"}),"\n",(0,t.jsxs)(n.p,{children:["This website is built using ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/",children:"Docusaurus 3"}),", a modern static website generator."]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"environment",children:"Environment"}),"\n",(0,t.jsx)(n.p,{children:"You will need these tools installed on your system:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://nodejs.org/",children:"Node.js (18.x or higher)"})}),"\n"]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"development",children:"Development"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Fork the ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2",children:"MySQL2"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Download your forked repository locally. The website's workspace is the \"",(0,t.jsx)(n.em,{children:"website"}),'" directory in ',(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new branch from ",(0,t.jsx)(n.code,{children:"master"})," (optional)."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"cd website"})," to enter the website workspace."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm ci"})," to install the dependecies from ",(0,t.jsx)(n.em,{children:"package-lock.json"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm start"})," to starting the local development."]}),"\n"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server."}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.strong,{children:"Docusaurus"})," complete documentation, please ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs",children:"see here"}),"."]}),"\n",(0,t.jsx)(r.Z,{title:"CLI example",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/sidorares/node-mysql2.git\ngit checkout -b website # optional\ncd /path-to/node-mysql2/website\nnpm ci\nnpm start\n"})})}),"\n",(0,t.jsxs)(n.p,{children:["Documentation is auto-generated from ",(0,t.jsx)(n.strong,{children:"MDX"})," files placed in these directories:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/documentation"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/examples"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/faq"})}),"\n"]}),"\n",(0,t.jsxs)(n.admonition,{title:"Caution",type:"danger",children:[(0,t.jsxs)(n.p,{children:["Note that the website has its own ",(0,t.jsx)(n.em,{children:"package.json"}),"."]}),(0,t.jsxs)(n.p,{children:["Please, do not install dependencies for the website in ",(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"extras-components",children:"Extras Components"}),"\n",(0,t.jsx)(n.p,{children:"Every extra component is thoroughly documented with complete typings descriptions."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs/markdown-features",children:(0,t.jsx)(n.strong,{children:"Docusaurus Markdown Features:"})})," The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"history",children:"History"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"History"})," component displays version changes in a table format, listing version numbers alongside their changes."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { History } from '@site/src/components/History';\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"changes"})," option."]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(l.A,{records:[{version:"1.0.0",changes:["Some change message."]}]})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"stability",children:"Stability"}),"\n",(0,t.jsxs)(n.p,{children:["See the ",(0,t.jsx)(n.a,{href:"/docs/stability-badges",children:"Stability Badges"})," for more detais."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { Stability } from '@site/src/components/Stability';\n\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"message"})," option."]})}),"\n",(0,t.jsxs)(n.p,{children:["Available levels: ",(0,t.jsx)(n.code,{children:"0"}),", ",(0,t.jsx)(n.code,{children:"1"}),", ",(0,t.jsx)(n.code,{children:"1.1"}),", ",(0,t.jsx)(n.code,{children:"1.2"}),", ",(0,t.jsx)(n.code,{children:"2"})," and ",(0,t.jsx)(n.code,{children:"3"}),"."]}),"\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(o.X,{level:2}),(0,t.jsx)(o.X,{level:2,message:"Some message."})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"faq",children:"FAQ"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { FAQ } from '@site/src/components/FAQ';\n\n\n\n > Some markdown (**MDX**) content.\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.strong,{children:"FAQ"})," component can be utilized in any section or page."]}),"\n",(0,t.jsxs)(n.li,{children:["Code blocks are compatible and can be used within the ",(0,t.jsx)(n.strong,{children:"FAQ"})," component."]}),"\n"]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(r.Z,{title:"Title",children:(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["Some markdown (",(0,t.jsx)(n.strong,{children:"MDX"}),") content."]}),"\n"]})})}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h3,{id:"externalcodeembed",children:"ExternalCodeEmbed"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed';\n\n\n\n\n"})}),"\n","\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/.prettierrc",language:"json"}),(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/tools/parse-row.js",language:"js",extractMethod:"parseC",methodType:"function"})]}),"\n",(0,t.jsx)("hr",{}),"\n",(0,t.jsx)(n.h2,{id:"running-tests",children:"Running Tests"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run test\n"})}),"\n",(0,t.jsxs)(r.Z,{title:"Check Prettier and ESLint rules for compliance",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lintcheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Check for typings errors",children:[(0,t.jsx)(o.X,{level:1,message:(0,t.jsxs)(t.Fragment,{children:["Checks for ",(0,t.jsx)(n.strong,{children:"MDX"})," components are missing."]})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run typecheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Clear and build the website",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run clear\nnpm run build\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Fix issues from Prettier and ESLint rules",open:!0,children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lint\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"To prevent lint issues, it is recommended to execute this command before creating your commit."}),"\n",(0,t.jsxs)(n.li,{children:["Not included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),i=s(2263),r=s(9286),l=s(5893);const o=()=>(0,l.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:a}=e;const[d,h]=(0,t.useState)(""),[x,m]=(0,t.useState)(!0),[u,p]=(0,t.useState)(!0),{siteConfig:j}=(0,i.Z)(),g=j.baseUrl.replace(/\/$/,""),b=/^\//.test(n)?`${g}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(b,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&a?((e,n,s)=>{const t=e.split("\n"),i=`${s} ${n}`;let r=!1,l=0,o="";for(const c of t)if(c.includes(i)&&(r=!0),r&&(c.includes("{")&&l++,o+=c+"\n",c.includes("}")&&(l--,0===l)))break;return o.trim()||e})(e,c,a):e;h(n||e),m(!1),p(!1)})).catch((()=>{p(!0),m(!1)})),()=>{e.abort()}}),[b,c,a]),(0,l.jsx)(l.Fragment,{children:x?(0,l.jsx)(o,{}):(0,l.jsx)(l.Fragment,{children:u?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:b}),". Please verify the link or try again later."]}):(0,l.jsx)(r.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(4673),i=s(5893);const r=e=>{let{children:n,open:s,title:r}=e;return(0,i.jsx)(t.Z,{open:s,className:"faq",summary:(0,i.jsx)("summary",{children:(0,i.jsx)("strong",{children:r})}),children:(0,i.jsx)("section",{children:n})})}},8609:(e,n,s)=>{s.d(n,{A:()=>l});var t=s(4673);const i=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var r=s(5893);const l=e=>{let{records:n,open:s}=e;return(0,r.jsx)(t.Z,{open:s,summary:(0,r.jsxs)("summary",{children:[(0,r.jsx)(i,{})," History"]}),className:"history",children:(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Version"}),(0,r.jsx)("th",{children:"Changes"})]})}),(0,r.jsx)("tbody",{children:n.map(((e,n)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,r.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>x});var t=s(3692),i=s(4297);const r=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),c=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const x=e=>{let{level:n,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(r,{})},1:{title:"Experimental",icon:(0,h.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(c,{})},2:{title:"Stable",icon:(0,h.jsx)(a,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:i[n].title}),i[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:a,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...i,width:r,height:r,stroke:s,strokeWidth:o?24*Number(l)/Number(r):l,className:["lucide",`lucide-${x=e,x.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,c].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var x}));return s.displayName=`${e}`,s}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/f8d74a12.dacaf582.js.LICENSE.txt b/zh-CN/assets/js/f8d74a12.4dfb495f.js.LICENSE.txt similarity index 100% rename from zh-CN/assets/js/f8d74a12.dacaf582.js.LICENSE.txt rename to zh-CN/assets/js/f8d74a12.4dfb495f.js.LICENSE.txt diff --git a/zh-CN/assets/js/f8d74a12.dacaf582.js b/zh-CN/assets/js/f8d74a12.dacaf582.js deleted file mode 100644 index b65180e74a..0000000000 --- a/zh-CN/assets/js/f8d74a12.dacaf582.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see f8d74a12.dacaf582.js.LICENSE.txt */ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5807],{7330:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>x,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>h,toc:()=>m});var t=s(5893),i=s(1151),r=s(6393),l=s(8609),o=s(3901),c=s(4379);const a={title:"Documentation Site"},d="Website Contributing Guidelines",h={id:"contributing/website",title:"Documentation Site",description:"This website is built using Docusaurus 3, a modern static website generator.",source:"@site/docs/contributing/website.mdx",sourceDirName:"contributing",slug:"/contributing/website",permalink:"/node-mysql2/zh-CN/docs/contributing/website",draft:!1,unlisted:!1,editUrl:"https://github.com/sidorares/node-mysql2/tree/master/website/docs/contributing/website.mdx",tags:[],version:"current",frontMatter:{title:"Documentation Site"},sidebar:"docs",previous:{title:"MySQL2",permalink:"/node-mysql2/zh-CN/docs/contributing"}},x={},m=[{value:"Environment",id:"environment",level:2},{value:"Development",id:"development",level:2},{value:"Extras Components",id:"extras-components",level:2},{value:"History",id:"history",level:3},{value:"Stability",id:"stability",level:3},{value:"FAQ",id:"faq",level:3},{value:"ExternalCodeEmbed",id:"externalcodeembed",level:3},{value:"Running Tests",id:"running-tests",level:2}];function u(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"website-contributing-guidelines",children:"Website Contributing Guidelines"}),"\n",(0,t.jsxs)(n.p,{children:["This website is built using ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/",children:"Docusaurus 3"}),", a modern static website generator."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"environment",children:"Environment"}),"\n",(0,t.jsx)(n.p,{children:"You will need these tools installed on your system:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://nodejs.org/",children:"Node.js (18.x or higher)"})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"development",children:"Development"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Fork the ",(0,t.jsx)(n.a,{href:"https://github.com/sidorares/node-mysql2",children:"MySQL2"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Download your forked repository locally. The website's workspace is the \"",(0,t.jsx)(n.em,{children:"website"}),'" directory in ',(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new branch from ",(0,t.jsx)(n.code,{children:"master"})," (optional)."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"cd website"})," to enter the website workspace."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm ci"})," to install the dependecies from ",(0,t.jsx)(n.em,{children:"package-lock.json"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"npm start"})," to starting the local development."]}),"\n"]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsx)(n.p,{children:"It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server."}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For ",(0,t.jsx)(n.strong,{children:"Docusaurus"})," complete documentation, please ",(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs",children:"see here"}),"."]}),"\n",(0,t.jsx)(r.Z,{title:"CLI example",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/sidorares/node-mysql2.git\ngit checkout -b website # optional\ncd /path-to/node-mysql2/website\nnpm ci\nnpm start\n"})})}),"\n",(0,t.jsxs)(n.p,{children:["Documentation is auto-generated from ",(0,t.jsx)(n.strong,{children:"MDX"})," files placed in these directories:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/documentation"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/examples"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.em,{children:"./docs/faq"})}),"\n"]}),"\n",(0,t.jsxs)(n.admonition,{title:"Caution",type:"danger",children:[(0,t.jsxs)(n.p,{children:["Note that the website has its own ",(0,t.jsx)(n.em,{children:"package.json"}),"."]}),(0,t.jsxs)(n.p,{children:["Please, do not install dependencies for the website in ",(0,t.jsx)(n.strong,{children:"node-mysql2"})," root."]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"extras-components",children:"Extras Components"}),"\n",(0,t.jsx)(n.p,{children:"Every extra component is thoroughly documented with complete typings descriptions."}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docusaurus.io/docs/markdown-features",children:(0,t.jsx)(n.strong,{children:"Docusaurus Markdown Features:"})})," The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"history",children:"History"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"History"})," component displays version changes in a table format, listing version numbers alongside their changes."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { History } from '@site/src/components/History';\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"changes"})," option."]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(l.A,{records:[{version:"1.0.0",changes:["Some change message."]}]})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"stability",children:"Stability"}),"\n",(0,t.jsxs)(n.p,{children:["See the ",(0,t.jsx)(n.a,{href:"/docs/stability-badges",children:"Stability Badges"})," for more detais."]}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { Stability } from '@site/src/components/Stability';\n\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can also utilize React components in the ",(0,t.jsx)(n.code,{children:"message"})," option."]})}),"\n",(0,t.jsxs)(n.p,{children:["Available levels: ",(0,t.jsx)(n.code,{children:"0"}),", ",(0,t.jsx)(n.code,{children:"1"}),", ",(0,t.jsx)(n.code,{children:"1.1"}),", ",(0,t.jsx)(n.code,{children:"1.2"}),", ",(0,t.jsx)(n.code,{children:"2"})," and ",(0,t.jsx)(n.code,{children:"3"}),"."]}),"\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(o.X,{level:2}),(0,t.jsx)(o.X,{level:2,message:"Some message."})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"faq",children:"FAQ"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { FAQ } from '@site/src/components/FAQ';\n\n\n\n > Some markdown (**MDX**) content.\n\n\n"})}),"\n","\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.strong,{children:"FAQ"})," component can be utilized in any section or page."]}),"\n",(0,t.jsxs)(n.li,{children:["Code blocks are compatible and can be used within the ",(0,t.jsx)(n.strong,{children:"FAQ"})," component."]}),"\n"]})}),"\n",(0,t.jsx)(r.Z,{title:"Example",children:(0,t.jsx)(r.Z,{title:"Title",children:(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["Some markdown (",(0,t.jsx)(n.strong,{children:"MDX"}),") content."]}),"\n"]})})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"externalcodeembed",children:"ExternalCodeEmbed"}),"\n","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",children:"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed';\n\n\n\n\n"})}),"\n","\n",(0,t.jsxs)(r.Z,{title:"Example",children:[(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/.prettierrc",language:"json"}),(0,t.jsx)(c.I,{url:"https://raw.githubusercontent.com/sidorares/node-mysql2/master/tools/parse-row.js",language:"js",extractMethod:"parseC",methodType:"function"})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"running-tests",children:"Running Tests"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run test\n"})}),"\n",(0,t.jsxs)(r.Z,{title:"Check Prettier and ESLint rules for compliance",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lintcheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Check for typings errors",children:[(0,t.jsx)(o.X,{level:1,message:(0,t.jsxs)(t.Fragment,{children:["Checks for ",(0,t.jsx)(n.strong,{children:"MDX"})," components are missing."]})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run typecheck\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Clear and build the website",children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run clear\nnpm run build\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]}),"\n",(0,t.jsxs)(r.Z,{title:"Fix issues from Prettier and ESLint rules",open:!0,children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run lint\n"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"To prevent lint issues, it is recommended to execute this command before creating your commit."}),"\n",(0,t.jsxs)(n.li,{children:["Not included in the ",(0,t.jsx)(n.strong,{children:"GitHub Actions"})," workflow."]}),"\n"]})]})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},4379:(e,n,s)=>{s.d(n,{I:()=>c});var t=s(7294),i=s(2263),r=s(9286),l=s(5893);const o=()=>(0,l.jsx)("span",{className:"loader"}),c=e=>{let{url:n,language:s,extractMethod:c,methodType:a}=e;const[d,h]=(0,t.useState)(""),[x,m]=(0,t.useState)(!0),[u,p]=(0,t.useState)(!0),{siteConfig:j}=(0,i.Z)(),g=j.baseUrl.replace(/\/$/,""),b=/^\//.test(n)?`${g}${n}`:n;return(0,t.useEffect)((()=>{const e=new AbortController,n=e.signal;return fetch(b,{signal:n}).then((e=>e.text())).then((e=>{const n=c&&a?((e,n,s)=>{const t=e.split("\n"),i=`${s} ${n}`;let r=!1,l=0,o="";for(const c of t)if(c.includes(i)&&(r=!0),r&&(c.includes("{")&&l++,o+=c+"\n",c.includes("}")&&(l--,0===l)))break;return o.trim()||e})(e,c,a):e;h(n||e),m(!1),p(!1)})).catch((()=>{p(!0),m(!1)})),()=>{e.abort()}}),[b,c,a]),(0,l.jsx)(l.Fragment,{children:x?(0,l.jsx)(o,{}):(0,l.jsx)(l.Fragment,{children:u?(0,l.jsxs)("div",{children:["Unable to access the requested link: ",(0,l.jsx)("code",{children:b}),". Please verify the link or try again later."]}):(0,l.jsx)(r.Z,{className:`language-${s}`,children:d})})})}},6393:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(4673),i=s(5893);const r=e=>{let{children:n,open:s,title:r}=e;return(0,i.jsx)(t.Z,{open:s,className:"faq",summary:(0,i.jsx)("summary",{children:(0,i.jsx)("strong",{children:r})}),children:(0,i.jsx)("section",{children:n})})}},8609:(e,n,s)=>{s.d(n,{A:()=>l});var t=s(4673);const i=(0,s(4297).Z)("FileClock",[["path",{d:"M16 22h2c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3",key:"9lo3o3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var r=s(5893);const l=e=>{let{records:n,open:s}=e;return(0,r.jsx)(t.Z,{open:s,summary:(0,r.jsxs)("summary",{children:[(0,r.jsx)(i,{})," History"]}),className:"history",children:(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Version"}),(0,r.jsx)("th",{children:"Changes"})]})}),(0,r.jsx)("tbody",{children:n.map(((e,n)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("strong",{children:["v",e.version.replace(/[^0-9.]/g,"")]})}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"changes",children:e.changes.map(((e,n)=>(0,r.jsx)("section",{children:e},`change:${n}`)))})})]},`record:${n}`)))})]})})}},3901:(e,n,s)=>{s.d(n,{X:()=>x});var t=s(3692),i=s(4297);const r=(0,i.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),l=(0,i.Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),o=(0,i.Z)("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]),c=(0,i.Z)("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]),a=(0,i.Z)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),d=(0,i.Z)("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var h=s(5893);const x=e=>{let{level:n,message:s}=e;const i={0:{title:"Deprecated",icon:(0,h.jsx)(r,{})},1:{title:"Experimental",icon:(0,h.jsx)(l,{})},1.1:{title:"Early Development",icon:(0,h.jsx)(o,{})},1.2:{title:"Release Candidate",icon:(0,h.jsx)(c,{})},2:{title:"Stable",icon:(0,h.jsx)(a,{})},3:{title:"Legacy",icon:(0,h.jsx)(d,{})}};return(0,h.jsxs)("section",{className:"stability","data-level":n,children:[(0,h.jsx)(t.Z,{to:"/docs/stability-badges",children:(0,h.jsxs)("header",{children:[(0,h.jsx)("strong",{children:n}),(0,h.jsx)("span",{children:i[n].title}),i[n].icon]})}),s?(0,h.jsx)("p",{children:s}):null]})}},4297:(e,n,s)=>{s.d(n,{Z:()=>r});var t=s(7294),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r=(e,n)=>{const s=(0,t.forwardRef)((({color:s="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:a,...d},h)=>{return(0,t.createElement)("svg",{ref:h,...i,width:r,height:r,stroke:s,strokeWidth:o?24*Number(l)/Number(r):l,className:["lucide",`lucide-${x=e,x.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()}`,c].join(" "),...d},[...n.map((([e,n])=>(0,t.createElement)(e,n))),...Array.isArray(a)?a:[a]]);var x}));return s.displayName=`${e}`,s}}}]); \ No newline at end of file diff --git a/zh-CN/assets/js/runtime~main.77b7f165.js b/zh-CN/assets/js/runtime~main.066c5e4d.js similarity index 85% rename from zh-CN/assets/js/runtime~main.77b7f165.js rename to zh-CN/assets/js/runtime~main.066c5e4d.js index 8c69b9a8b4..c368e99405 100644 --- a/zh-CN/assets/js/runtime~main.77b7f165.js +++ b/zh-CN/assets/js/runtime~main.066c5e4d.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,b,f,d={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={exports:{}};return d[e].call(c.exports,c,c.exports,r),c.exports}r.m=d,e=[],r.O=(a,c,b,f)=>{if(!c){var d=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[c,b,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,b){if(1&b&&(e=this(e)),8&b)return e;if("object"==typeof e&&e){if(4&b&&e.__esModule)return e;if(16&b&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var d={};a=a||[null,c({}),c([]),c(c)];for(var t=2&b&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,r.d(f,d),f},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",81:"8fcb4d7f",297:"3e73bf99",378:"73aa2d44",384:"1cee01a7",452:"a55c4658",556:"22161331",576:"54768732",630:"f54f1246",641:"59e52bc2",1233:"c84c75a7",1420:"54eaaaae",1429:"e19cd79a",1437:"bc31cbdb",1465:"fb880757",1578:"7647f2e2",1782:"9570cbb2",2019:"4b983390",2030:"ad7b17cf",2496:"13833ed5",2839:"2bc14e22",2991:"ed06a4b6",3087:"b5fe66e0",3237:"1df93b7f",3433:"76dfa484",3561:"5814edec",3577:"07d6bcd5",3586:"4e92b6b6",3751:"3720c009",3776:"f76f5ab7",4116:"cdbda324",4121:"55960ee5",4368:"a94703ab",4403:"b07748b5",4723:"67592901",5003:"57495183",5072:"0e27d5d9",5762:"9d6e5507",5807:"f8d74a12",5909:"f43af5ae",6051:"d4b2f69a",6061:"b80d201b",6159:"db044f71",6463:"c024e603",6641:"a89f5446",7615:"b5168752",7918:"17896441",7920:"1a4e3797",8054:"7ccab252",8241:"bd3157e1",8263:"546b1c5f",8406:"cffacdf0",8474:"e32cf8b2",8518:"a7bd4aaa",8534:"8b8ccc10",8625:"11e11f3b",8648:"5483291d",8806:"9e767aa9",8882:"3945bec1",9010:"9df47158",9140:"df04d3c8",9292:"2bfbae62",9380:"ac5f2e4a",9458:"1568425c",9594:"3be0564c",9661:"5e95c892",9924:"df203c0f",9964:"7fbd6b3a"}[e]||e)+"."+{53:"28768658",81:"b5ad74bd",297:"e0626624",378:"7dbec21b",384:"ddcac33c",452:"44cd17e3",556:"df0f36b5",576:"8a0b1c4d",630:"a0ffeec8",641:"0388a862",1233:"bc5502d7",1420:"18d06985",1429:"5eae6886",1437:"d6f5b907",1465:"7c9dd290",1578:"2a5ccf2b",1772:"b0ede415",1782:"b6676e96",2019:"aac15e10",2030:"a53934cd",2496:"68b2a835",2839:"7a8d82bf",2991:"31c7e206",3087:"6c589d41",3237:"8f7e93f0",3433:"c577723b",3561:"d1d718df",3577:"48009c22",3586:"4c945aff",3751:"8c42b22a",3776:"59ab11f8",4116:"4bee815a",4121:"d48c22da",4368:"265346fe",4403:"26915157",4723:"40b1dcf5",5003:"339d0eab",5020:"614bd897",5072:"37f71223",5525:"36b2ab15",5762:"c47bf4a5",5807:"dacaf582",5909:"973dd9b6",6051:"fb6a7fd0",6061:"44ad2ef4",6159:"ad539a4f",6463:"7094d8cf",6641:"6a21ae56",7615:"68c58ab5",7918:"569c1c67",7920:"b37fdfae",8054:"674014b3",8241:"7ee0260c",8263:"ddaa566a",8406:"999e7b25",8443:"30345cef",8474:"d54b09d8",8518:"687d6c08",8534:"9bf8a5cf",8625:"4f42d272",8648:"dbd00af9",8806:"ba9d70bd",8882:"aa6152d4",9010:"c7301fcf",9140:"3f3e40e3",9292:"f52f260b",9380:"75c0af2a",9458:"69831b13",9594:"b2f3e498",9661:"5a7f2413",9924:"56844b1b",9964:"e365c3b2"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),b={},f="website:",r.l=(e,a,c,d)=>{if(b[e])b[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=b[e];if(delete b[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/node-mysql2/zh-CN/",r.gca=function(e){return e={17896441:"7918",22161331:"556",54768732:"576",57495183:"5003",67592901:"4723","935f2afb":"53","8fcb4d7f":"81","3e73bf99":"297","73aa2d44":"378","1cee01a7":"384",a55c4658:"452",f54f1246:"630","59e52bc2":"641",c84c75a7:"1233","54eaaaae":"1420",e19cd79a:"1429",bc31cbdb:"1437",fb880757:"1465","7647f2e2":"1578","9570cbb2":"1782","4b983390":"2019",ad7b17cf:"2030","13833ed5":"2496","2bc14e22":"2839",ed06a4b6:"2991",b5fe66e0:"3087","1df93b7f":"3237","76dfa484":"3433","5814edec":"3561","07d6bcd5":"3577","4e92b6b6":"3586","3720c009":"3751",f76f5ab7:"3776",cdbda324:"4116","55960ee5":"4121",a94703ab:"4368",b07748b5:"4403","0e27d5d9":"5072","9d6e5507":"5762",f8d74a12:"5807",f43af5ae:"5909",d4b2f69a:"6051",b80d201b:"6061",db044f71:"6159",c024e603:"6463",a89f5446:"6641",b5168752:"7615","1a4e3797":"7920","7ccab252":"8054",bd3157e1:"8241","546b1c5f":"8263",cffacdf0:"8406",e32cf8b2:"8474",a7bd4aaa:"8518","8b8ccc10":"8534","11e11f3b":"8625","5483291d":"8648","9e767aa9":"8806","3945bec1":"8882","9df47158":"9010",df04d3c8:"9140","2bfbae62":"9292",ac5f2e4a:"9380","1568425c":"9458","3be0564c":"9594","5e95c892":"9661",df203c0f:"9924","7fbd6b3a":"9964"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var b=r.o(e,a)?e[a]:void 0;if(0!==b)if(b)c.push(b[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((c,f)=>b=e[a]=[c,f]));c.push(b[2]=f);var d=r.p+r.u(a),t=new Error;r.l(d,(c=>{if(r.o(e,a)&&(0!==(b=e[a])&&(e[a]=void 0),b)){var f=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+d+")",t.name="ChunkLoadError",t.type=f,t.request=d,b[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var b,f,d=c[0],t=c[1],o=c[2],n=0;if(d.some((a=>0!==e[a]))){for(b in t)r.o(t,b)&&(r.m[b]=t[b]);if(o)var i=o(r)}for(a&&a(c);n{"use strict";var e,a,c,b,f,d={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={exports:{}};return d[e].call(c.exports,c,c.exports,r),c.exports}r.m=d,e=[],r.O=(a,c,b,f)=>{if(!c){var d=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[c,b,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,b){if(1&b&&(e=this(e)),8&b)return e;if("object"==typeof e&&e){if(4&b&&e.__esModule)return e;if(16&b&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var d={};a=a||[null,c({}),c([]),c(c)];for(var t=2&b&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,r.d(f,d),f},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",81:"8fcb4d7f",297:"3e73bf99",378:"73aa2d44",384:"1cee01a7",452:"a55c4658",556:"22161331",576:"54768732",630:"f54f1246",641:"59e52bc2",1233:"c84c75a7",1420:"54eaaaae",1429:"e19cd79a",1437:"bc31cbdb",1465:"fb880757",1578:"7647f2e2",1782:"9570cbb2",2019:"4b983390",2030:"ad7b17cf",2496:"13833ed5",2839:"2bc14e22",2991:"ed06a4b6",3087:"b5fe66e0",3237:"1df93b7f",3433:"76dfa484",3561:"5814edec",3577:"07d6bcd5",3586:"4e92b6b6",3751:"3720c009",3776:"f76f5ab7",4116:"cdbda324",4121:"55960ee5",4368:"a94703ab",4403:"b07748b5",4723:"67592901",5003:"57495183",5072:"0e27d5d9",5762:"9d6e5507",5807:"f8d74a12",5909:"f43af5ae",6051:"d4b2f69a",6061:"b80d201b",6159:"db044f71",6463:"c024e603",6641:"a89f5446",7615:"b5168752",7918:"17896441",7920:"1a4e3797",8054:"7ccab252",8241:"bd3157e1",8263:"546b1c5f",8406:"cffacdf0",8474:"e32cf8b2",8518:"a7bd4aaa",8534:"8b8ccc10",8625:"11e11f3b",8648:"5483291d",8806:"9e767aa9",8882:"3945bec1",9010:"9df47158",9140:"df04d3c8",9292:"2bfbae62",9380:"ac5f2e4a",9458:"1568425c",9594:"3be0564c",9661:"5e95c892",9924:"df203c0f",9964:"7fbd6b3a"}[e]||e)+"."+{53:"28768658",81:"8743faa4",297:"e0626624",378:"7dbec21b",384:"ddcac33c",452:"44cd17e3",556:"df0f36b5",576:"5f0e7323",630:"a0ffeec8",641:"4de73c5b",1233:"bc5502d7",1420:"40d8eca5",1429:"7bd849d7",1437:"d6f5b907",1465:"7c9dd290",1578:"2a5ccf2b",1772:"b0ede415",1782:"b6676e96",2019:"aac15e10",2030:"a53934cd",2496:"68b2a835",2839:"53969db2",2991:"31c7e206",3087:"6c589d41",3237:"7c544ac9",3433:"c577723b",3561:"d1d718df",3577:"48009c22",3586:"4c945aff",3751:"8c42b22a",3776:"59ab11f8",4116:"498ff172",4121:"d48c22da",4368:"265346fe",4403:"3a6e81fe",4723:"40b1dcf5",5003:"26b902a6",5020:"614bd897",5072:"37f71223",5525:"36b2ab15",5762:"c47bf4a5",5807:"4dfb495f",5909:"973dd9b6",6051:"fb6a7fd0",6061:"500ffac6",6159:"24186b99",6463:"7094d8cf",6641:"6a21ae56",7615:"68c58ab5",7918:"569c1c67",7920:"b37fdfae",8054:"f3964949",8241:"7ee0260c",8263:"ddaa566a",8406:"999e7b25",8443:"30345cef",8474:"d54b09d8",8518:"687d6c08",8534:"e5751b58",8625:"f32e41f2",8648:"dbd00af9",8806:"64c9ba6e",8882:"aa6152d4",9010:"3745d328",9140:"3f3e40e3",9292:"f52f260b",9380:"75c0af2a",9458:"44decca5",9594:"b2f3e498",9661:"5a7f2413",9924:"56844b1b",9964:"e052fa1c"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),b={},f="website:",r.l=(e,a,c,d)=>{if(b[e])b[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=b[e];if(delete b[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(c))),a)return a(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/node-mysql2/zh-CN/",r.gca=function(e){return e={17896441:"7918",22161331:"556",54768732:"576",57495183:"5003",67592901:"4723","935f2afb":"53","8fcb4d7f":"81","3e73bf99":"297","73aa2d44":"378","1cee01a7":"384",a55c4658:"452",f54f1246:"630","59e52bc2":"641",c84c75a7:"1233","54eaaaae":"1420",e19cd79a:"1429",bc31cbdb:"1437",fb880757:"1465","7647f2e2":"1578","9570cbb2":"1782","4b983390":"2019",ad7b17cf:"2030","13833ed5":"2496","2bc14e22":"2839",ed06a4b6:"2991",b5fe66e0:"3087","1df93b7f":"3237","76dfa484":"3433","5814edec":"3561","07d6bcd5":"3577","4e92b6b6":"3586","3720c009":"3751",f76f5ab7:"3776",cdbda324:"4116","55960ee5":"4121",a94703ab:"4368",b07748b5:"4403","0e27d5d9":"5072","9d6e5507":"5762",f8d74a12:"5807",f43af5ae:"5909",d4b2f69a:"6051",b80d201b:"6061",db044f71:"6159",c024e603:"6463",a89f5446:"6641",b5168752:"7615","1a4e3797":"7920","7ccab252":"8054",bd3157e1:"8241","546b1c5f":"8263",cffacdf0:"8406",e32cf8b2:"8474",a7bd4aaa:"8518","8b8ccc10":"8534","11e11f3b":"8625","5483291d":"8648","9e767aa9":"8806","3945bec1":"8882","9df47158":"9010",df04d3c8:"9140","2bfbae62":"9292",ac5f2e4a:"9380","1568425c":"9458","3be0564c":"9594","5e95c892":"9661",df203c0f:"9924","7fbd6b3a":"9964"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var b=r.o(e,a)?e[a]:void 0;if(0!==b)if(b)c.push(b[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((c,f)=>b=e[a]=[c,f]));c.push(b[2]=f);var d=r.p+r.u(a),t=new Error;r.l(d,(c=>{if(r.o(e,a)&&(0!==(b=e[a])&&(e[a]=void 0),b)){var f=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+d+")",t.name="ChunkLoadError",t.type=f,t.request=d,b[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var b,f,d=c[0],t=c[1],o=c[2],n=0;if(d.some((a=>0!==e[a]))){for(b in t)r.o(t,b)&&(r.m[b]=t[b]);if(o)var i=o(r)}for(a&&a(c);n MySQL2 | Quickstart - + diff --git a/zh-CN/docs/acknowledgements.html b/zh-CN/docs/acknowledgements.html index 3a0b7b4ddd..7ab4dd6b07 100644 --- a/zh-CN/docs/acknowledgements.html +++ b/zh-CN/docs/acknowledgements.html @@ -4,7 +4,7 @@ 鸣谢 | Quickstart - + diff --git a/zh-CN/docs/api-and-configurations.html b/zh-CN/docs/api-and-configurations.html index eb8fcc83ae..863a24225b 100644 --- a/zh-CN/docs/api-and-configurations.html +++ b/zh-CN/docs/api-and-configurations.html @@ -4,7 +4,7 @@ API配置项 | Quickstart - + diff --git a/zh-CN/docs/contributing.html b/zh-CN/docs/contributing.html index 2e04446a53..6b39de23f6 100644 --- a/zh-CN/docs/contributing.html +++ b/zh-CN/docs/contributing.html @@ -4,7 +4,7 @@ 贡献 - + diff --git a/zh-CN/docs/contributing/website.html b/zh-CN/docs/contributing/website.html index a1ff429e3b..9e1a4de7a2 100644 --- a/zh-CN/docs/contributing/website.html +++ b/zh-CN/docs/contributing/website.html @@ -4,7 +4,7 @@ Documentation Site | Quickstart - + diff --git a/zh-CN/docs/documentation.html b/zh-CN/docs/documentation.html index aad3dc8c9a..6ed13cf02d 100644 --- a/zh-CN/docs/documentation.html +++ b/zh-CN/docs/documentation.html @@ -4,7 +4,7 @@ Documentation - + diff --git a/zh-CN/docs/documentation/authentication-switch.html b/zh-CN/docs/documentation/authentication-switch.html index 4fca3e5601..a30a727ae8 100644 --- a/zh-CN/docs/documentation/authentication-switch.html +++ b/zh-CN/docs/documentation/authentication-switch.html @@ -4,7 +4,7 @@ Authentication Switch Request | Quickstart - + diff --git a/zh-CN/docs/documentation/extras.html b/zh-CN/docs/documentation/extras.html index 92f394748a..343edea525 100644 --- a/zh-CN/docs/documentation/extras.html +++ b/zh-CN/docs/documentation/extras.html @@ -4,7 +4,7 @@ Extra Features | Quickstart - + diff --git a/zh-CN/docs/documentation/mysql-server.html b/zh-CN/docs/documentation/mysql-server.html index 1d845ce085..d3fce1e7d8 100644 --- a/zh-CN/docs/documentation/mysql-server.html +++ b/zh-CN/docs/documentation/mysql-server.html @@ -4,7 +4,7 @@ MySQL Server API | Quickstart - + diff --git a/zh-CN/docs/documentation/prepared-statements.html b/zh-CN/docs/documentation/prepared-statements.html index 029ac10611..3d8259c595 100644 --- a/zh-CN/docs/documentation/prepared-statements.html +++ b/zh-CN/docs/documentation/prepared-statements.html @@ -4,7 +4,7 @@ Prepared Statements | Quickstart - + diff --git a/zh-CN/docs/documentation/promise-wrapper.html b/zh-CN/docs/documentation/promise-wrapper.html index 7c6b9545e8..a7a9985831 100644 --- a/zh-CN/docs/documentation/promise-wrapper.html +++ b/zh-CN/docs/documentation/promise-wrapper.html @@ -4,7 +4,7 @@ Promise Wrappers | Quickstart - + diff --git a/zh-CN/docs/documentation/typescript-examples.html b/zh-CN/docs/documentation/typescript-examples.html index d36ef2d99a..d9c2f91b82 100644 --- a/zh-CN/docs/documentation/typescript-examples.html +++ b/zh-CN/docs/documentation/typescript-examples.html @@ -4,7 +4,7 @@ Using MySQL2 with TypeScript | Quickstart - + diff --git a/zh-CN/docs/examples.html b/zh-CN/docs/examples.html index e8779f6db1..a98156359f 100644 --- a/zh-CN/docs/examples.html +++ b/zh-CN/docs/examples.html @@ -4,7 +4,7 @@ Examples - + diff --git a/zh-CN/docs/examples/binlog-watcher.html b/zh-CN/docs/examples/binlog-watcher.html index 1bf635bb35..6ac9e5f48a 100644 --- a/zh-CN/docs/examples/binlog-watcher.html +++ b/zh-CN/docs/examples/binlog-watcher.html @@ -4,7 +4,7 @@ Binlog Watcher | Quickstart - + diff --git a/zh-CN/docs/examples/connections/create-connection.html b/zh-CN/docs/examples/connections/create-connection.html index 0a089e3f33..e5df9a748d 100644 --- a/zh-CN/docs/examples/connections/create-connection.html +++ b/zh-CN/docs/examples/connections/create-connection.html @@ -4,7 +4,7 @@ createConnection | Quickstart - + diff --git a/zh-CN/docs/examples/connections/create-pool.html b/zh-CN/docs/examples/connections/create-pool.html index d579e81bf8..7dda0aa137 100644 --- a/zh-CN/docs/examples/connections/create-pool.html +++ b/zh-CN/docs/examples/connections/create-pool.html @@ -4,7 +4,7 @@ createPool | Quickstart - + @@ -87,10 +87,7 @@

crea

Glossary

PoolOptions

-
-

PoolOptions extends all options from ConnectionOptions:

-
ConnectionOptions Specification
-
+

PoolOptions extends all options from ConnectionOptions:

ConnectionOptions Specification
PoolOptions Specification
\ No newline at end of file diff --git a/zh-CN/docs/examples/connections/createPoolCluster.html b/zh-CN/docs/examples/connections/createPoolCluster.html index 8604f73b31..78a72a098e 100644 --- a/zh-CN/docs/examples/connections/createPoolCluster.html +++ b/zh-CN/docs/examples/connections/createPoolCluster.html @@ -4,7 +4,7 @@ createPoolCluster | Quickstart - + @@ -82,10 +82,7 @@

add(g

Glossary

PoolOptions

-
-

PoolOptions extends all options from ConnectionOptions:

-
ConnectionOptions Specification
-
+

PoolOptions extends all options from ConnectionOptions:

ConnectionOptions Specification
PoolOptions Specification
\ No newline at end of file diff --git a/zh-CN/docs/examples/promise-wrapper/co-await.html b/zh-CN/docs/examples/promise-wrapper/co-await.html index ff71480e4d..4bdc3180d2 100644 --- a/zh-CN/docs/examples/promise-wrapper/co-await.html +++ b/zh-CN/docs/examples/promise-wrapper/co-await.html @@ -4,7 +4,7 @@ await — co | Quickstart - + diff --git a/zh-CN/docs/examples/queries/prepared-statements.html b/zh-CN/docs/examples/queries/prepared-statements.html index 3a0e19b456..42249a222b 100644 --- a/zh-CN/docs/examples/queries/prepared-statements.html +++ b/zh-CN/docs/examples/queries/prepared-statements.html @@ -4,7 +4,7 @@ Prepared Statements | Quickstart - + diff --git a/zh-CN/docs/examples/queries/prepared-statements/delete.html b/zh-CN/docs/examples/queries/prepared-statements/delete.html index 0fe979578e..15a51cad11 100644 --- a/zh-CN/docs/examples/queries/prepared-statements/delete.html +++ b/zh-CN/docs/examples/queries/prepared-statements/delete.html @@ -4,7 +4,7 @@ DELETE | Quickstart - + diff --git a/zh-CN/docs/examples/queries/prepared-statements/insert.html b/zh-CN/docs/examples/queries/prepared-statements/insert.html index 06f8cee436..c681d24240 100644 --- a/zh-CN/docs/examples/queries/prepared-statements/insert.html +++ b/zh-CN/docs/examples/queries/prepared-statements/insert.html @@ -4,7 +4,7 @@ INSERT | Quickstart - + diff --git a/zh-CN/docs/examples/queries/prepared-statements/select.html b/zh-CN/docs/examples/queries/prepared-statements/select.html index 366ffcf927..0e2305f996 100644 --- a/zh-CN/docs/examples/queries/prepared-statements/select.html +++ b/zh-CN/docs/examples/queries/prepared-statements/select.html @@ -4,7 +4,7 @@ SELECT | Quickstart - + diff --git a/zh-CN/docs/examples/queries/prepared-statements/update.html b/zh-CN/docs/examples/queries/prepared-statements/update.html index c9dcd84ae1..f94a366ff5 100644 --- a/zh-CN/docs/examples/queries/prepared-statements/update.html +++ b/zh-CN/docs/examples/queries/prepared-statements/update.html @@ -4,7 +4,7 @@ UPDATE | Quickstart - + diff --git a/zh-CN/docs/examples/queries/simple-queries.html b/zh-CN/docs/examples/queries/simple-queries.html index 2fc17104d0..2c67df28cd 100644 --- a/zh-CN/docs/examples/queries/simple-queries.html +++ b/zh-CN/docs/examples/queries/simple-queries.html @@ -4,7 +4,7 @@ Simple Queries | Quickstart - + diff --git a/zh-CN/docs/examples/queries/simple-queries/delete.html b/zh-CN/docs/examples/queries/simple-queries/delete.html index 477fb83db6..4e062147d1 100644 --- a/zh-CN/docs/examples/queries/simple-queries/delete.html +++ b/zh-CN/docs/examples/queries/simple-queries/delete.html @@ -4,7 +4,7 @@ DELETE | Quickstart - + diff --git a/zh-CN/docs/examples/queries/simple-queries/insert.html b/zh-CN/docs/examples/queries/simple-queries/insert.html index 29f758303c..8464474d30 100644 --- a/zh-CN/docs/examples/queries/simple-queries/insert.html +++ b/zh-CN/docs/examples/queries/simple-queries/insert.html @@ -4,7 +4,7 @@ INSERT | Quickstart - + diff --git a/zh-CN/docs/examples/queries/simple-queries/select.html b/zh-CN/docs/examples/queries/simple-queries/select.html index 2f7af5a4b0..772f3be9be 100644 --- a/zh-CN/docs/examples/queries/simple-queries/select.html +++ b/zh-CN/docs/examples/queries/simple-queries/select.html @@ -4,7 +4,7 @@ SELECT | Quickstart - + diff --git a/zh-CN/docs/examples/queries/simple-queries/update.html b/zh-CN/docs/examples/queries/simple-queries/update.html index e800ab3ae6..50c11fef68 100644 --- a/zh-CN/docs/examples/queries/simple-queries/update.html +++ b/zh-CN/docs/examples/queries/simple-queries/update.html @@ -4,7 +4,7 @@ UPDATE | Quickstart - + diff --git a/zh-CN/docs/examples/tests/mysql-proxy.html b/zh-CN/docs/examples/tests/mysql-proxy.html index 288135f815..442d7eb7ce 100644 --- a/zh-CN/docs/examples/tests/mysql-proxy.html +++ b/zh-CN/docs/examples/tests/mysql-proxy.html @@ -4,7 +4,7 @@ MySQL Proxy | Quickstart - + diff --git a/zh-CN/docs/examples/tests/pool.html b/zh-CN/docs/examples/tests/pool.html index b74ea18a73..96b08e161c 100644 --- a/zh-CN/docs/examples/tests/pool.html +++ b/zh-CN/docs/examples/tests/pool.html @@ -4,7 +4,7 @@ Pool | Quickstart - + diff --git a/zh-CN/docs/examples/tests/server.html b/zh-CN/docs/examples/tests/server.html index aeb55ed6a9..a2eb10c90e 100644 --- a/zh-CN/docs/examples/tests/server.html +++ b/zh-CN/docs/examples/tests/server.html @@ -4,7 +4,7 @@ Server | Quickstart - + diff --git a/zh-CN/docs/examples/typescript/basic-custom-class.html b/zh-CN/docs/examples/typescript/basic-custom-class.html index b47c649f5e..ddb96c6291 100644 --- a/zh-CN/docs/examples/typescript/basic-custom-class.html +++ b/zh-CN/docs/examples/typescript/basic-custom-class.html @@ -4,7 +4,7 @@ Basic Custom Class | Quickstart - + diff --git a/zh-CN/docs/examples/typescript/procedure-call/index.html b/zh-CN/docs/examples/typescript/procedure-call/index.html index 81de846989..e83507ee40 100644 --- a/zh-CN/docs/examples/typescript/procedure-call/index.html +++ b/zh-CN/docs/examples/typescript/procedure-call/index.html @@ -4,7 +4,7 @@ Procedure Call Packet | Quickstart - + diff --git a/zh-CN/docs/examples/typescript/procedure-call/row-as-array.html b/zh-CN/docs/examples/typescript/procedure-call/row-as-array.html index 5dcfbd4879..25a2844737 100644 --- a/zh-CN/docs/examples/typescript/procedure-call/row-as-array.html +++ b/zh-CN/docs/examples/typescript/procedure-call/row-as-array.html @@ -4,7 +4,7 @@ Procedure Call Packet (Row as Array) | Quickstart - + diff --git a/zh-CN/docs/examples/typescript/row-data/index.html b/zh-CN/docs/examples/typescript/row-data/index.html index 836c874aa8..46ef8c3cc1 100644 --- a/zh-CN/docs/examples/typescript/row-data/index.html +++ b/zh-CN/docs/examples/typescript/row-data/index.html @@ -4,7 +4,7 @@ Row Data Packet | Quickstart - + diff --git a/zh-CN/docs/examples/typescript/row-data/multi-statements.html b/zh-CN/docs/examples/typescript/row-data/multi-statements.html index c9bd16f1c2..885cedf736 100644 --- a/zh-CN/docs/examples/typescript/row-data/multi-statements.html +++ b/zh-CN/docs/examples/typescript/row-data/multi-statements.html @@ -4,7 +4,7 @@ Row Data Packet (Multi Statements) | Quickstart - + diff --git a/zh-CN/docs/examples/typescript/row-data/row-as-array-multi-statements.html b/zh-CN/docs/examples/typescript/row-data/row-as-array-multi-statements.html index 9762edce28..ca8237dfbd 100644 --- a/zh-CN/docs/examples/typescript/row-data/row-as-array-multi-statements.html +++ b/zh-CN/docs/examples/typescript/row-data/row-as-array-multi-statements.html @@ -4,7 +4,7 @@ Row Data Packet (Multi Statements and Row as Array) | Quickstart - + diff --git a/zh-CN/docs/examples/typescript/row-data/row-as-array.html b/zh-CN/docs/examples/typescript/row-data/row-as-array.html index 95cd775370..f209aca793 100644 --- a/zh-CN/docs/examples/typescript/row-data/row-as-array.html +++ b/zh-CN/docs/examples/typescript/row-data/row-as-array.html @@ -4,7 +4,7 @@ Row Data Packet (Row as Array) | Quickstart - + diff --git a/zh-CN/docs/faq.html b/zh-CN/docs/faq.html index c62ef00e3d..3d76761a07 100644 --- a/zh-CN/docs/faq.html +++ b/zh-CN/docs/faq.html @@ -4,7 +4,7 @@ FAQ - + diff --git a/zh-CN/docs/faq/how-to-handle-errors.html b/zh-CN/docs/faq/how-to-handle-errors.html index 4a42fea493..2794ff6f43 100644 --- a/zh-CN/docs/faq/how-to-handle-errors.html +++ b/zh-CN/docs/faq/how-to-handle-errors.html @@ -4,7 +4,7 @@ How to handle errors? | Quickstart - + diff --git a/zh-CN/docs/history-and-why-mysq2.html b/zh-CN/docs/history-and-why-mysq2.html index 54068a3feb..4d504aada0 100644 --- a/zh-CN/docs/history-and-why-mysq2.html +++ b/zh-CN/docs/history-and-why-mysq2.html @@ -4,7 +4,7 @@ MySQL2的历史以及选择原因 | Quickstart - + diff --git a/zh-CN/docs/stability-badges.html b/zh-CN/docs/stability-badges.html index 1a1563cee7..eab0cc013e 100644 --- a/zh-CN/docs/stability-badges.html +++ b/zh-CN/docs/stability-badges.html @@ -4,7 +4,7 @@ Stability Badges | Quickstart - + diff --git a/zh-CN/docs/tags.html b/zh-CN/docs/tags.html index fa6cffa814..6498fd6feb 100644 --- a/zh-CN/docs/tags.html +++ b/zh-CN/docs/tags.html @@ -4,7 +4,7 @@ 标签 | Quickstart - + diff --git a/zh-CN/docs/tags/create-connection.html b/zh-CN/docs/tags/create-connection.html index 8c8d5a1d97..02fb362ae3 100644 --- a/zh-CN/docs/tags/create-connection.html +++ b/zh-CN/docs/tags/create-connection.html @@ -4,7 +4,7 @@ 1 篇文档带有标签「createConnection」 | Quickstart - + diff --git a/zh-CN/docs/tags/create-pool-cluster.html b/zh-CN/docs/tags/create-pool-cluster.html index 0f828f7d72..e1fd9d3554 100644 --- a/zh-CN/docs/tags/create-pool-cluster.html +++ b/zh-CN/docs/tags/create-pool-cluster.html @@ -4,7 +4,7 @@ 1 篇文档带有标签「createPoolCluster」 | Quickstart - + diff --git a/zh-CN/docs/tags/create-pool.html b/zh-CN/docs/tags/create-pool.html index bd65086309..cf540d69f5 100644 --- a/zh-CN/docs/tags/create-pool.html +++ b/zh-CN/docs/tags/create-pool.html @@ -4,7 +4,7 @@ 1 篇文档带有标签「createPool」 | Quickstart - + diff --git a/zh-CN/docs/tags/execute.html b/zh-CN/docs/tags/execute.html index 8905cec4f9..b3fe944704 100644 --- a/zh-CN/docs/tags/execute.html +++ b/zh-CN/docs/tags/execute.html @@ -4,7 +4,7 @@ 5 篇文档带有标签「execute」 | Quickstart - + diff --git a/zh-CN/docs/tags/parameters.html b/zh-CN/docs/tags/parameters.html index 1cb062d3bc..99989b70ea 100644 --- a/zh-CN/docs/tags/parameters.html +++ b/zh-CN/docs/tags/parameters.html @@ -4,7 +4,7 @@ 4 篇文档带有标签「Parameters」 | Quickstart - + diff --git a/zh-CN/docs/tags/placeholders.html b/zh-CN/docs/tags/placeholders.html index eb3d388644..07c1af8f7b 100644 --- a/zh-CN/docs/tags/placeholders.html +++ b/zh-CN/docs/tags/placeholders.html @@ -4,7 +4,7 @@ 4 篇文档带有标签「Placeholders」 | Quickstart - + diff --git a/zh-CN/docs/tags/prepared-statements.html b/zh-CN/docs/tags/prepared-statements.html index bf5c0c9f66..b56f804bef 100644 --- a/zh-CN/docs/tags/prepared-statements.html +++ b/zh-CN/docs/tags/prepared-statements.html @@ -4,7 +4,7 @@ 5 篇文档带有标签「Prepared Statements」 | Quickstart - + diff --git a/zh-CN/docs/tags/query.html b/zh-CN/docs/tags/query.html index 661a427b6f..5e38d46a60 100644 --- a/zh-CN/docs/tags/query.html +++ b/zh-CN/docs/tags/query.html @@ -4,7 +4,7 @@ 4 篇文档带有标签「query」 | Quickstart - + diff --git a/zh-CN/docs/tags/rds.html b/zh-CN/docs/tags/rds.html index 89cfa7590f..d9671e3c17 100644 --- a/zh-CN/docs/tags/rds.html +++ b/zh-CN/docs/tags/rds.html @@ -4,7 +4,7 @@ 3 篇文档带有标签「RDS」 | Quickstart - + diff --git a/zh-CN/docs/tags/sha-1.html b/zh-CN/docs/tags/sha-1.html index a60947abef..957c443c9c 100644 --- a/zh-CN/docs/tags/sha-1.html +++ b/zh-CN/docs/tags/sha-1.html @@ -4,7 +4,7 @@ 3 篇文档带有标签「SHA1」 | Quickstart - + diff --git a/zh-CN/docs/tags/socks.html b/zh-CN/docs/tags/socks.html index 582304b140..0c672f634a 100644 --- a/zh-CN/docs/tags/socks.html +++ b/zh-CN/docs/tags/socks.html @@ -4,7 +4,7 @@ 3 篇文档带有标签「Socks」 | Quickstart - + diff --git a/zh-CN/docs/tags/ssl.html b/zh-CN/docs/tags/ssl.html index d30533aeb8..4ee02841b9 100644 --- a/zh-CN/docs/tags/ssl.html +++ b/zh-CN/docs/tags/ssl.html @@ -4,7 +4,7 @@ 3 篇文档带有标签「SSL」 | Quickstart - + diff --git a/zh-CN/docs/tags/uri.html b/zh-CN/docs/tags/uri.html index a47f38b938..e02f1b489f 100644 --- a/zh-CN/docs/tags/uri.html +++ b/zh-CN/docs/tags/uri.html @@ -4,7 +4,7 @@ 3 篇文档带有标签「URI」 | Quickstart - + diff --git a/zh-CN/index.html b/zh-CN/index.html index 1112af4ccd..ca3bc4655e 100644 --- a/zh-CN/index.html +++ b/zh-CN/index.html @@ -4,7 +4,7 @@ Quickstart - + diff --git a/zh-CN/search-index.json b/zh-CN/search-index.json index d082f14034..216b93e83a 100644 --- a/zh-CN/search-index.json +++ b/zh-CN/search-index.json @@ -1 +1 @@ -[{"documents":[{"i":311,"t":"鸣谢","u":"/node-mysql2/zh-CN/docs/acknowledgements","b":[]},{"i":313,"t":"API配置项","u":"/node-mysql2/zh-CN/docs/api-and-configurations","b":[]},{"i":315,"t":"贡献","u":"/node-mysql2/zh-CN/docs/contributing","b":["贡献"]},{"i":317,"t":"Website Contributing Guidelines","u":"/node-mysql2/zh-CN/docs/contributing/website","b":["贡献"]},{"i":335,"t":"Documentation","u":"/node-mysql2/zh-CN/docs/documentation","b":["Docs","Documentation"]},{"i":345,"t":"MySQL Server API","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","b":["Docs","Documentation"]},{"i":354,"t":"Authentication Switch Request","u":"/node-mysql2/zh-CN/docs/documentation/authentication-switch","b":["Docs","Documentation"]},{"i":358,"t":"Prepared Statements","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","b":["Docs","Documentation"]},{"i":371,"t":"Promise Wrappers","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","b":["Docs","Documentation"]},{"i":379,"t":"Examples","u":"/node-mysql2/zh-CN/docs/examples","b":["Examples"]},{"i":383,"t":"MySQL2","u":"/node-mysql2/zh-CN/docs","b":[]},{"i":397,"t":"Binlog Watcher","u":"/node-mysql2/zh-CN/docs/examples/binlog-watcher","b":["Examples"]},{"i":399,"t":"Extra Features","u":"/node-mysql2/zh-CN/docs/documentation/extras","b":["Docs","Documentation"]},{"i":408,"t":"Using MySQL2 with TypeScript","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","b":["Docs","Documentation"]},{"i":434,"t":"await — co","u":"/node-mysql2/zh-CN/docs/examples/promise-wrapper/co-await","b":["Examples","Promise Wrapper"]},{"i":436,"t":"createConnection","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","b":["Examples","Connections"]},{"i":455,"t":"Prepared Statements","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements","b":["Examples","Queries","Prepared Statements"]},{"i":457,"t":"createPool","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","b":["Examples","Connections"]},{"i":476,"t":"INSERT","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","b":["Examples","Queries","Prepared Statements"]},{"i":488,"t":"Simple Queries","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries","b":["Examples","Queries","Simple Queries"]},{"i":490,"t":"UPDATE","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","b":["Examples","Queries","Prepared Statements"]},{"i":502,"t":"DELETE","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","b":["Examples","Queries","Prepared Statements"]},{"i":514,"t":"SELECT","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","b":["Examples","Queries","Prepared Statements"]},{"i":524,"t":"createPoolCluster","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","b":["Examples","Connections"]},{"i":543,"t":"DELETE","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","b":["Examples","Queries","Simple Queries"]},{"i":554,"t":"INSERT","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","b":["Examples","Queries","Simple Queries"]},{"i":565,"t":"MySQL Proxy","u":"/node-mysql2/zh-CN/docs/examples/tests/mysql-proxy","b":["Examples","Tests"]},{"i":567,"t":"SELECT","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","b":["Examples","Queries","Simple Queries"]},{"i":578,"t":"Pool","u":"/node-mysql2/zh-CN/docs/examples/tests/pool","b":["Examples","Tests"]},{"i":580,"t":"Server","u":"/node-mysql2/zh-CN/docs/examples/tests/server","b":["Examples","Tests"]},{"i":582,"t":"Procedure Call Packet","u":"/node-mysql2/zh-CN/docs/examples/typescript/procedure-call/index","b":["Examples","TypeScript","Procedure Call"]},{"i":584,"t":"UPDATE","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","b":["Examples","Queries","Simple Queries"]},{"i":595,"t":"Row Data Packet (Multi Statements)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/multi-statements","b":["Examples","TypeScript","Row Data"]},{"i":597,"t":"Row Data Packet","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/index","b":["Examples","TypeScript","Row Data"]},{"i":599,"t":"Row Data Packet (Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/row-as-array","b":["Examples","TypeScript","Row Data"]},{"i":601,"t":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/row-as-array-multi-statements","b":["Examples","TypeScript","Row Data"]},{"i":603,"t":"Frequently Asked Questions","u":"/node-mysql2/zh-CN/docs/faq","b":["FAQ"]},{"i":605,"t":"MySQL2的历史以及选择原因","u":"/node-mysql2/zh-CN/docs/history-and-why-mysq2","b":[]},{"i":607,"t":"Stability Badges","u":"/node-mysql2/zh-CN/docs/stability-badges","b":[]},{"i":609,"t":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/procedure-call/row-as-array","b":["Examples","TypeScript","Procedure Call"]},{"i":611,"t":"Basic Custom Class","u":"/node-mysql2/zh-CN/docs/examples/typescript/basic-custom-class","b":["Examples","TypeScript"]},{"i":613,"t":"How to handle errors?","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","b":["FAQ"]}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/311",[0,3.182]],["t/313",[1,3.608]],["t/315",[0,3.182]],["t/317",[2,2.836,3,2.836,4,2.836]],["t/335",[5,4.256]],["t/345",[1,2.404,6,2.404,7,2.404]],["t/354",[8,2.836,9,2.836,10,2.836]],["t/358",[11,2.886,12,2.289]],["t/371",[13,3.404,14,3.404]],["t/379",[15,4.256]],["t/383",[16,3.182]],["t/397",[17,3.404,18,3.404]],["t/399",[19,3.404,20,3.404]],["t/408",[16,2.12,21,2.836,22,2.836]],["t/434",[0,2.12,23,2.836,24,2.836]],["t/436",[25,4.256]],["t/455",[11,2.886,12,2.289]],["t/457",[26,4.256]],["t/476",[27,3.608]],["t/488",[28,3.404,29,3.404]],["t/490",[30,3.608]],["t/502",[31,3.608]],["t/514",[32,3.608]],["t/524",[33,4.256]],["t/543",[31,3.608]],["t/554",[27,3.608]],["t/565",[6,2.886,34,3.404]],["t/567",[32,3.608]],["t/578",[35,4.256]],["t/580",[7,3.608]],["t/582",[36,2.404,37,2.404,38,1.597]],["t/584",[30,3.608]],["t/595",[12,1.43,38,1.197,39,1.303,40,1.43,41,1.802]],["t/597",[38,1.597,39,1.738,40,1.907]],["t/599",[38,1.197,39,2.023,40,1.43,42,1.589]],["t/601",[12,1.144,38,0.957,39,1.694,40,1.144,41,1.442,42,1.271]],["t/603",[43,2.836,44,2.836,45,2.836]],["t/605",[16,3.182]],["t/607",[46,3.404,47,3.404]],["t/609",[36,1.802,37,1.802,38,1.197,39,1.303,42,1.589]],["t/611",[48,2.836,49,2.836,50,2.836]],["t/613",[51,3.404,52,3.404]]],"invertedIndex":[["",{"_index":0,"t":{"311":{"position":[[0,2]]},"315":{"position":[[0,2]]},"434":{"position":[[6,1]]}}}],["api",{"_index":1,"t":{"313":{"position":[[0,6]]},"345":{"position":[[13,3]]}}}],["array",{"_index":42,"t":{"599":{"position":[[24,6]]},"601":{"position":[[45,6]]},"609":{"position":[[30,6]]}}}],["ask",{"_index":44,"t":{"603":{"position":[[11,5]]}}}],["authent",{"_index":8,"t":{"354":{"position":[[0,14]]}}}],["await",{"_index":23,"t":{"434":{"position":[[0,5]]}}}],["badg",{"_index":47,"t":{"607":{"position":[[10,6]]}}}],["basic",{"_index":48,"t":{"611":{"position":[[0,5]]}}}],["binlog",{"_index":17,"t":{"397":{"position":[[0,6]]}}}],["call",{"_index":37,"t":{"582":{"position":[[10,4]]},"609":{"position":[[10,4]]}}}],["class",{"_index":50,"t":{"611":{"position":[[13,5]]}}}],["co",{"_index":24,"t":{"434":{"position":[[8,2]]}}}],["contribut",{"_index":3,"t":{"317":{"position":[[8,12]]}}}],["createconnect",{"_index":25,"t":{"436":{"position":[[0,16]]}}}],["createpool",{"_index":26,"t":{"457":{"position":[[0,10]]}}}],["createpoolclust",{"_index":33,"t":{"524":{"position":[[0,17]]}}}],["custom",{"_index":49,"t":{"611":{"position":[[6,6]]}}}],["data",{"_index":40,"t":{"595":{"position":[[4,4]]},"597":{"position":[[4,4]]},"599":{"position":[[4,4]]},"601":{"position":[[4,4]]}}}],["delet",{"_index":31,"t":{"502":{"position":[[0,6]]},"543":{"position":[[0,6]]}}}],["document",{"_index":5,"t":{"335":{"position":[[0,13]]}}}],["error",{"_index":52,"t":{"613":{"position":[[14,7]]}}}],["exampl",{"_index":15,"t":{"379":{"position":[[0,8]]}}}],["extra",{"_index":19,"t":{"399":{"position":[[0,5]]}}}],["featur",{"_index":20,"t":{"399":{"position":[[6,8]]}}}],["frequent",{"_index":43,"t":{"603":{"position":[[0,10]]}}}],["guidelin",{"_index":4,"t":{"317":{"position":[[21,10]]}}}],["handl",{"_index":51,"t":{"613":{"position":[[7,6]]}}}],["insert",{"_index":27,"t":{"476":{"position":[[0,6]]},"554":{"position":[[0,6]]}}}],["multi",{"_index":41,"t":{"595":{"position":[[16,6]]},"601":{"position":[[16,6]]}}}],["mysql",{"_index":6,"t":{"345":{"position":[[0,5]]},"565":{"position":[[0,5]]}}}],["mysql2",{"_index":16,"t":{"383":{"position":[[0,6]]},"408":{"position":[[6,6]]},"605":{"position":[[0,15]]}}}],["packet",{"_index":38,"t":{"582":{"position":[[15,6]]},"595":{"position":[[9,6]]},"597":{"position":[[9,6]]},"599":{"position":[[9,6]]},"601":{"position":[[9,6]]},"609":{"position":[[15,6]]}}}],["pool",{"_index":35,"t":{"578":{"position":[[0,4]]}}}],["prepar",{"_index":11,"t":{"358":{"position":[[0,8]]},"455":{"position":[[0,8]]}}}],["procedur",{"_index":36,"t":{"582":{"position":[[0,9]]},"609":{"position":[[0,9]]}}}],["promis",{"_index":13,"t":{"371":{"position":[[0,7]]}}}],["proxi",{"_index":34,"t":{"565":{"position":[[6,5]]}}}],["queri",{"_index":29,"t":{"488":{"position":[[7,7]]}}}],["question",{"_index":45,"t":{"603":{"position":[[17,9]]}}}],["request",{"_index":10,"t":{"354":{"position":[[22,7]]}}}],["row",{"_index":39,"t":{"595":{"position":[[0,3]]},"597":{"position":[[0,3]]},"599":{"position":[[0,3],[16,4]]},"601":{"position":[[0,3],[38,3]]},"609":{"position":[[22,4]]}}}],["select",{"_index":32,"t":{"514":{"position":[[0,6]]},"567":{"position":[[0,6]]}}}],["server",{"_index":7,"t":{"345":{"position":[[6,6]]},"580":{"position":[[0,6]]}}}],["simpl",{"_index":28,"t":{"488":{"position":[[0,6]]}}}],["stabil",{"_index":46,"t":{"607":{"position":[[0,9]]}}}],["statement",{"_index":12,"t":{"358":{"position":[[9,10]]},"455":{"position":[[9,10]]},"595":{"position":[[23,11]]},"601":{"position":[[23,10]]}}}],["switch",{"_index":9,"t":{"354":{"position":[[15,6]]}}}],["typescript",{"_index":22,"t":{"408":{"position":[[18,10]]}}}],["updat",{"_index":30,"t":{"490":{"position":[[0,6]]},"584":{"position":[[0,6]]}}}],["us",{"_index":21,"t":{"408":{"position":[[0,5]]}}}],["watcher",{"_index":18,"t":{"397":{"position":[[7,7]]}}}],["websit",{"_index":2,"t":{"317":{"position":[[0,7]]}}}],["wrapper",{"_index":14,"t":{"371":{"position":[[8,8]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":319,"t":"Environment","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#environment","p":317},{"i":321,"t":"Development","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#development","p":317},{"i":323,"t":"Extras Components","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#extras-components","p":317},{"i":325,"t":"History","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#history","p":317},{"i":327,"t":"Stability","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#stability","p":317},{"i":329,"t":"FAQ","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#faq","p":317},{"i":331,"t":"ExternalCodeEmbed","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#externalcodeembed","p":317},{"i":333,"t":"Running Tests","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#running-tests","p":317},{"i":337,"t":"Examples","u":"/node-mysql2/zh-CN/docs/documentation","h":"#examples","p":335},{"i":339,"t":"Known incompatibilities with Node MySQL","u":"/node-mysql2/zh-CN/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":335},{"i":341,"t":"Other Resources","u":"/node-mysql2/zh-CN/docs/documentation","h":"#other-resources","p":335},{"i":343,"t":"Benchmarks","u":"/node-mysql2/zh-CN/docs/documentation","h":"#benchmarks","p":335},{"i":346,"t":"Server","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#server","p":345},{"i":348,"t":"Events","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#events","p":345},{"i":350,"t":"Connection","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#connection","p":345},{"i":352,"t":"Events","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#events-1","p":345},{"i":356,"t":"Multi-factor authentication","u":"/node-mysql2/zh-CN/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":354},{"i":359,"t":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":358},{"i":361,"t":"Manual prepare / execute","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":358},{"i":363,"t":"Configuration","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#configuration","p":358},{"i":365,"t":"Serialization of bind parameters","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":358},{"i":367,"t":"Prepared Statements Helper","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":358},{"i":369,"t":"Examples","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#examples","p":358},{"i":373,"t":"Basic Promise","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#basic-promise","p":371},{"i":375,"t":"ES7 Async Await","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#es7-async-await","p":371},{"i":377,"t":"With CO","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#with-co","p":371},{"i":381,"t":"Examples using MySQL server API","u":"/node-mysql2/zh-CN/docs/examples","h":"#examples-using-mysql-server-api","p":379},{"i":385,"t":"安装","u":"/node-mysql2/zh-CN/docs","h":"#安装","p":383},{"i":387,"t":"查询数据","u":"/node-mysql2/zh-CN/docs","h":"#查询数据","p":383},{"i":389,"t":"SQL预处理的使用","u":"/node-mysql2/zh-CN/docs","h":"#sql预处理的使用","p":383},{"i":391,"t":"连接池的使用","u":"/node-mysql2/zh-CN/docs","h":"#using-connection-pools","p":383},{"i":393,"t":"Promise封装","u":"/node-mysql2/zh-CN/docs","h":"#promise封装","p":383},{"i":395,"t":"结果返回","u":"/node-mysql2/zh-CN/docs","h":"#结果返回","p":383},{"i":400,"t":"Named placeholders","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#named-placeholders","p":399},{"i":402,"t":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":399},{"i":404,"t":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":399},{"i":406,"t":"Connecting using custom stream:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#connecting-using-custom-stream","p":399},{"i":409,"t":"Installation","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#installation","p":408},{"i":411,"t":"Usage","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#usage","p":408},{"i":413,"t":"Connection","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#connection","p":408},{"i":415,"t":"Pool Connection","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#pool-connection","p":408},{"i":417,"t":"Query and Execute","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#query-and-execute","p":408},{"i":419,"t":"Type Specification","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#type-specification","p":408},{"i":420,"t":"RowDataPacket[]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#rowdatapacket","p":408},{"i":422,"t":"RowDataPacket[][]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":408},{"i":424,"t":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#resultsetheader","p":408},{"i":426,"t":"ResultSetHeader[]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":408},{"i":428,"t":"ProcedureCallPacket","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":408},{"i":430,"t":"OkPacket","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#okpacket","p":408},{"i":432,"t":"Examples","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#examples","p":408},{"i":438,"t":"createConnection(connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":436},{"i":440,"t":"createConnection(config)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":436},{"i":442,"t":"createConnection(config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":436},{"i":444,"t":"createConnection(config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":436},{"i":446,"t":"createConnection(config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":436},{"i":448,"t":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#related-links","p":436},{"i":450,"t":"createConnection(config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":436},{"i":452,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#glossary","p":436},{"i":453,"t":"ConnectionOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#connectionoptions","p":436},{"i":459,"t":"createPool(connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":457},{"i":461,"t":"createPool(config)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig","p":457},{"i":463,"t":"createPool(config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":457},{"i":465,"t":"createPool(config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":457},{"i":467,"t":"createPool(config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":457},{"i":469,"t":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#related-links","p":457},{"i":471,"t":"createPool(config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":457},{"i":473,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#glossary","p":457},{"i":474,"t":"PoolOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#pooloptions","p":457},{"i":477,"t":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":476},{"i":479,"t":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":476},{"i":481,"t":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":476},{"i":483,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#glossary","p":476},{"i":484,"t":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":476},{"i":486,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":476},{"i":491,"t":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":490},{"i":493,"t":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":490},{"i":495,"t":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":490},{"i":497,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#glossary","p":490},{"i":498,"t":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":490},{"i":500,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":490},{"i":503,"t":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":502},{"i":505,"t":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":502},{"i":507,"t":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":502},{"i":509,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#glossary","p":502},{"i":510,"t":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":502},{"i":512,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":502},{"i":515,"t":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":514},{"i":517,"t":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":514},{"i":519,"t":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":514},{"i":521,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#glossary","p":514},{"i":522,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":514},{"i":526,"t":"add(group, connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":524},{"i":528,"t":"add(group, config)","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":524},{"i":530,"t":"add(group, config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":524},{"i":532,"t":"add(group, config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":524},{"i":534,"t":"add(group, config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":524},{"i":536,"t":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#related-links","p":524},{"i":538,"t":"add(group, config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":524},{"i":540,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#glossary","p":524},{"i":541,"t":"PoolOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":524},{"i":545,"t":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#querysql","p":543},{"i":547,"t":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":543},{"i":549,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#glossary","p":543},{"i":550,"t":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":543},{"i":552,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":543},{"i":556,"t":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#querysql","p":554},{"i":558,"t":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":554},{"i":560,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#glossary","p":554},{"i":561,"t":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":554},{"i":563,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":554},{"i":569,"t":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#querysql","p":567},{"i":571,"t":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":567},{"i":573,"t":"query(options) — Row as Array","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":567},{"i":575,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#glossary","p":567},{"i":576,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":567},{"i":586,"t":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#querysql","p":584},{"i":588,"t":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":584},{"i":590,"t":"Glossary","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#glossary","p":584},{"i":591,"t":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":584},{"i":593,"t":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":584},{"i":615,"t":"Using callbacks","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":613},{"i":617,"t":"Using promises","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#using-promises","p":613},{"i":619,"t":"Related Links","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#related-links","p":613}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/319",[0,5.386]],["t/321",[1,5.386]],["t/323",[2,4.211,3,4.211]],["t/325",[4,5.386]],["t/327",[5,5.386]],["t/329",[6,5.386]],["t/331",[7,5.386]],["t/333",[8,4.211,9,4.211]],["t/337",[10,4.046]],["t/339",[11,2.932,12,2.932,13,2.932,14,2.593]],["t/341",[15,5.386]],["t/343",[16,5.386]],["t/346",[17,4.763]],["t/348",[18,4.763]],["t/350",[19,3.801]],["t/352",[18,4.763]],["t/356",[20,3.457,21,3.457,22,3.457]],["t/359",[19,1.587,23,2.249,24,2.249,25,2.249,26,2.249,27,1.587]],["t/361",[28,2.932,29,2.593,30,1.263,31,2.593]],["t/363",[32,5.386]],["t/365",[33,3.457,34,3.457,35,3.457]],["t/367",[29,3.057,36,3.457,37,3.457]],["t/369",[10,4.046]],["t/373",[38,4.211,39,3.403]],["t/375",[40,3.457,41,3.457,42,3.457]],["t/377",[43,5.386]],["t/381",[10,1.912,14,2.251,17,2.251,27,1.796,44,2.545]],["t/385",[30,2.321]],["t/387",[30,2.321]],["t/389",[45,5.386]],["t/391",[30,2.321]],["t/393",[39,4.353]],["t/395",[30,2.321]],["t/400",[46,3.724,47,4.211]],["t/402",[46,1.474,48,1.666,49,1.474,50,1.474,51,2.845,52,1.666,53,1.666,54,1.666]],["t/404",[55,2.014,56,2.014,57,2.014,58,2.014,59,2.014,60,2.014,61,1.781]],["t/406",[19,2.069,27,2.069,61,2.593,62,2.932]],["t/409",[63,5.386]],["t/411",[64,5.386]],["t/413",[19,3.801]],["t/415",[19,2.972,65,4.211]],["t/417",[31,3.724,66,4.211]],["t/419",[67,4.211,68,4.211]],["t/420",[69,4.763]],["t/422",[69,4.763]],["t/424",[70,3.27]],["t/426",[70,3.27]],["t/428",[71,5.386]],["t/430",[72,5.386]],["t/432",[10,4.046]],["t/438",[73,5.386]],["t/440",[74,3.801]],["t/442",[30,1.49,74,2.44,75,2.794]],["t/444",[30,1.49,74,2.44,76,2.309]],["t/446",[30,1.263,74,2.069,76,1.958,77,2.369]],["t/448",[78,3.163,79,3.163]],["t/450",[30,1.49,74,2.44,80,2.794]],["t/452",[81,2.901]],["t/453",[82,5.386]],["t/459",[83,5.386]],["t/461",[84,3.801]],["t/463",[30,1.49,75,2.794,84,2.44]],["t/465",[30,1.49,76,2.309,84,2.44]],["t/467",[30,1.263,76,1.958,77,2.369,84,2.069]],["t/469",[78,3.163,79,3.163]],["t/471",[30,1.49,80,2.794,84,2.44]],["t/473",[81,2.901]],["t/474",[85,4.763]],["t/477",[86,3.163,87,2.557]],["t/479",[88,3.27]],["t/481",[87,2.557,88,2.557]],["t/483",[81,2.901]],["t/484",[70,3.27]],["t/486",[89,3.27]],["t/491",[86,3.163,87,2.557]],["t/493",[88,3.27]],["t/495",[87,2.557,88,2.557]],["t/497",[81,2.901]],["t/498",[70,3.27]],["t/500",[89,3.27]],["t/503",[86,3.163,87,2.557]],["t/505",[88,3.27]],["t/507",[87,2.557,88,2.557]],["t/509",[81,2.901]],["t/510",[70,3.27]],["t/512",[89,3.27]],["t/515",[86,3.163,87,2.557]],["t/517",[88,3.27]],["t/519",[87,2.557,88,2.557]],["t/521",[81,2.901]],["t/522",[89,3.27]],["t/526",[90,2.813,91,4.211]],["t/528",[90,2.813,92,2.972]],["t/530",[30,1.263,75,2.369,90,1.958,92,2.069]],["t/532",[30,1.263,76,1.958,90,1.958,92,2.069]],["t/534",[30,1.097,76,1.7,77,2.057,90,1.7,92,1.796]],["t/536",[78,3.163,79,3.163]],["t/538",[30,1.263,80,2.369,90,1.958,92,2.069]],["t/540",[81,2.901]],["t/541",[85,4.763]],["t/545",[93,4.046]],["t/547",[94,3.801]],["t/549",[81,2.901]],["t/550",[70,3.27]],["t/552",[89,3.27]],["t/556",[93,4.046]],["t/558",[94,3.801]],["t/560",[81,2.901]],["t/561",[70,3.27]],["t/563",[89,3.27]],["t/569",[93,4.046]],["t/571",[94,3.801]],["t/573",[30,1.263,49,2.593,50,2.593,94,2.069]],["t/575",[81,2.901]],["t/576",[89,3.27]],["t/586",[93,4.046]],["t/588",[94,3.801]],["t/590",[81,2.901]],["t/591",[70,3.27]],["t/593",[89,3.27]],["t/615",[27,2.972,95,4.211]],["t/617",[27,2.972,39,3.403]],["t/619",[78,3.163,79,3.163]]],"invertedIndex":[["",{"_index":30,"t":{"361":{"position":[[15,1]]},"385":{"position":[[0,2]]},"387":{"position":[[0,4]]},"391":{"position":[[0,6]]},"395":{"position":[[0,4]]},"442":{"position":[[25,1]]},"444":{"position":[[25,1]]},"446":{"position":[[25,1]]},"450":{"position":[[25,1]]},"463":{"position":[[19,1]]},"465":{"position":[[19,1]]},"467":{"position":[[19,1]]},"471":{"position":[[19,1]]},"530":{"position":[[19,1]]},"532":{"position":[[19,1]]},"534":{"position":[[19,1]]},"538":{"position":[[19,1]]},"573":{"position":[[15,1]]}}}],["add(group",{"_index":90,"t":{"526":{"position":[[0,10]]},"528":{"position":[[0,10]]},"530":{"position":[[0,10]]},"532":{"position":[[0,10]]},"534":{"position":[[0,10]]},"538":{"position":[[0,10]]}}}],["api",{"_index":44,"t":{"381":{"position":[[28,3]]}}}],["array",{"_index":50,"t":{"402":{"position":[[18,5]]},"573":{"position":[[24,5]]}}}],["async",{"_index":41,"t":{"375":{"position":[[4,5]]}}}],["authent",{"_index":22,"t":{"356":{"position":[[13,14]]}}}],["automat",{"_index":23,"t":{"359":{"position":[[0,9]]}}}],["await",{"_index":42,"t":{"375":{"position":[[10,5]]}}}],["basic",{"_index":38,"t":{"373":{"position":[[0,5]]}}}],["benchmark",{"_index":16,"t":{"343":{"position":[[0,10]]}}}],["bind",{"_index":34,"t":{"365":{"position":[[17,4]]}}}],["cach",{"_index":25,"t":{"359":{"position":[[20,6]]}}}],["callback",{"_index":95,"t":{"615":{"position":[[6,9]]}}}],["co",{"_index":43,"t":{"377":{"position":[[5,2]]}}}],["column",{"_index":51,"t":{"402":{"position":[[27,7],[56,6]]}}}],["compon",{"_index":3,"t":{"323":{"position":[[7,10]]}}}],["config",{"_index":92,"t":{"528":{"position":[[11,7]]},"530":{"position":[[11,7]]},"532":{"position":[[11,7]]},"534":{"position":[[11,7]]},"538":{"position":[[11,7]]}}}],["configur",{"_index":32,"t":{"363":{"position":[[0,13]]}}}],["connect",{"_index":19,"t":{"350":{"position":[[0,10]]},"359":{"position":[[42,10]]},"406":{"position":[[0,10]]},"413":{"position":[[0,10]]},"415":{"position":[[5,10]]}}}],["connectionopt",{"_index":82,"t":{"453":{"position":[[0,17]]}}}],["connectionuri",{"_index":91,"t":{"526":{"position":[[11,14]]}}}],["createconnection(config",{"_index":74,"t":{"440":{"position":[[0,24]]},"442":{"position":[[0,24]]},"444":{"position":[[0,24]]},"446":{"position":[[0,24]]},"450":{"position":[[0,24]]}}}],["createconnection(connectionuri",{"_index":73,"t":{"438":{"position":[[0,31]]}}}],["createpool(config",{"_index":84,"t":{"461":{"position":[[0,18]]},"463":{"position":[[0,18]]},"465":{"position":[[0,18]]},"467":{"position":[[0,18]]},"471":{"position":[[0,18]]}}}],["createpool(connectionuri",{"_index":83,"t":{"459":{"position":[[0,25]]}}}],["creation",{"_index":24,"t":{"359":{"position":[[10,9]]}}}],["custom",{"_index":62,"t":{"406":{"position":[[17,6]]}}}],["data",{"_index":57,"t":{"404":{"position":[[16,4]]}}}],["develop",{"_index":1,"t":{"321":{"position":[[0,11]]}}}],["environ",{"_index":0,"t":{"319":{"position":[[0,11]]}}}],["es7",{"_index":40,"t":{"375":{"position":[[0,3]]}}}],["event",{"_index":18,"t":{"348":{"position":[[0,6]]},"352":{"position":[[0,6]]}}}],["exampl",{"_index":10,"t":{"337":{"position":[[0,8]]},"369":{"position":[[0,8]]},"381":{"position":[[0,8]]},"432":{"position":[[0,8]]}}}],["execut",{"_index":31,"t":{"361":{"position":[[17,7]]},"417":{"position":[[10,7]]}}}],["execute(opt",{"_index":88,"t":{"479":{"position":[[0,16]]},"481":{"position":[[0,16]]},"493":{"position":[[0,16]]},"495":{"position":[[0,16]]},"505":{"position":[[0,16]]},"507":{"position":[[0,16]]},"517":{"position":[[0,16]]},"519":{"position":[[0,16]]}}}],["execute(sql",{"_index":86,"t":{"477":{"position":[[0,12]]},"491":{"position":[[0,12]]},"503":{"position":[[0,12]]},"515":{"position":[[0,12]]}}}],["externalcodeemb",{"_index":7,"t":{"331":{"position":[[0,17]]}}}],["extra",{"_index":2,"t":{"323":{"position":[[0,6]]}}}],["factor",{"_index":21,"t":{"356":{"position":[[6,6]]}}}],["faq",{"_index":6,"t":{"329":{"position":[[0,3]]}}}],["glossari",{"_index":81,"t":{"452":{"position":[[0,8]]},"473":{"position":[[0,8]]},"483":{"position":[[0,8]]},"497":{"position":[[0,8]]},"509":{"position":[[0,8]]},"521":{"position":[[0,8]]},"540":{"position":[[0,8]]},"549":{"position":[[0,8]]},"560":{"position":[[0,8]]},"575":{"position":[[0,8]]},"590":{"position":[[0,8]]}}}],["hash",{"_index":53,"t":{"402":{"position":[[46,4]]}}}],["helper",{"_index":37,"t":{"367":{"position":[[20,6]]}}}],["histori",{"_index":4,"t":{"325":{"position":[[0,7]]}}}],["incompat",{"_index":12,"t":{"339":{"position":[[6,17]]}}}],["infil",{"_index":59,"t":{"404":{"position":[[32,7]]}}}],["instal",{"_index":63,"t":{"409":{"position":[[0,12]]}}}],["instead",{"_index":52,"t":{"402":{"position":[[35,7]]}}}],["key",{"_index":54,"t":{"402":{"position":[[71,4]]}}}],["known",{"_index":11,"t":{"339":{"position":[[0,5]]}}}],["link",{"_index":79,"t":{"448":{"position":[[8,5]]},"469":{"position":[[8,5]]},"536":{"position":[[8,5]]},"619":{"position":[[8,5]]}}}],["load",{"_index":58,"t":{"404":{"position":[[26,5]]}}}],["local",{"_index":60,"t":{"404":{"position":[[44,5]]}}}],["manual",{"_index":28,"t":{"361":{"position":[[0,6]]}}}],["multi",{"_index":20,"t":{"356":{"position":[[0,5]]}}}],["mysql",{"_index":14,"t":{"339":{"position":[[34,5]]},"381":{"position":[[15,5]]}}}],["name",{"_index":46,"t":{"400":{"position":[[0,5]]},"402":{"position":[[63,4]]}}}],["node",{"_index":13,"t":{"339":{"position":[[29,4]]}}}],["okpacket",{"_index":72,"t":{"430":{"position":[[0,8]]}}}],["paramet",{"_index":35,"t":{"365":{"position":[[22,10]]}}}],["placehold",{"_index":47,"t":{"400":{"position":[[6,12]]}}}],["pool",{"_index":65,"t":{"415":{"position":[[0,4]]}}}],["poolopt",{"_index":85,"t":{"474":{"position":[[0,11]]},"541":{"position":[[0,11]]}}}],["prepar",{"_index":29,"t":{"361":{"position":[[7,7]]},"367":{"position":[[0,8]]}}}],["procedurecallpacket",{"_index":71,"t":{"428":{"position":[[0,19]]}}}],["promis",{"_index":39,"t":{"373":{"position":[[6,7]]},"393":{"position":[[0,9]]},"617":{"position":[[6,8]]}}}],["queri",{"_index":66,"t":{"417":{"position":[[0,5]]}}}],["query(opt",{"_index":94,"t":{"547":{"position":[[0,14]]},"558":{"position":[[0,14]]},"571":{"position":[[0,14]]},"573":{"position":[[0,14]]},"588":{"position":[[0,14]]}}}],["query(sql",{"_index":93,"t":{"545":{"position":[[0,10]]},"556":{"position":[[0,10]]},"569":{"position":[[0,10]]},"586":{"position":[[0,10]]}}}],["queryopt",{"_index":89,"t":{"486":{"position":[[0,12]]},"500":{"position":[[0,12]]},"512":{"position":[[0,12]]},"522":{"position":[[0,12]]},"552":{"position":[[0,12]]},"563":{"position":[[0,12]]},"576":{"position":[[0,12]]},"593":{"position":[[0,12]]}}}],["rd",{"_index":77,"t":{"446":{"position":[[27,3]]},"467":{"position":[[21,3]]},"534":{"position":[[21,3]]}}}],["re",{"_index":26,"t":{"359":{"position":[[31,2]]}}}],["receiv",{"_index":48,"t":{"402":{"position":[[0,9]]}}}],["relat",{"_index":78,"t":{"448":{"position":[[0,7]]},"469":{"position":[[0,7]]},"536":{"position":[[0,7]]},"619":{"position":[[0,7]]}}}],["resourc",{"_index":15,"t":{"341":{"position":[[6,9]]}}}],["resultsethead",{"_index":70,"t":{"424":{"position":[[0,15]]},"426":{"position":[[0,17]]},"484":{"position":[[0,15]]},"498":{"position":[[0,15]]},"510":{"position":[[0,15]]},"550":{"position":[[0,15]]},"561":{"position":[[0,15]]},"591":{"position":[[0,15]]}}}],["row",{"_index":49,"t":{"402":{"position":[[10,4]]},"573":{"position":[[17,3]]}}}],["rowdatapacket",{"_index":69,"t":{"420":{"position":[[0,15]]},"422":{"position":[[0,17]]}}}],["run",{"_index":8,"t":{"333":{"position":[[0,7]]}}}],["send",{"_index":55,"t":{"404":{"position":[[0,7]]}}}],["serial",{"_index":33,"t":{"365":{"position":[[0,13]]}}}],["server",{"_index":17,"t":{"346":{"position":[[0,6]]},"381":{"position":[[21,6]]}}}],["sha1",{"_index":75,"t":{"442":{"position":[[27,4]]},"463":{"position":[[21,4]]},"530":{"position":[[21,4]]}}}],["sock",{"_index":80,"t":{"450":{"position":[[27,5]]},"471":{"position":[[21,5]]},"538":{"position":[[21,5]]}}}],["specif",{"_index":68,"t":{"419":{"position":[[5,13]]}}}],["sql",{"_index":45,"t":{"389":{"position":[[0,9]]}}}],["ssl",{"_index":76,"t":{"444":{"position":[[27,3]]},"446":{"position":[[31,3]]},"465":{"position":[[21,3]]},"467":{"position":[[25,3]]},"532":{"position":[[21,3]]},"534":{"position":[[25,3]]}}}],["stabil",{"_index":5,"t":{"327":{"position":[[0,9]]}}}],["statement",{"_index":36,"t":{"367":{"position":[[9,10]]}}}],["stream",{"_index":61,"t":{"404":{"position":[[50,7]]},"406":{"position":[[24,7]]}}}],["tabular",{"_index":56,"t":{"404":{"position":[[8,7]]}}}],["test",{"_index":9,"t":{"333":{"position":[[8,5]]}}}],["type",{"_index":67,"t":{"419":{"position":[[0,4]]}}}],["us",{"_index":27,"t":{"359":{"position":[[34,4]]},"381":{"position":[[9,5]]},"406":{"position":[[11,5]]},"615":{"position":[[0,5]]},"617":{"position":[[0,5]]}}}],["usag",{"_index":64,"t":{"411":{"position":[[0,5]]}}}],["valu",{"_index":87,"t":{"477":{"position":[[13,7]]},"481":{"position":[[17,7]]},"491":{"position":[[13,7]]},"495":{"position":[[17,7]]},"503":{"position":[[13,7]]},"507":{"position":[[17,7]]},"515":{"position":[[13,7]]},"519":{"position":[[17,7]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":312,"t":"内部协议由@sidorares编写 MySQL-Native 常量、SQL参数插值、连接池、ConnectionConfig 类取自node-mysql 基于@TooTallNate的SSL代码升级代码地址 与MariaSQL客户端兼容安全连接/压缩连接 API。 贡献者","s":"鸣谢","u":"/node-mysql2/zh-CN/docs/acknowledgements","h":"","p":311},{"i":314,"t":"MySQL2大部分的API与 Node MySQL 基本上相同,你应该查看他们的API文档来知道更多的API选项。 One known incompatibility is that DECIMAL values are returned as strings whereas in Node MySQL they are returned as numbers. This includes the result of SUM() and AVG() functions when applied to INTEGER arguments. This is done deliberately to avoid loss of precision - see https://github.com/sidorares/node-mysql2/issues/935. 信息 如果您发现与 Node MySQL 的任何不兼容问题,请通过issue报告。 我们将优先修复报告的不兼容问题。","s":"API配置项","u":"/node-mysql2/zh-CN/docs/api-and-configurations","h":"","p":313},{"i":316,"t":"如果要为node-mysql2做些贡献.请查阅 Contributing.md 来获得更多详细信息。","s":"贡献","u":"/node-mysql2/zh-CN/docs/contributing","h":"","p":315},{"i":318,"t":"This website is built using Docusaurus 3, a modern static website generator.","s":"Website Contributing Guidelines","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"","p":317},{"i":320,"t":"You will need these tools installed on your system: Node.js (18.x or higher)","s":"Environment","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#environment","p":317},{"i":322,"t":"Fork the MySQL2 repository. Download your forked repository locally. The website's workspace is the \"website\" directory in node-mysql2 root. Create a new branch from master (optional). Run cd website to enter the website workspace. Run npm ci to install the dependecies from package-lock.json. Run npm start to starting the local development. It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. For Docusaurus complete documentation, please see here. CLI example git clone https://github.com/sidorares/node-mysql2.git git checkout -b website # optional cd /path-to/node-mysql2/website npm ci npm start Documentation is auto-generated from MDX files placed in these directories: ./docs/documentation ./docs/examples ./docs/faq Caution Note that the website has its own package.json. Please, do not install dependencies for the website in node-mysql2 root.","s":"Development","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#development","p":317},{"i":324,"t":"Every extra component is thoroughly documented with complete typings descriptions. Docusaurus Markdown Features: The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences.","s":"Extras Components","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#extras-components","p":317},{"i":326,"t":"The History component displays version changes in a table format, listing version numbers alongside their changes. import { History } from '@site/src/components/History'; 提示 You can also utilize React components in the changes option. Example History Version Changes v1.0.0 Some change message.","s":"History","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#history","p":317},{"i":328,"t":"See the Stability Badges for more detais. import { Stability } from '@site/src/components/Stability'; 提示 You can also utilize React components in the message option. Available levels: 0, 1, 1.1, 1.2, 2 and 3. Example 2Stable 2Stable Some message.","s":"Stability","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#stability","p":317},{"i":330,"t":"import { FAQ } from '@site/src/components/FAQ'; > Some markdown (**MDX**) content. 提示 The FAQ component can be utilized in any section or page. Code blocks are compatible and can be used within the FAQ component. Example Title Some markdown (MDX) content.","s":"FAQ","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#faq","p":317},{"i":332,"t":"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; Example","s":"ExternalCodeEmbed","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#externalcodeembed","p":317},{"i":334,"t":"npm run test Check Prettier and ESLint rules for compliance npm run lintcheck Included in the GitHub Actions workflow. Check for typings errors 1Experimental Checks for MDX components are missing. npm run typecheck Included in the GitHub Actions workflow. Clear and build the website npm run clear npm run build Included in the GitHub Actions workflow. Fix issues from Prettier and ESLint rules npm run lint To prevent lint issues, it is recommended to execute this command before creating your commit. Not included in the GitHub Actions workflow.","s":"Running Tests","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#running-tests","p":317},{"i":336,"t":"MySQL2 aims to be a drop in replacement for Node MySQL. 备注 If you see any API incompatibilities with Node MySQL, please report via github issue. Not only MySQL2 offers better performance over Node MySQL, we also support these additional features: Prepared Statements Promise Wrapper Authentication Switch More Features MySQL Server Pooling SSL MySQL Compression Binary Log Protocol Client","s":"Documentation","u":"/node-mysql2/zh-CN/docs/documentation","h":"","p":335},{"i":338,"t":"Please check these examples for MySQL2.","s":"Examples","u":"/node-mysql2/zh-CN/docs/documentation","h":"#examples","p":335},{"i":340,"t":"zeroFill flag is ignored in type conversion. You need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you. DECIMAL and NEWDECIMAL types always returned as string unless you pass this config option: { decimalNumbers: true, } 备注 This option could lose precision on the number as Javascript Number is a Float!","s":"Known incompatibilities with Node MySQL","u":"/node-mysql2/zh-CN/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":335},{"i":342,"t":"Wire protocol documentation Node MySQL - Most popular node.js mysql client library node-mariasql - Bindings to libmariasql. One of the fastest clients node-libmysqlclient - Bindings to libmysqlclient go-mysql - MySQL Go client (prepared statements, binlog protocol, server)","s":"Other Resources","u":"/node-mysql2/zh-CN/docs/documentation","h":"#other-resources","p":335},{"i":344,"t":"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b npm run benchmarks node-mysql-benchmarks try to run example benchmarks on your system","s":"Benchmarks","u":"/node-mysql2/zh-CN/docs/documentation","h":"#benchmarks","p":335},{"i":347,"t":"createServer() - creates server instance Server.listen - listen port / unix socket (same arguments as net.Server.listen)","s":"Server","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#server","p":345},{"i":349,"t":"connect new incoming connection.","s":"Events","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#events","p":345},{"i":351,"t":"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags }) send server handshake initialisation packet, wait handshake response and start listening for commands writeOk({ affectedRows: num, insertId: num }) send OK packet to client writeEof(warnings, statusFlags) send EOF packet writeTextResult(rows, fields) write query result to client. Rows and fields are in the same format as in connection.query callback. writeColumns(fields) write fields + EOF packets. writeTextRow(row) write array (not hash!) of values as result row TODO: binary protocol","s":"Connection","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#connection","p":345},{"i":353,"t":"Every command packet received by the server will be emitted as a packet event with the parameters: packet: Packet The packet itself knownCommand: boolean is this command known to the server *commandCode: number the parsed command code (first byte) In addition special events are emitted for commands received from the client. If no listener is present a fallback behavior will be invoked. quit() Default: close the connection init_db(schemaName: string) Default: return OK query(sql: string) Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR field_list(table: string, fields: string) Default: return ER_WARN_DEPRECATED_SYNTAX ping() - Default: return OK","s":"Events","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#events-1","p":345},{"i":355,"t":"During the connection phase the server may ask the client to switch to a different auth method. If the authPlugins connection config option is set, it must be an object where each key is the name of a potential authentication plugin requested by the server, and the corresponding value must be a function that optionally receives the connection config options and returns another function, which in turn, optionally receives the switch request data. The plugin is loaded with a ({user,password,...}) signature, and each call has a (pluginData) signature. Each call should make the plugin return any additional authentication data (Buffer) that should be sent back to the server, either synchronously or asynchronously using a Promise, or should yield an error accordingly. Example: (imaginary ssh-key-auth plugin) pseudo code const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authPlugins: { 'ssh-key-auth': function ({ password }) { return function (pluginData) { return getPrivate(key) .then((key) => { const response = encrypt(key, password, pluginData); // continue handshake by sending response data return response; }) .catch((err) => { // throw error to propagate error to connect/changeUser handlers }); }; }, }, }); There is also a deprecated API where if a authSwitchHandler connection config option is set it must be a function that receives switch request data and responds via a callback. In this case, the first invocation always has a ({pluginName, pluginData}) signature, following calls - ({pluginData}). The client replies with an opaque blob matching the requested plugin via callback(null, data: Buffer). const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authSwitchHandler: function ({ pluginName, pluginData }, cb) { if (pluginName === 'ssh-key-auth') { getPrivateKey((key) => { const response = encrypt(key, pluginData); // continue handshake by sending response data // respond with error to propagate error to connect/changeUser handlers cb(null, response); }); } else { const err = new Error( `Unknown AuthSwitchRequest plugin name ${pluginName}` ); err.fatal = true; cb(err); } }, }); The initial handshake is always performed using mysql_native_password plugin. This will be possible to override in future versions. Note that if the mysql_native_password method is requested it will be handled internally according to Authentication::Native41 and no authPlugins function or the authSwitchHandler will be invoked. These MAY be called multiple times if the plugin algorithm requires multiple roundtrips of data exchange between client and server.","s":"Authentication Switch Request","u":"/node-mysql2/zh-CN/docs/documentation/authentication-switch","h":"","p":354},{"i":357,"t":"If the user requires multi-factor authentication in the server, the client will receive a AuthNextFactor request, which is similar in structure to the regular authentication switch request and contains the name and possible initial data for the additional authentication factor plugin (up to 3). Additional passwords can be provided using the connection config options - password2 and password3. Again, for each authentication factor, multiple roundtrips of data exchange can be required by the plugin algoritm. const conn = mysql.createConnection({ user: 'test_user', password: 'secret1', password2: 'secret2', password3: 'secret3', database: 'test_database', authPlugins: { // password1 === password 'auth-plugin1': function ({ password1 }) { return function (serverPluginData) { return clientPluginData(password1, serverPluginData); }; }, 'auth-plugin2': function ({ password2 }) { return function (serverPluginData) { return clientPluginData(password2, serverPluginData); }; }, 'auth-plugin3': function ({ password3 }) { return function (serverPluginData) { return clientPluginData(password3, serverPluginData); }; }, }, });","s":"Multi-factor authentication","u":"/node-mysql2/zh-CN/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":354},{"i":360,"t":"Similar to connection.query(). connection.execute('select 1 + ? + ? as result', [5, 6], (err, rows) => { // rows: [ { result: 12 } ] // internally 'select 1 + ? + ? as result' is prepared first. On subsequent calls cached statement is re-used }); // close cached statement for 'select 1 + ? + ? as result'. noop if not in cache connection.unprepare('select 1 + ? + ? as result'); Note that connection.execute() will cache the prepared statement for better performance, remove the cache with connection.unprepare() when you're done.","s":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":358},{"i":362,"t":"Manually prepared statements doesn't comes with LRU cache and SHOULD be closed using statement.close() instead of connection.unprepare(). connection.prepare('select ? + ? as tests', (err, statement) => { // statement.parameters - array of column definitions, length === number of params, here 2 // statement.columns - array of result column definitions. Can be empty if result schema is dynamic / not known // statement.id // statement.query statement.execute([1, 2], (err, rows, columns) => { // -> [ { tests: 3 } ] }); // don't use connection.unprepare(), it won't work! // note that there is no callback here. There is no statement close ack at protocol level. statement.close(); }); Note that you should not use statement after connection reset (changeUser() or disconnect). Statement scope is connection, you need to prepare statement for each new connection in order to use it.","s":"Manual prepare / execute","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":358},{"i":364,"t":"maxPreparedStatements : We keep the cached statements in a lru-cache. Default size is 16000 but you can use this option to override it. Any statements that are dropped from cache will be closed.","s":"Configuration","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#configuration","p":358},{"i":366,"t":"The bind parameter values passed to execute are serialized JS -> MySQL as: null -> NULL number -> DOUBLE boolean -> TINY (0 for false, 1 for true) object -> depending on prototype: Date -> DATETIME JSON like object - JSON Buffer -> VAR_STRING Other -> VAR_STRING Passing in undefined or a function will result in an error.","s":"Serialization of bind parameters","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":358},{"i":368,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [1, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.unprepare('select ?+1 as qqq, ? as rrr, ? as yyy'); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); } ); } ); } );","s":"Prepared Statements Helper","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":358},{"i":370,"t":"For Prepared Statements examples, please see here.","s":"Examples","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#examples","p":358},{"i":372,"t":"In addition to errback interface there is thin wrapper to expose Promise-based api","s":"Promise Wrappers","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"","p":371},{"i":374,"t":"/* eslint-env es6 */ const mysql = require('mysql2/promise'); // or require('mysql2').createConnectionPromise mysql .createConnection({ /* same parameters as for non-promise createConnection */ }) .then((conn) => conn.query('select foo from bar')) .then(([rows, fields]) => console.log(rows[0].foo)); const pool = require('mysql2/promise').createPool({}); // or require('mysql2').createPoolPromise({}) or require('mysql2').createPool({}).promise() pool .getConnection() .then((conn) => { const res = conn.query('select foo from bar'); conn.release(); return res; }) .then((result) => { console.log(result[0][0].foo); }) .catch((err) => { console.log(err); // any of connection time or query time errors from above });","s":"Basic Promise","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#basic-promise","p":371},{"i":376,"t":"async function example1() { const mysql = require('mysql2/promise'); const conn = await mysql.createConnection({ database: test }); const [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]); await conn.end(); } async function example2() { const mysql = require('mysql2/promise'); const pool = mysql.createPool({ database: test }); // execute in parallel, next console.log in 3 seconds await Promise.all([ pool.query('select sleep(2)'), pool.query('select sleep(3)'), ]); console.log('3 seconds after'); await pool.end(); }","s":"ES7 Async Await","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#es7-async-await","p":371},{"i":378,"t":"const mysql = require('mysql2'); const co = require('co'); co(function* () { const c = yield mysql.createConnectionPromise({ user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }); Examples in /examples/promise-co-await","s":"With CO","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#with-co","p":371},{"i":380,"t":"提示 To explore the examples, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Examples","u":"/node-mysql2/zh-CN/docs/examples","h":"","p":379},{"i":382,"t":"MySQL-pg-proxy - MySQL to Postgres proxy server. MySQLite.js - MySQL server with JS-only (emscripten compiled) sqlite backend. SQL-engine - MySQL server with LevelDB backend. MySQL-osquery-proxy - Connect to facebook osquery using MySQL client PlyQL - Connect to Druid using MySQL client","s":"Examples using MySQL server API","u":"/node-mysql2/zh-CN/docs/examples","h":"#examples-using-mysql-server-api","p":379},{"i":384,"t":"适用于Node.js的MySQL客户端,专注于性能优化。支持SQL预处理、非UTF-8编码支持、二进制文件编码支持、压缩和SSL等等 查看更多。","s":"MySQL2","u":"/node-mysql2/zh-CN/docs","h":"","p":383},{"i":386,"t":"MySQL2 可以跨平台使用,毫无疑问可以安装在 Linux、Mac OS 或 Windows 上。 JavaScript TypeScript npm install --save mysql2 npm install --save mysql2 npm install --save-dev @types/node For TypeScript documentation and examples, see here.","s":"安装","u":"/node-mysql2/zh-CN/docs","h":"#安装","p":383},{"i":388,"t":"To explore more queries examples, please visit the example sections Simple Queries and Prepared Statements. Promise Callback // 导入模块 import mysql from 'mysql2/promise'; // 创建一个数据库连接 const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // 简单查询 try { const [results, fields] = await connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45' ); console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } catch (err) { console.log(err); } // 使用占位符 try { const [results] = await connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45] ); console.log(results); } catch (err) { console.log(err); } // 导入模块 const mysql = require('mysql2'); // 创建一个数据库连接 const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // 简单查询 connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45', function (err, results, fields) { console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } ); // 使用占位符 connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45], function (err, results) { console.log(results); } );","s":"查询数据","u":"/node-mysql2/zh-CN/docs","h":"#查询数据","p":383},{"i":390,"t":"使用 MySQL2,您还可以提前准备好SQL预处理语句。 使用准备好的SQL预处理语句,MySQL 不必每次都为相同的查询做准备,这会带来更好的性能。 如果您不知道为什么它们很重要,请查看这些讨论: 如何防止预处理语句SQL注入攻击 MySQL2 提供了 execute 辅助函数,它将准备和查询语句。 您还可以使用 prepare / unprepare 方法手动准备/取消准备。 To explore more Prepared Statements and Placeholders examples, please visit the example section Prepared Statements. Promise Callback import mysql from 'mysql2/promise'; try { // 创建一个数据库连接 const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute 将在内部调用 prepare 和 query const [results, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53] ); console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } catch (err) { console.log(err); } const mysql = require('mysql2'); // 创建一个数据库连接 const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute 将在内部调用 prepare 和 query connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53], function (err, results, fields) { console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } ); 提示 如果再次执行相同的语句,他将从缓存中选取,这能有效的节省准备查询时间获得更好的性能。","s":"SQL预处理的使用","u":"/node-mysql2/zh-CN/docs","h":"#sql预处理的使用","p":383},{"i":392,"t":"连接池通过重用以前的连接来帮助减少连接到 MySQL 服务器所花费的时间,当你完成它们时让它们保持打开而不是关闭。 这改善了查询的延迟,因为您避免了建立新连接所带来的所有开销。 To explore more Connection Pools examples, please visit the example section createPool. Promise Callback import mysql from 'mysql2/promise'; // 创建连接池,设置连接池的参数 const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); const mysql = require('mysql2'); // 创建连接池,设置连接池的参数 const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); 备注 该池不会预先创建所有连接,而是根据需要创建它们,直到达到连接限制。 您可以像直接连接一样使用池(使用 pool.query() 和 pool.execute()): Promise Callback try { // For pool initialization, see above const [rows, fields] = await pool.query('SELECT `field` FROM `table`'); // Connection is automatically released when query resolves } catch (err) { console.log(err); } // For pool initialization, see above pool.query('SELECT `field` FROM `table`', function (err, rows, fields) { // Connection is automatically released when query resolves }); 或者,也可以手动从池中获取连接并稍后返回: Promise Callback // For pool initialization, see above const conn = await pool.getConnection(); // Do something with the connection await conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); // For pool initialization, see above pool.getConnection(function (err, conn) { // Do something with the connection conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); }); Additionally, directly release the connection using the connection object: conn.release();","s":"连接池的使用","u":"/node-mysql2/zh-CN/docs","h":"#using-connection-pools","p":383},{"i":394,"t":"MySQL2 也支持 Promise API。 这与 ES7 异步等待非常有效。 import mysql from 'mysql2/promise'; async function main() { // create the connection const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); } MySQL2 使用范围内可用的默认 Promise 对象。 但是你可以选择你想使用的 Promise 实现。 // 导入模块 import mysql from 'mysql2/promise'; // get the promise implementation, we will use bluebird import bluebird from 'bluebird'; // create the connection, specify bluebird as Promise const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', Promise: bluebird, }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); MySQL2 还在 Pools 上公开了一个 .promise()函数,因此您可以从同一个池创建一个 promise/non-promise 连接。 import mysql from 'mysql2'; async function main() { // create the pool const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', }); // now get a Promise wrapped instance of that pool const promisePool = pool.promise(); // query database using promises const [rows, fields] = await promisePool.query('SELECT 1'); } MySQL2 在 Connections 上公开了一个 .promise()函数,以“升级”现有的 non-promise 连接以使用 Promise。 const mysql = require('mysql2'); // create the connection const conn = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); conn .promise() .query('SELECT 1') .then(([rows, fields]) => { console.log(rows); }) .catch(console.log) .then(() => conn.end());","s":"Promise封装","u":"/node-mysql2/zh-CN/docs","h":"#promise封装","p":383},{"i":396,"t":"如果你有两个相同名称的列,你可能希望以数组而不是对象的形式获取结果,为了防止冲突,这是与 Node MySQL 库的区别。 例如: SELECT 1 AS `foo`, 2 AS `foo`. 您可以在连接级别(适用于所有查询)或查询级别(仅适用于该特定查询)启用此设置。 连接级别​ Promise Callback const conn = await mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); const conn = mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); 查询级别​ Promise Callback try { const [results, fields] = await conn.query({ sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }); console.log(results); // 返回数组而不是数组对象 console.log(fields); // 无变化 } catch (err) { console.log(err); } conn.query( { sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }, function (err, results, fields) { console.log(results); // in this query, results will be an array of arrays rather than an array of objects console.log(fields); // fields are unchanged } ); Getting Help Need help? Ask your question on Stack Overflow or GitHub. If you've encountered an issue, please file it on GitHub.","s":"结果返回","u":"/node-mysql2/zh-CN/docs","h":"#结果返回","p":383},{"i":398,"t":"index.js 'use strict'; const mysql = require('mysql2'); const through2 = require('through2'); const binlogStream = mysql.createBinlogStream({ serverId: 123, // slave ID, first field in \"show slave hosts\" sql response // you can also specify slave host, username, password and port masterId: 0, filename: 'mysql-bin.000007', binlogPos: 120, flags: 1, // 1 = \"non-blocking mode\" }); binlogStream.pipe( through2.obj((obj, enc, next) => { console.log(obj); next(); }) );","s":"Binlog Watcher","u":"/node-mysql2/zh-CN/docs/examples/binlog-watcher","h":"","p":397},{"i":401,"t":"You can use named placeholders for parameters by setting namedPlaceholders config value or query/execute time option. Named placeholders are converted to unnamed ? on the client (mysql protocol does not support named parameters). If you reference parameter multiple times under the same name it is sent to server multiple times. Unnamed placeholders can still be used by providing the values as an array instead of an object. connection.config.namedPlaceholders = true; connection.execute('select :x + :y as z', { x: 1, y: 2 }, (err, rows) => { // statement prepared as \"select ? + ? as z\" and executed with [1,2] values // rows returned: [ { z: 3 } ] }); connection.execute('select :x + :x as z', { x: 1 }, (err, rows) => { // select ? + ? as z, execute with [1, 1] }); connection.query('select :x + :x as z', { x: 1 }, (err, rows) => { // query select 1 + 1 as z }); // unnamed placeholders are still valid if the values are provided in an array connection.query('select ? + ? as z', [1, 1], (err, rows) => { // query select 1 + 1 as z });","s":"Named placeholders","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#named-placeholders","p":399},{"i":403,"t":"const options = { sql: 'select A,B,C,D from foo', rowsAsArray: true }; connection.query(options, (err, results) => { /* results will be an array of arrays like this now: [[ 'field A value', 'field B value', 'field C value', 'field D value', ], ...] */ });","s":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":399},{"i":405,"t":"In addition to sending local fs files you can send any stream using infileStreamFactory query option. If set, it has to be a function that return a readable stream. It gets file path from query as a parameter. Note: starting from version 2.0 infileStreamFactory is required parameter for LOAD DATA LOCAL INFILE. Response from server indicates that it wants access to a local file and no infileStreamFactory option is provided the query ends with error. // local file connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)', onInserted1 ); // local stream const sql = 'LOAD DATA LOCAL INFILE \"mystream\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)'; connection.query( { sql: sql, infileStreamFactory: function (path) { return getStream(); }, }, onInserted2 ); The infileStreamFactory option may also be set at a connection-level: const fs = require('fs'); const mysql = require('mysql2'); const connection = mysql.createConnection({ user: 'test', database: 'test', infileStreamFactory: (path) => { // Validate file path const validPaths = ['/tmp/data.csv']; if (!validPaths.includes(path)) { throw new Error( `invalid file path: ${path}: expected to be one of ${validPaths.join( ',' )}` ); } return fs.createReadStream(path); }, }); connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test', onInserted );","s":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":399},{"i":407,"t":"const net = require('net'); const mysql = require('mysql2'); const shape = require('shaper'); const connection = mysql.createConnection({ user: 'test', database: 'test', stream: net.connect('/tmp/mysql.sock').pipe(shape(10)), // emulate 10 bytes/sec link }); connection.query('SELECT 1+1 as test1', console.log); stream also can be a function. In that case function result has to be duplex stream, and it is used for connection transport. This is required if you connect pool using custom transport as new pooled connection needs new stream. Example connecting over socks5 proxy: const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ database: 'test', user: 'foo', password: 'bar', stream: function (cb) { const newStream = new SocksConnection( { host: 'remote.host', port: 3306 }, { host: 'localhost', port: 1080 } ); cb(null, newStream); }, }); In addition to password createConnection(), createPool() and changeUser() accept passwordSha1 option. This is useful when implementing proxies as plaintext password might be not available.","s":"Connecting using custom stream:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#connecting-using-custom-stream","p":399},{"i":410,"t":"npm install --save mysql2 npm install --save-dev @types/node The @types/node ensure the proper interaction between TypeScript and the Node.js modules used by MySQL2 (net, events, stream, tls, etc.). 信息 Requires TypeScript >=4.5.2.","s":"Installation","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#installation","p":408},{"i":412,"t":"You can import MySQL2 in two ways: By setting the esModuleInterop option to true in tsconfig.json import mysql from 'mysql2'; import mysql from 'mysql2/promise'; By setting the esModuleInterop option to false in tsconfig.json import * as mysql from 'mysql2'; import * as mysql from 'mysql2/promise';","s":"Usage","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#usage","p":408},{"i":414,"t":"import mysql, { ConnectionOptions } from 'mysql2'; const access: ConnectionOptions = { user: 'test', database: 'test', }; const conn = mysql.createConnection(access);","s":"Connection","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#connection","p":408},{"i":416,"t":"import mysql, { PoolOptions } from 'mysql2'; const access: PoolOptions = { user: 'test', database: 'test', }; const conn = mysql.createPool(access);","s":"Pool Connection","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#pool-connection","p":408},{"i":418,"t":"A simple query​ conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); conn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); The rows output will be these possible types: RowDataPacket[] RowDataPacket[][] ResultSetHeader ResultSetHeader[] ProcedureCallPacket In this example, you need to manually check the output types","s":"Query and Execute","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#query-and-execute","p":408},{"i":421,"t":"2Stable An array with the returned rows, for example: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); // SELECT conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { test: 2 } ] */ }); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { Tables_in_test: 'test' } ] */ }); Using rowsAsArray option as true: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', rowsAsArray: true, }); // SELECT conn.query( 'SELECT 1 + 1 AS test, 2 + 2 AS test;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 2, 4 ] ] */ } ); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 'test' ] ] */ });","s":"RowDataPacket[]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#rowdatapacket","p":408},{"i":423,"t":"2Stable Using multipleStatements option as true with multiple queries: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SELECT 1 + 1 AS test; SELECT 2 + 2 AS test; `; conn.query(sql, (_err, rows) => { console.log(rows); /** * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ] */ });","s":"RowDataPacket[][]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":408},{"i":425,"t":"2Stable History Version Changes v3.5.1 OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead. changedRows option is deprecated and might be removed in the future major release. Please use affectedRows instead. For INSERT, UPDATE, DELETE, TRUNCATE, etc.: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); const sql = ` SET @1 = 1; `; conn.query(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ });","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#resultsetheader","p":408},{"i":427,"t":"2Stable History Version Changes v3.5.1 Introduce ResultSetHeader[] For multiples INSERT, UPDATE, DELETE, TRUNCATE, etc. when using multipleStatements as true: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SET @1 = 1; SET @2 = 2; `; conn.query(sql, (_err, results) => { console.log(results); /** * @results: [ ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 10, warningStatus: 0, changedRows: 0 }, ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } ] */ });","s":"ResultSetHeader[]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":408},{"i":429,"t":"2Stable History Version Changes v3.5.1 Introduce ProcedureCallPacket 提示 By performing a Call Procedure using INSERT, UPDATE, etc., the return will be a ProcedureCallPacket (even if you perform multiples queries and set multipleStatements to true): import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); /** ResultSetHeader */ conn.query('DROP PROCEDURE IF EXISTS myProcedure'); /** ResultSetHeader */ conn.query(` CREATE PROCEDURE myProcedure() BEGIN SET @1 = 1; SET @2 = 2; END `); /** ProcedureCallPacket */ const sql = 'CALL myProcedure()'; conn.query>(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ }); For CREATE PROCEDURE and DROP PROCEDURE, these returns will be the default ResultSetHeader. By using SELECT and SHOW queries in a Procedure Call, it groups the results as: /** ProcedureCallPacket */ [RowDataPacket[], ResultSetHeader] For ProcedureCallPacket, please see the following examples.","s":"ProcedureCallPacket","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":408},{"i":431,"t":"0Deprecated OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead.","s":"OkPacket","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#okpacket","p":408},{"i":433,"t":"You can also check some code examples using MySQL2 and TypeScript to understand advanced concepts: Extending and using Interfaces with RowDataPacket Extending and using Interfaces with RowDataPacket and rowAsArray Extending and using Interfaces with RowDataPacket and multipleStatements Extending and using Interfaces with RowDataPacket, rowAsArray and multipleStatements Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket from ProcedureCallPacket Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket and rowAsArray from ProcedureCallPacket Creating a basic custom MySQL2 Class","s":"Examples","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#examples","p":408},{"i":435,"t":"await.js co.js .babelrc package.json 'use strict'; const mysql = require('mysql2/promise'); async function test() { const c = await mysql.createConnection({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log('connected!'); const [rows, fields] = await c.query('show databases'); console.log(rows); try { const [rows, fields] = await c.query('some invalid sql here'); } catch (e) { console.log('caught exception!', e); } console.log(await c.execute('select sleep(0.5)')); console.log('after first sleep'); console.log(await c.execute('select sleep(0.5)')); console.log('after second sleep'); let start = +new Date(); console.log( await Promise.all([ c.execute('select sleep(2.5)'), c.execute('select sleep(2.5)'), ]) ); console.log( 'after 2+3 parallel sleep which is in fact not parallel because commands are queued per connection' ); let end = +new Date(); console.log(end - start); await c.end(); const p = mysql.createPool({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log(await p.execute('select sleep(0.5)')); console.log('after first pool sleep'); start = +new Date(); console.log( await Promise.all([ p.execute('select sleep(2.5)'), p.execute('select sleep(2.5)'), ]) ); console.log('after 2+3 parallel pool sleep'); end = +new Date(); console.log(end - start); await p.end(); } test() .then(() => { console.log('done'); }) .catch((err) => { console.log('error!', err); throw err; }); 'use strict'; const mysql = require('mysql2/promise'); const co = require('co'); co(function* () { const c = yield mysql.createConnection({ port: 3306, user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }) .then(function () { console.log('done'); }) .catch(function (err) { console.log(err); throw err; }); { \"plugins\": [\"transform-async-to-generator\"] } { \"name\": \"promise-co-await\", \"version\": \"1.0.0\", \"description\": \"\", \"main\": \"await.js\", \"scripts\": { \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\" }, \"author\": \"\", \"license\": \"ISC\", \"dependencies\": { \"babel-cli\": \"^6.9.0\" } }","s":"await — co","u":"/node-mysql2/zh-CN/docs/examples/promise-wrapper/co-await","h":"","p":434},{"i":437,"t":"信息 For queries please see the Simple Queries and Prepared Statements examples.","s":"createConnection","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"","p":436},{"i":439,"t":"createConnection(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":436},{"i":441,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":436},{"i":443,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":436},{"i":445,"t":"createConnection(config: ConnectionOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); connection.addListener('error', (err) => { console.log(err); }); See ssl/certs.","s":"createConnection(config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":436},{"i":447,"t":"createConnection(config: ConnectionOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await connection.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); connection.addListener('error', (err) => { console.log(err); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { connection.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); });","s":"createConnection(config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":436},{"i":449,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#related-links","p":436},{"i":451,"t":"createConnection(config: ConnectionOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const connection = mysql.createConnection({ stream: socksProxy, }); connection.addListener('error', (err) => { console.log(err); }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const connection = mysql.createConnection({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); connection.addListener('error', (err) => { console.log(err); }); Testing connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createConnection(config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":436},{"i":454,"t":"ConnectionOptions Specification","s":"ConnectionOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#connectionoptions","p":436},{"i":456,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. See detailed documentaion in Prepared Statements. 提示 If you execute same statement again, it will be picked form a LRU cache which will save query preparation time and give better performance. Usage examples: INSERT SELECT UPDATE DELETE","s":"Prepared Statements","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements","h":"","p":455},{"i":458,"t":"信息 For queries please see the Simple Queries and Prepared Statements examples.","s":"createPool","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"","p":457},{"i":460,"t":"createPool(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":457},{"i":462,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig","p":457},{"i":464,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":457},{"i":466,"t":"createPool(config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":457},{"i":468,"t":"createPool(config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await pool.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { pool.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":457},{"i":470,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#related-links","p":457},{"i":472,"t":"createPool(config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const pool = mysql.createPool({ stream: socksProxy, }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); Testing pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createPool(config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":457},{"i":475,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#pooloptions","p":457},{"i":478,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":476},{"i":480,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":476},{"i":482,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":476},{"i":485,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":476},{"i":487,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":476},{"i":489,"t":"信息 For Prepared Statements or Placeholders / Parameters examples, please see here. Usage examples: INSERT SELECT UPDATE DELETE","s":"Simple Queries","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries","h":"","p":488},{"i":492,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":490},{"i":494,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":490},{"i":496,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":490},{"i":499,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":490},{"i":501,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":490},{"i":504,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":502},{"i":506,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":502},{"i":508,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":502},{"i":511,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":502},{"i":513,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":502},{"i":516,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute(sql, values); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute(sql, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":514},{"i":518,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute({ sql, values, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, values, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":514},{"i":520,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, // ... other options }, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":514},{"i":523,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":514},{"i":525,"t":"信息 For queries please see the Simple Queries and Prepared Statements examples.","s":"createPoolCluster","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"","p":524},{"i":527,"t":"add(group: string, connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":524},{"i":529,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config)","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":524},{"i":531,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":524},{"i":533,"t":"add(group: string, config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":524},{"i":535,"t":"add(group: string, config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await poolCluster.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { poolCluster.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":524},{"i":537,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#related-links","p":524},{"i":539,"t":"add(group: string, config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { stream: socksProxy, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); Testing poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"add(group, config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":524},{"i":542,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":524},{"i":544,"t":"The examples below also work for the execute method.","s":"DELETE","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"","p":543},{"i":546,"t":"query(sql: string) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#querysql","p":543},{"i":548,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":543},{"i":551,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":543},{"i":553,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":543},{"i":555,"t":"The examples below also work for the execute method.","s":"INSERT","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"","p":554},{"i":557,"t":"query(sql: string) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#querysql","p":554},{"i":559,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":554},{"i":562,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":554},{"i":564,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":554},{"i":566,"t":"index.js 'use strict'; const mysql = require('mysql2'); const ClientFlags = require('mysql2/lib/constants/client.js'); const server = mysql.createServer(); server.listen(3307); server.on('connection', (conn) => { console.log('connection'); conn.serverHandshake({ protocolVersion: 10, serverVersion: 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, capabilityFlags: 0xffffff ^ ClientFlags.COMPRESS, }); conn.on('field_list', (table, fields) => { console.log('field list:', table, fields); conn.writeEof(); }); const remote = mysql.createConnection({ user: 'root', database: 'dbname', host: 'server.example.com', password: 'secret', }); conn.on('query', (sql) => { console.log(`proxying query: ${sql}`); remote.query(sql, function (err) { // overloaded args, either (err, result :object) // or (err, rows :array, columns :array) if (Array.isArray(arguments[1])) { // response to a 'select', 'show' or similar const rows = arguments[1], columns = arguments[2]; console.log('rows', rows); console.log('columns', columns); conn.writeTextResult(rows, columns); } else { // response to an 'insert', 'update' or 'delete' const result = arguments[1]; console.log('result', result); conn.writeOk(result); } }); }); conn.on('end', remote.end.bind(remote)); });","s":"MySQL Proxy","u":"/node-mysql2/zh-CN/docs/examples/tests/mysql-proxy","h":"","p":565},{"i":568,"t":"The examples below also work for the execute method.","s":"SELECT","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"","p":567},{"i":570,"t":"query(sql: string) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query(sql); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query(sql, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#querysql","p":567},{"i":572,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":567},{"i":574,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, rowsAsArray: true, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, rowsAsArray: true, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server as array fields contains extra meta data about rows, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options) — Row as Array","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":567},{"i":577,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":567},{"i":579,"t":"index.js 'use strict'; const pool = require('mysql2').createPool({ host: 'localhost', user: 'root', database: 'test', password: 'root', }); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.query((err, rows, fields) => { console.log(rows, fields); // Connection is automatically released once query resolves }); } }, 1000); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.getConnection((err, db) => { db.query('select sleep(0.5) as qqq', (err, rows, fields) => { console.log(rows, fields); db.release(); }); }); } }, 1000);","s":"Pool","u":"/node-mysql2/zh-CN/docs/examples/tests/pool","h":"","p":578},{"i":581,"t":"index.js 'use strict'; const mysql = require('mysql2'); const flags = require('mysql2/lib/constants/client.js'); const auth = require('mysql2/lib/auth_41.js'); function authenticate(params, cb) { console.log(params); const doubleSha = auth.doubleSha1('pass123'); const isValid = auth.verifyToken( params.authPluginData1, params.authPluginData2, params.authToken, doubleSha ); if (isValid) { cb(null); } else { // for list of codes lib/constants/errors.js cb(null, { message: 'wrong password dude', code: 1045 }); } } const server = mysql.createServer(); server.listen(3333); server.on('connection', (conn) => { // we can deny connection here: // conn.writeError({ message: 'secret', code: 123 }); // conn.close(); conn.serverHandshake({ protocolVersion: 10, serverVersion: '5.6.10', // 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, // capabilityFlags: 0xffffff, // capabilityFlags: -2113931265, capabilityFlags: 2181036031, authCallback: authenticate, }); conn.on('field_list', (table, fields) => { console.log('FIELD LIST:', table, fields); conn.writeEof(); }); conn.on('query', (query) => { conn.writeColumns([ { catalog: 'def', schema: 'test', table: 'test_table', orgTable: 'test_table', name: 'beta', orgName: 'beta', characterSet: 33, columnLength: 384, columnType: 253, flags: 0, decimals: 0, }, ]); conn.writeTextRow(['test тест テスト փորձարկում পরীক্ষা kiểm tra ']); conn.writeTextRow(['ტესტი પરીક્ષણ מבחן פּרובירן اختبار परीक्षण']); conn.writeEof(); conn.close(); }); });","s":"Server","u":"/node-mysql2/zh-CN/docs/examples/tests/server","h":"","p":580},{"i":583,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user.id); console.log('name:', user.name); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet","u":"/node-mysql2/zh-CN/docs/examples/typescript/procedure-call/index","h":"","p":582},{"i":585,"t":"The examples below also work for the execute method.","s":"UPDATE","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"","p":584},{"i":587,"t":"query(sql: string) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#querysql","p":584},{"i":589,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":584},{"i":592,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":584},{"i":594,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":584},{"i":596,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/multi-statements","h":"","p":595},{"i":598,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/index","h":"","p":597},{"i":600,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/row-as-array","h":"","p":599},{"i":602,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/row-as-array-multi-statements","h":"","p":601},{"i":604,"t":"This section provides answers to commonly asked questions about MySQL2. 提示 To explore the FAQs, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Frequently Asked Questions","u":"/node-mysql2/zh-CN/docs/faq","h":"","p":603},{"i":606,"t":"MySQL2 项目是 MySQL-Native 的延续。 协议解析器代码从头开始重写,api 更改为匹配流行的 mysqljs/mysql。 MySQL2 团队正在与 mysqljs/mysql 团队合作,将共享代码分解并移至 mysqljs 组织下。 MySQL2 大部分 API 与 mysqljs 兼容,并支持大部分功能。 MySQL2 还提供了更多的附加功能: 更快、更好的性能 支持预处理 MySQL二进制日志协议 MySQL Server 对编码和排序规则有很好的支持 Promise封装 支持压缩 SSL 和 Authentication Switch 自定义流 连接池","s":"MySQL2的历史以及选择原因","u":"/node-mysql2/zh-CN/docs/history-and-why-mysq2","h":"","p":605},{"i":608,"t":"The Stability Badges are indications of a section's stability. The stability indices are as follows: 0Deprecated The feature might generate warnings and does not assure backward compatibility. Experimental: These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged. Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features. Experimental features are classified into stages: 1Experimental Experimental features at this stage are currently in development and prone to considerable changes. 1.1Early Development Experimental features at this stage are approaching minimum viability. 1.2Release Candidate Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification. 2Stable Compatibility with the MySQL ecosystem is a high priority. 3Legacy This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available. Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed.","s":"Stability Badges","u":"/node-mysql2/zh-CN/docs/stability-badges","h":"","p":607},{"i":610,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/procedure-call/row-as-array","h":"","p":609},{"i":612,"t":"index.ts db.ts /** * The types are explicity for learning purpose */ import { PoolOptions } from 'mysql2/promise'; import { MySQL } from './db.js'; interface User extends RowDataPacket { id: number; name: string; } const access: PoolOptions = { host: '', user: '', password: '', database: '', }; (async () => { const mysql = new MySQL(access); /** Deleting the `users` table, if it exists */ await mysql.queryResult('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await mysql.queryResult( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await mysql.executeResult( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await mysql.queryRows( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user: User) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await mysql.connection.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */ /** * The types are explicity for learning purpose */ import { createPool, PoolOptions, Pool, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; export class MySQL { private conn: Pool; private credentials: PoolOptions; constructor(credentials: PoolOptions) { this.credentials = credentials; this.conn = createPool(this.credentials); } /** A random method to simulate a step before to get the class methods */ private ensureConnection() { if (!this?.conn) this.conn = createPool(this.credentials); } /** For `SELECT` and `SHOW` */ get queryRows() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get queryRowsAsArray() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get queryResult() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get queryResults() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` */ get executeRows() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get executeRowsAsArray() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get executeResult() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get executeResults() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** Expose the Pool Connection */ get connection() { return this.conn; } }","s":"Basic Custom Class","u":"/node-mysql2/zh-CN/docs/examples/typescript/basic-custom-class","h":"","p":611},{"i":614,"t":"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.","s":"How to handle errors?","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"","p":613},{"i":616,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors by adding an error event listener: const mysql = require('mysql2'); connection = mysql.createConnection({ host: '', user: '', database: '', }); connection.addListener('error', (err) => { if (err instanceof Error) { console.log(`createConnection error:`, err); } }); createPool 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const pool = mysql.createPool({ host: '', user: '', database: '', }); pool.getConnection((err, connection) => { if (err instanceof Error) { console.log('pool.getConnection error:', err); return; } }); createPoolCluster 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); poolCluster.getConnection('NodeI', (err, connection) => { if (err instanceof Error) { console.log('poolCluster.getConnection error:', err); return; } }); execute 2Stable This solution has been tested. Handling execute errors through callback's err parameter: connection.execute('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('execute error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through callback's err parameter: connection.query('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('query error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using callbacks","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":613},{"i":618,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: '', user: '', database: '', }); } catch (err) { if (err instanceof Error) { console.log(err); } } createPool 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const pool = mysql.createPool({ host: '', user: '', database: '', }); try { const connection = await pool.getConnection(); } catch (err) { if (err instanceof Error) { console.log(err); } } createPoolCluster 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); try { await poolCluster.getConnection('NodeI'); } catch (err) { if (err instanceof Error) { console.log('createConnection error:', err); } } execute 2Stable This solution has been tested. Handling execute errors through try-catch block: try { const [rows] = await connection.execute('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('execute error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through try-catch block: try { const [rows] = await connection.query('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('query error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using promises","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#using-promises","p":613},{"i":620,"t":"Discussions #1998 #2282","s":"Related Links","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#related-links","p":613}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/312",[0,7.076,1,1.63,2,6.286,3,7.076,4,4.395,5,7.076,6,6.286,7,4.809,8,0.473]],["t/314",[1,1.572,4,4.979,8,0.536,9,5.693,10,5.693,11,4.64,12,4.64,13,5.058,14,4.64,15,1.907,16,1.719,17,2.032,18,5.693,19,2.961,20,5.058,21,1.989,22,5.058,23,5.693,24,2.17,25,5.693,26,5.693,27,5.058,28,5.058,29,5.693,30,5.693,31,5.693,32,5.058,33,2.711,34,5.058,35,5.693,36,3.692]],["t/316",[4,4.636,8,0.499,37,3.049,38,7.464]],["t/318",[39,6.808,40,7.138,41,1.18,42,5.817,43,3.601,44,7.138,45,7.138,46,5.425]],["t/320",[47,4.938,48,7.265,49,5.521,50,6.454,51,5.203,52,7.265,53,7.265]],["t/322",[4,3.54,8,0.266,33,1.893,34,3.531,37,2.722,39,6.536,42,3.239,46,3.02,49,4.332,54,5.699,55,5.699,56,3.974,57,5.92,58,3.974,59,5.699,60,5.699,61,2.964,62,2.005,63,2.206,64,3.974,65,3.974,66,1.909,67,5.43,68,5.699,69,3.974,70,5.214,71,5.699,72,3.974,73,3.974,74,3.974,75,5.533,76,5.063,77,1.76,78,3.974,79,3.531,80,3.974,81,3.531,82,2.701,83,3.974,84,3.974,85,3.974,86,3.974,87,3.974,88,3.531,89,4.332,90,2.572,91,2.577,92,3.531,93,1.388,94,5.699,95,3.974,96,3.974,97,3.974,98,3.531,99,3.531,100,3.974,101,3.974,102,3.974,103,3.02,104,3.02,105,3.974,106,3.974,107,3.974,108,3.974,109,3.531,110,2.846,111,3.531,112,3.239]],["t/324",[41,0.975,42,4.807,62,2.976,88,5.241,89,4.484,103,4.484,104,4.484,113,2.41,114,5.837,115,5.899,116,3.275,117,5.241,118,7.241,119,4.807,120,5.241,121,5.241,122,6.063,123,5.899,124,5.899,125,6.61,126,5.899,127,5.899,128,5.899,129,5.241,130,5.899,131,3.664,132,5.899]],["t/326",[8,0.604,19,2.9,66,1.868,82,6.139,93,1.948,114,5.141,122,4.545,133,6.371,134,5.577,135,5.207,136,2.656,137,4.954,138,4.545,139,5.577,140,1.532,141,5.577,142,5.577,143,4.954,144,5.85,145,4.545,146,5.577]],["t/328",[8,0.586,33,2.75,43,2.913,66,1.934,93,2.017,114,4.135,122,4.705,140,1.586,144,6.576,145,4.705,147,7.544,148,5.13,149,4.135,150,5.774,151,5.774,152,7.34,153,5.774,154,2.251,155,4.705,156,3.003,157,1.714,158,5.774,159,5.774,160,2.476,161,4.381]],["t/330",[8,0.577,41,0.997,93,2.106,103,5.733,114,5.403,118,6.702,125,6.702,129,5.357,140,1.657,145,4.914,162,7.89,163,6.03,164,6.03,165,4.099,166,2.721,167,3.745,168,4.914,169,4.319,170,5.357]],["t/332",[8,0.594,93,2.293,140,1.803,171,8.549,172,6.563,173,6.563,174,6.563,175,6.563,176,6.563,177,6.563,178,6.563,179,6.563,180,6.563,181,6.563]],["t/334",[20,7.032,36,4.227,39,3.927,62,2.431,67,6.946,70,6.104,103,3.663,114,3.451,116,2.675,182,1.519,183,5.291,184,6.519,185,5.792,186,6.519,187,4.819,188,4.819,189,6.45,190,7.915,191,7.915,192,1.251,193,4.281,194,4.819,195,4.819,196,6.519,197,6.519,198,3.663,199,6.519,200,4.819,201,4.819,202,1.403,203,3.451,204,4.281,205,4.819]],["t/336",[1,1.686,4,4.868,7,3.69,8,0.363,13,4.823,33,2.585,36,3.52,37,2.882,77,1.677,90,2.449,119,5.749,149,3.888,189,4.424,206,5.428,207,4.424,208,5.428,209,5.428,210,4.823,211,5.428,212,4.424,213,3.52,214,3.888,215,4.823,216,3.52,217,2.738,218,2.659,219,3.013,220,4.823,221,3.888,222,4.126,223,2.515,224,3.013,225,5.428,226,4.823,227,5.428,228,3.888,229,3.372]],["t/338",[37,3.049,90,3.368,93,2.607,183,5.346]],["t/340",[8,0.538,14,4.672,16,1.355,17,2.608,19,3.8,32,5.094,47,3.897,66,2.448,116,4.056,140,1.575,183,4.106,230,7.307,231,5.554,232,5.733,233,5.733,234,5.094,235,5.733,236,5.094,237,4.106,238,5.733,239,4.358,240,5.733,241,5.094,242,3.422,243,5.733,244,2.459,245,5.733,246,5.094,247,5.733]],["t/342",[1,1.687,4,5.096,6,5.318,11,4.878,51,4.287,77,1.849,89,4.549,217,3.02,218,2.932,228,5.378,229,5.096,248,5.986,249,5.986,250,5.318,251,6.671,252,5.986,253,5.986,254,7.509,255,7.509,256,5.986]],["t/344",[1,1.364,4,4.32,50,6.179,67,6.705,70,4.981,93,2.43,257,6.955,258,8.763,259,1.84]],["t/347",[8,0.461,27,6.127,62,3.479,77,2.13,260,6.896,261,4.939,262,6.896,263,5.241,264,3.965,265,6.896,266,6.896,267,4.688,268,6.896]],["t/349",[63,4.143,269,1.778,270,7.464]],["t/351",[8,0.497,15,1.634,21,2.296,75,3.706,77,1.506,137,4.333,203,3.493,226,4.333,228,3.493,229,4.082,263,3.706,267,3.315,271,4.877,272,3.974,273,3.974,274,3.974,275,5.355,276,3.974,277,3.974,278,6.057,279,5.838,280,4.877,281,7.066,282,4.877,283,3.493,284,4.877,285,3.315,286,6.572,287,3.315,288,4.333,289,4.877,290,6.572,291,4.877,292,2.042,293,7.433,294,0.938,295,2.248,296,2.91,297,3.162,298,4.877,299,4.877,300,3.029,301,4.877,302,4.877]],["t/353",[12,3.927,16,1.87,17,2.824,19,2.506,77,2.014,90,2.175,167,2.993,203,5.669,216,3.125,229,2.993,263,4.955,269,0.999,281,7.347,288,5.792,292,1.324,303,5.313,304,6.519,305,5.313,306,3.125,307,4.819,308,4.819,309,4.281,310,4.819,311,4.819,312,3.451,313,4.819,314,4.819,315,4.819,316,4.819,317,4.819,318,4.281,319,4.819,320,6.285,321,3.451,322,4.819,323,3.451,324,4.819,325,4.819,326,4.819,327,4.819,328,4.819]],["t/355",[7,1.458,8,0.615,15,0.719,16,1.368,24,2.513,41,0.585,63,1.191,66,1.94,77,1.617,93,0.749,110,1.537,135,1.333,167,1.333,182,1.115,192,1.618,210,3.143,213,1.391,216,1.391,219,1.191,221,2.533,222,3.43,229,2.803,234,1.906,239,2.689,242,2.694,244,0.92,269,1.086,278,2.883,279,4.01,283,4.464,297,1.391,303,3.678,312,1.537,318,1.906,329,2.145,330,2.145,331,1.748,332,2.145,333,4.267,334,1.21,335,4.01,336,1.899,337,0.856,338,3.678,339,2.906,340,1.185,341,2.145,342,5.615,343,4.148,344,2.145,345,2.145,346,2.457,347,1.906,348,2.145,349,4.513,350,4.267,351,6.592,352,1.631,353,3.143,354,1.906,355,2.145,356,2.145,357,2.145,358,1.748,359,2.145,360,2.145,361,4.513,362,2.145,363,0.868,364,1.445,365,1.379,366,0.836,367,3.143,368,2.363,369,1.137,370,3.143,371,2.145,372,2.145,373,3.537,374,3.537,375,1.748,376,1.748,377,3.537,378,3.537,379,3.537,380,1.631,381,4.513,382,3.537,383,1.537,384,2.145,385,5.236,386,1.748,387,2.145,388,2.145,389,2.145,390,2.145,391,2.145,392,1.748,393,2.145,394,1.748,395,0.462,396,1.748,397,2.145,398,2.145,399,2.145,400,1.748,401,3.537,402,1.748,403,1.906,404,1.631,405,1.631,406,1.906,407,2.145,408,2.145,409,2.294,410,1.631,411,2.145,412,1.537,413,1.906,414,1.906,415,1.906]],["t/357",[8,0.628,16,1.844,24,2.974,41,0.607,43,1.851,66,1.229,77,1.134,79,3.261,216,3.489,221,5.023,222,2.789,229,2.28,242,2.19,269,0.761,303,2.991,333,5.19,335,3.261,338,2.991,340,1.229,342,4.384,343,3.853,346,2.005,363,0.55,364,1.499,365,1.431,366,1.271,367,3.261,368,2.874,369,1.18,370,3.261,400,2.991,402,2.991,409,2.38,412,3.853,413,3.261,414,3.261,416,3.67,417,6.369,418,3.67,419,2.991,420,3.67,421,3.67,422,1.499,423,1.536,424,6.369,425,6.369,426,3.261,427,3.67,428,3.67,429,3.67,430,3.67,431,5.38,432,3.67,433,7.803,434,3.67,435,3.67,436,3.67,437,3.67,438,3.67]],["t/360",[8,0.644,21,2.837,28,4.065,41,0.756,110,3.277,157,2.3,212,3.729,213,2.967,217,3.174,218,3.523,295,2.152,296,2.731,312,3.277,321,3.277,350,3.729,395,0.985,406,4.065,419,3.729,439,3.729,440,4.065,441,4.576,442,4.576,443,2.295,444,4.576,445,6.172,446,3.277,447,4.576,448,4.065,449,2.457,450,3.478,451,4.065,452,4.576]],["t/362",[8,0.632,12,3.254,19,2.077,21,1.998,41,1.206,43,2.015,47,2.714,63,2.217,91,3.709,110,4.096,155,3.254,160,2.453,182,1.802,217,2.885,218,3.936,228,2.86,237,2.86,269,1.386,295,1.366,297,2.59,300,3.552,321,4.096,338,3.254,395,1.231,445,3.035,451,5.081,453,3.994,454,3.994,455,3.254,456,5.719,457,2.86,458,3.994,459,3.994,460,5.936,461,5.719,462,3.994,463,3.994,464,3.994,465,3.994,466,3.548,467,3.994,468,3.994,469,3.994,470,3.994,471,2.144,472,3.994,473,2.59,474,3.994,475,3.994,476,3.548,477,3.994,478,3.994,479,2.48]],["t/364",[8,0.446,41,1.103,66,2.235,207,5.436,218,3.932,320,5.07,321,4.778,403,5.926,445,6.543,455,5.436,480,6.671,481,6.671,482,6.671,483,6.671]],["t/366",[1,1.086,8,0.611,15,1.855,19,2.88,21,1.935,24,2.111,112,4.514,156,2.88,157,1.644,192,1.437,202,1.613,241,6.35,244,2.375,251,4.921,306,3.592,309,4.921,337,2.852,353,4.921,484,5.539,485,4.921,486,6.35,487,5.539,488,5.539,489,4.21,490,5.539,491,4.921,492,5.539,493,7.147,494,7.147,495,5.539]],["t/368",[8,0.634,37,1.742,43,3.993,157,2.35,202,1.242,217,3.495,218,2.936,237,3.055,292,2.256,294,0.821,295,2.808,334,1.459,395,1.491,423,1.784,443,2.526,448,3.789,449,3.719,486,6.155,496,3.789,497,4.883,498,4.873,499,7.514,500,7.514,501,1.699]],["t/370",[33,3.491,90,3.308,91,4.753,93,2.56,217,3.698,218,3.591]],["t/372",[7,4.852,216,4.628,219,3.962,220,6.341,502,7.138,503,4.26,504,7.138,505,6.341,506,6.341]],["t/374",[1,1.253,8,0.64,16,1.106,185,4.159,192,1.215,219,2.598,223,2.962,267,3.182,269,0.971,292,1.286,294,0.901,306,3.035,363,1.091,375,3.815,410,4.858,446,4.577,501,1.148,507,4.681,508,4.681,509,3.815,510,4.681,511,2.382,512,3.558,513,6.391,514,5.678,515,4.858,516,5.678,517,4.159,518,4.681,519,4.681,520,4.681,521,4.681,522,4.681,523,4.159,524,4.681,525,4.681,526,4.159]],["t/376",[1,1.283,8,0.625,22,4.307,24,2.495,43,2.445,160,2.807,182,2.062,202,1.411,223,2.246,292,1.332,295,1.658,363,1.242,364,1.98,365,1.89,369,2.105,509,5.334,527,3.763,528,4.848,529,1.851,530,4.307,531,3.011,532,4.848,533,2.603,534,4.307,535,4.307,536,2.787,537,5.815,538,4.307,539,5.815,540,4.848,541,4.848,542,4.848,543,4.307]],["t/378",[1,1.079,8,0.622,61,2.861,93,1.922,244,2.359,295,1.882,358,6.428,363,1.25,366,1.3,369,1.769,498,3.567,529,1.229,544,1.922,545,6.322,546,4.888,547,4.888,548,4.181,549,5.501,550,4.483,551,4.888,552,2.549,553,4.888,554,4.888,555,4.888,556,4.888,557,3.567,558,4.888,559,5.501]],["t/380",[8,0.465,41,1.15,90,3.138,93,2.43,560,4.981,561,6.179,562,6.179,563,6.179,564,3.734,565,6.179,566,6.179,567,6.179]],["t/382",[1,1.785,41,1.213,77,2.493,120,5.13,229,4.559,269,1.522,485,5.13,568,5.774,569,7.169,570,5.774,571,5.774,572,5.774,573,5.774,574,7.34,575,1.857,576,5.774,577,5.774,578,7.34,579,5.774,580,5.774,581,5.774]],["t/384",[8,0.504,582,7.533,583,7.533]],["t/386",[8,0.556,33,2.937,37,3.397,49,6.321,70,5.956,81,5.479,89,4.687,91,3.999,93,2.154,246,5.479,584,6.167,585,6.167,586,6.234,587,6.777,588,5.479,589,5.479]],["t/388",[1,0.929,8,0.65,21,2.252,24,1.806,61,2.465,90,1.398,93,1.656,136,3.07,140,0.851,149,2.219,165,2.106,166,2.909,182,1.493,217,1.563,218,1.518,219,1.72,259,1.253,269,0.983,292,1.302,294,0.912,296,3.847,297,2.009,340,2.159,363,1.041,365,1.848,366,1.12,369,1.524,395,1.387,443,2.35,501,1.162,529,1.286,544,1.082,560,2.219,590,2.525,591,2.219,592,1.106,593,1.848,594,2.725,595,2.834,596,3.461,597,2.697,598,1.848,599,1.278]],["t/390",[1,0.987,8,0.648,21,1.758,24,1.278,37,1.37,61,2.617,90,1.513,93,1.758,136,2.396,140,0.921,149,2.402,165,2.279,182,1.586,202,1.758,217,3.627,218,2.465,219,1.861,259,0.887,269,1.043,292,1.383,294,0.968,297,2.175,340,1.686,363,1.006,365,1.962,366,1.189,369,1.618,395,1.083,443,1.835,449,2.701,497,2.733,501,0.822,529,1.124,544,1.171,548,3.824,560,2.402,575,1.078,590,2.733,592,1.197,593,1.962,594,2.893,595,2.213,597,2.105,598,1.962,599,0.904,600,3.353,601,3.353,602,2.733,603,5.032,604,5.032,605,5.032]],["t/392",[1,0.981,8,0.631,15,1.917,24,0.95,33,2.725,41,0.412,61,2.078,90,1.125,93,1.396,136,1.903,140,0.685,149,1.785,156,2.976,165,1.694,182,1.259,219,2.777,223,3.254,244,2.454,259,0.659,267,2.716,269,1.693,292,1.572,294,0.769,295,1.367,297,3.244,320,4.349,337,0.995,363,0.939,364,1.633,366,0.944,369,1.285,395,1.077,400,4.663,471,2.146,501,0.611,523,2.215,526,5.084,529,1.118,533,2.146,539,3.551,544,0.871,557,3.711,560,1.785,590,2.031,592,0.89,593,1.558,594,2.298,599,0.672,606,0.909,607,3.997,608,5.722,609,3.997,610,3.997,611,5.722,612,3.997,613,5.722,614,3.997,615,3.997,616,3.997,617,3.997,618,3.997,619,2.493,620,2.493,621,3.551,622,3.068,623,3.551,624,1.616,625,3.997,626,3.257,627,2.218,628,2.218,629,3.997,630,1.694,631,2.493,632,2.493]],["t/394",[1,1.159,7,1.793,8,0.642,24,1.593,37,2.631,41,0.691,61,3.073,62,2.981,136,1.991,140,1.624,157,1.241,182,1.862,219,4.654,223,2.738,261,1.889,269,1.421,292,1.624,294,0.999,295,1.776,340,1.401,363,1.15,364,1.708,365,2.025,366,1.396,369,2.309,443,1.525,449,2.245,512,2.005,517,2.344,527,2.404,529,1.439,531,1.638,533,1.416,544,0.921,552,1.222,592,1.492,593,2.304,594,3.397,595,1.838,633,2.638,634,3.714,635,4.181,636,4.181,637,2.344,638,6.441,639,2.15,640,2.638,641,2.344,642,2.638,643,2.638,644,2.638,645,2.638,646,2.638,647,2.638]],["t/396",[1,0.716,4,2.269,8,0.632,21,2.219,24,1.393,36,2.369,47,2.483,61,2.789,90,1.649,104,2.777,157,1.886,160,2.724,182,1.69,189,4.37,219,2.977,244,3.001,259,0.966,292,1.745,294,0.703,297,3.477,300,3.946,331,2.978,337,1.458,363,0.952,364,2.19,365,2.091,366,1.267,369,1.724,395,1.154,443,2.316,501,0.896,515,5.921,529,1.198,575,1.724,593,2.091,594,3.083,597,2.244,598,2.091,599,0.985,626,4.37,648,4.538,649,3.654,650,2.181,651,5.362,652,3.246,653,3.654,654,3.654,655,3.654,656,3.654]],["t/398",[1,1.299,8,0.62,41,0.816,156,2.567,157,1.967,168,4.022,231,3.751,264,2.838,283,3.535,292,1.356,312,3.535,363,1.121,368,2.227,512,3.751,535,5.886,544,1.724,575,1.587,593,2.583,639,4.022,657,3.751,658,3.535,659,4.936,660,4.936,661,4.936,662,4.936,663,4.936,664,4.385,665,7.478,666,2.946,667,3.201,668,4.936,669,4.936,670,4.936,671,4.936,672,4.936,673,4.936,674,4.936,675,4.936,676,4.936,677,4.936,678,4.936]],["t/401",[1,0.622,8,0.642,15,2.185,16,0.749,41,0.797,43,1.6,66,1.062,77,0.979,157,2.496,160,1.36,202,1.404,215,2.817,217,1.6,218,1.553,228,2.271,229,1.97,236,2.817,242,1.892,244,1.36,267,2.155,294,0.928,295,2.4,300,2.996,306,3.785,336,1.702,337,1.265,340,2.185,354,2.817,395,1.404,409,3.128,410,4.437,423,2.018,439,3.931,443,2.379,457,2.271,550,2.584,602,5.316,679,3.171,680,5.837,681,3.171,682,2.817,683,4.285,684,3.171,685,7.918,686,4.823,687,8.111,688,3.171,689,4.285,690,2.817]],["t/403",[8,0.63,15,2.837,21,2.553,66,1.921,98,5.094,244,2.459,292,2.327,300,4.539,363,0.86,395,1.234,443,2.091,515,4.358,548,4.358,575,1.844,641,5.094,648,3.718,691,5.733,692,5.733,693,5.733]],["t/405",[1,0.61,8,0.62,11,2.535,16,1.363,24,1.812,41,0.514,57,6.992,63,1.727,66,1.932,75,2.364,77,0.961,99,6.517,104,5.575,110,2.228,135,1.932,136,2.747,155,2.535,170,4.223,182,2.192,192,1.234,216,2.017,269,0.986,278,3.873,283,2.228,292,1.306,294,1.11,296,3.443,306,3.082,336,2.552,346,2.407,347,5.738,363,1.043,365,1.213,366,0.735,369,1,376,2.535,412,2.228,423,1.301,544,1.087,564,1.67,575,1.855,650,1.856,666,2.837,690,2.763,694,4.753,695,3.921,696,7.336,697,3.111,698,3.111,699,6.458,700,2.763,701,2.228,702,5.769,703,4.753,704,3.111,705,3.111,706,3.111,707,3.111,708,3.111,709,3.111,710,3.111,711,2.763,712,2.763,713,3.111,714,3.111,715,3.111]],["t/407",[1,1.055,8,0.614,21,1.282,24,2.427,41,1.053,47,2.495,63,3.535,66,1.229,93,1.282,154,1.431,182,2.007,214,2.629,216,2.38,223,2.951,264,3.093,269,1.548,363,1.24,365,1.431,366,1.271,368,2.874,369,1.73,383,2.629,392,2.991,394,2.991,412,2.629,476,3.261,511,1.368,515,2.789,516,3.261,533,1.97,536,2.11,544,1.879,557,2.38,569,4.78,593,2.098,594,2.11,606,1.338,637,3.261,689,3.261,695,5.075,716,3.261,717,3.67,718,3.67,719,3.67,720,3.67,721,3.67,722,3.67,723,3.67,724,3.67,725,3.67,726,3.67,727,5.38,728,3.261,729,3.67,730,4.089,731,2.789,732,5.38,733,3.67,734,2.28,735,3.67,736,3.67,737,2.789,738,3.67]],["t/410",[8,0.409,37,3.11,41,1.012,49,5.787,51,4.383,70,5.453,305,4.988,412,4.383,415,5.437,586,6.205,587,6.205,588,5.437,589,6.764,695,4.16,716,5.437,739,6.12,740,6.12,741,6.12,742,6.12,743,4.652,744,4.383,745,6.12]],["t/412",[1,1.7,8,0.509,37,3.386,66,2.551,140,2.451,244,2.625,336,4.088,489,4.652,592,2.717,746,6.12,747,6.12,748,7.614,749,7.614]],["t/414",[1,1.277,8,0.617,37,2.66,140,1.789,182,2.492,363,1.186,364,2.66,366,1.538,369,2.094,564,3.496,750,3.875,751,4.222]],["t/416",[1,1.277,8,0.617,37,2.66,140,1.789,182,2.492,363,1.186,364,2.66,366,1.538,369,2.094,564,3.496,752,3.99,753,6.511]],["t/418",[8,0.644,47,3.417,93,1.756,116,3.723,157,2.391,160,2.876,182,2.537,183,3.6,237,3.6,294,0.967,295,2.869,402,4.097,514,4.466,530,4.466,591,3.6,754,4.559,755,4.166,756,3.601,757,2.113,758,3.6]],["t/421",[1,0.999,8,0.651,16,0.806,37,2.081,41,0.564,66,1.142,93,1.191,136,2.426,140,1.4,157,2.009,160,2.902,161,2.035,182,2.729,244,2.185,295,2.83,300,2.118,363,0.764,364,2.081,365,1.986,366,1.204,369,1.638,443,2.224,552,3.135,648,3.303,667,3.303,754,4.599,756,2.735,759,3.409,760,5.094,761,3.409,762,3.409,763,2.035]],["t/423",[1,0.945,8,0.645,37,1.969,41,0.797,66,1.614,140,1.324,157,1.936,160,3.168,161,2.876,182,2.686,244,2.795,294,0.927,295,2.23,363,0.977,364,1.969,365,1.879,366,1.139,369,1.55,409,3.125,443,2.377,552,2.233,575,1.55,754,3.276,756,2.587,763,2.876,764,4.227,765,4.819]],["t/425",[1,0.85,8,0.625,21,2.117,37,1.77,41,1.002,66,1.451,82,2.945,90,2.734,133,3.293,135,2.691,140,1.191,156,4.141,157,1.799,160,1.858,161,2.586,182,1.909,285,4.118,287,2.945,336,2.326,363,0.908,364,1.77,365,1.689,366,1.024,369,1.393,380,4.605,404,4.605,450,4.605,457,4.34,575,1.393,597,1.813,622,2.968,744,3.103,754,2.945,757,2.202,766,3.531,767,3.849,768,4.938,769,4.34,770,1.955,771,2.123,772,2.008,773,3.849,774,4.333,775,3.103,776,3.103,777,3.103,778,3.103]],["t/427",[1,0.807,8,0.634,21,2.041,37,1.681,41,0.68,82,2.797,133,3.127,135,2.555,140,1.13,156,4.575,157,1.735,160,2.913,161,2.456,182,1.841,244,2.505,285,3.971,287,3.971,336,3.137,363,0.876,364,1.681,365,1.604,366,0.972,369,1.323,409,2.668,557,2.668,575,1.323,597,1.722,744,2.947,754,2.797,757,2.33,764,3.788,766,3.353,769,4.184,770,1.857,771,2.016,772,1.907,773,3.655,775,4.184,776,4.184,777,4.184,778,4.184,779,3.655,780,4.114]],["t/429",[1,0.692,8,0.629,16,1.234,21,2.174,33,1.68,37,1.441,41,0.864,62,2.636,82,2.398,90,1.592,93,1.232,133,2.681,135,2.191,140,0.969,156,3.82,157,1.551,160,2.669,161,2.105,182,1.646,207,2.875,213,3.388,244,1.513,285,2.398,287,2.398,294,1.005,320,2.681,336,3.341,350,5.071,363,0.783,364,1.441,365,1.375,366,0.833,369,1.134,386,2.875,409,2.287,443,1.286,575,1.134,597,1.476,626,2.875,667,2.287,701,2.526,744,2.526,754,2.398,756,1.894,757,2.424,758,4.457,764,2.287,766,2.875,769,2.526,770,1.592,771,1.728,775,2.526,776,2.526,777,2.526,778,2.526,779,3.134,781,6.269,782,3.527,783,3.527,784,3.527,785,2.191,786,6.223,787,2.875,788,3.527,789,3.527,790,5.225]],["t/431",[41,1.16,90,3.165,380,5.332,404,5.332,450,5.332,457,5.024,622,3.437,757,2.211,767,6.232,768,5.717,791,6.232]],["t/433",[37,2.833,41,1.474,62,2.667,93,1.847,167,3.284,183,5.542,503,5.223,586,4.309,728,4.698,756,4.699,757,2.185,758,4.967,764,4.497,792,5.288,793,5.288,794,5.288,795,5.032,796,6.875,797,5.288,798,4.698]],["t/435",[1,0.727,8,0.633,24,0.866,41,0.613,46,1.726,61,1.181,63,3.008,75,4.118,91,1.473,92,2.017,111,2.017,112,1.851,117,2.017,121,2.017,135,1.41,143,2.017,157,0.674,182,1.707,192,0.589,203,1.626,219,1.261,223,1.717,244,2.013,259,0.601,264,2.7,269,0.471,292,1.018,295,1.606,312,2.654,340,0.761,342,1.851,358,3.826,363,1.093,365,1.445,366,1.109,368,1.672,369,1.192,375,1.851,376,3.02,395,1.166,491,4.814,498,1.473,501,0.557,509,3.02,527,2.131,529,1.574,533,1.219,534,4.171,536,2.7,537,2.017,538,3.293,545,3.293,546,2.017,547,2.017,548,2.817,550,3.826,551,3.293,552,1.717,553,2.017,554,5.304,555,2.017,556,2.017,557,1.473,558,3.293,575,0.73,599,0.612,634,2.017,639,1.851,658,2.654,701,2.654,711,2.017,734,2.916,799,3.706,800,2.271,801,2.271,802,3.706,803,3.706,804,2.017,805,2.271,806,3.706,807,2.271,808,2.271,809,4.695,810,4.171,811,5.418,812,5.97,813,5.418,814,3.706,815,2.271,816,2.271,817,2.271,818,3.706,819,2.271,820,4.695,821,2.271,822,3.706,823,2.271,824,2.271,825,2.271,826,2.271,827,2.271,828,2.271,829,2.271,830,2.271,831,2.271,832,2.271,833,2.271]],["t/437",[8,0.477,33,3.399,90,3.221,93,2.493,217,3.601,218,3.497,294,1.608,591,5.112]],["t/439",[1,1.426,8,0.633,17,2.032,140,1.564,259,1.506,269,1.509,363,1.202,365,2.836,395,1.566,501,1.784,529,1.272,544,1.989,592,2.032,599,1.535,834,5.693,835,1.724,836,1.724,837,6.463,838,3.692]],["t/441",[1,1.299,8,0.637,61,3.445,140,1.356,182,2.088,259,1.305,264,3.809,269,1.374,363,1.121,365,2.583,366,1.565,368,2.989,369,2.13,395,1.426,501,1.625,529,1.103,544,1.724,592,1.761,593,2.583,594,3.809,599,1.33,734,4.115,750,2.418,835,1.495,836,1.495,838,3.201,839,3.535]],["t/443",[1,1.365,8,0.64,140,1.462,259,1.408,269,1.444,363,1.164,365,2.715,395,1.499,501,1.708,529,1.189,544,1.859,592,1.899,599,1.435,737,5.293,750,2.607,835,1.612,836,1.612,838,3.451,839,3.812,840,4.337,841,4.337,842,5.675,843,4.337]],["t/445",[1,1.239,8,0.642,33,2.191,140,1.264,224,3.507,259,1.217,269,1.31,339,3.507,363,1.081,365,2.463,395,1.36,501,1.549,529,1.028,544,1.607,592,1.642,599,1.24,750,2.254,835,1.393,836,1.393,838,2.984,839,3.296,844,3.75,845,5.531,846,6.327,847,5.148,848,3.77,849,3.77,850,5.148,851,3.75]],["t/447",[1,1.262,8,0.631,15,1.252,16,0.883,17,1.334,24,1.425,41,0.901,140,1.027,182,1.718,192,0.97,214,2.677,224,4.175,259,1.442,269,1.335,363,1.061,365,2.126,383,2.677,395,1.619,446,3.905,501,1.735,529,1.438,544,1.306,592,1.334,593,2.126,599,1.47,750,1.831,835,1.132,836,1.132,838,2.424,839,2.677,845,2.54,848,2.231,849,3.254,852,4.809,853,4.809,854,3.046,855,3.046,856,3.046,857,4.443,858,4.443,859,4.443,860,3.046,861,4.443,862,4.443,863,5.452,864,4.443,865,3.046,866,1.11]],["t/449",[8,0.556,36,3.999,167,3.83,169,4.417,198,4.687,224,3.423,261,4.417,343,4.417,352,4.687,743,4.687,771,3.747,848,4.565,849,3.68,852,5.2,853,5.2,867,5.025,868,5.025,869,5.025,870,5.025,871,5.025,872,5.025]],["t/451",[1,1.045,8,0.641,16,1.646,24,1.38,63,2.957,157,1.075,182,1.141,192,1.64,264,3.063,269,1.105,292,2.134,295,2.162,363,1.204,365,2.077,395,1.773,439,5.15,498,3.454,501,1.821,544,1.861,552,2.928,695,3.621,730,5.296,731,4.049,734,3.309,750,1.774,838,3.454,839,2.594,866,1.876,873,2.951,874,2.951,875,4.341,876,2.951,877,2.951,878,2.951,879,4.341]],["t/454",[750,3.725,880,3.523]],["t/456",[8,0.527,33,2.62,37,2.247,93,1.922,202,2.072,212,4.483,213,3.567,217,4.357,218,4.086,237,3.94,267,3.739,294,1.369,334,1.882,410,4.181,423,2.302,426,4.888,443,2.006,445,4.181,455,4.483,496,4.888,497,5.799,587,4.483,770,2.482,771,2.695,772,2.549,881,2.549,882,5.501,883,5.501,884,5.501,885,5.501,886,4.888]],["t/458",[8,0.477,33,3.399,90,3.221,93,2.493,217,3.601,218,3.497,294,1.608,591,5.112]],["t/460",[1,1.294,8,0.634,16,1.159,17,1.751,41,0.811,140,1.348,192,1.273,223,3.057,259,1.298,269,1.546,294,1.27,363,1.195,395,1.605,471,2.634,501,1.618,529,1.096,544,1.714,592,1.751,599,1.322,622,2.403,624,3.181,627,2.723,628,2.723,630,3.335,835,1.486,836,1.486,866,1.457,887,4.906,888,6.598,889,4.286,890,3.514]],["t/462",[1,1.171,8,0.638,16,1.002,41,0.701,61,3.105,140,1.166,182,1.881,192,1.101,223,2.767,259,1.122,264,3.433,269,1.433,294,1.149,363,1.124,366,1.411,368,2.694,369,1.92,395,1.487,471,2.278,501,1.464,529,0.948,533,3.205,544,1.482,592,1.514,593,2.328,594,3.433,599,1.144,622,2.078,624,2.751,627,2.355,628,2.355,630,2.884,734,3.708,752,2.14,835,1.285,836,1.285,866,1.26,889,3.972,890,3.039,891,3.039]],["t/464",[1,1.224,8,0.641,16,1.069,41,0.748,140,1.243,192,1.174,223,2.894,259,1.197,269,1.483,294,1.202,363,1.156,395,1.539,471,2.429,501,1.532,529,1.011,533,3.353,544,1.581,592,1.615,599,1.22,622,2.217,624,2.934,627,2.512,628,2.512,630,3.076,737,4.746,752,2.283,835,1.37,836,1.37,840,3.688,841,3.688,842,5.089,843,3.688,866,1.344,889,4.111,890,3.241,891,3.241]],["t/466",[1,1.121,8,0.642,16,0.944,33,1.902,41,0.66,140,1.097,192,1.036,223,2.65,224,3.175,259,1.056,269,1.386,294,1.101,339,3.175,363,1.094,395,1.438,471,2.144,501,1.403,529,0.892,533,3.071,544,1.395,592,1.425,599,1.077,622,1.956,624,2.59,627,2.217,628,2.217,630,2.714,752,2.015,835,1.209,836,1.209,844,3.254,845,5.248,846,5.946,847,4.661,848,3.413,849,3.413,850,4.661,851,3.254,866,1.186,889,3.842,890,2.86,891,2.86]],["t/468",[1,1.178,8,0.633,15,1.114,16,1.181,17,1.187,24,1.268,41,0.993,140,0.914,182,1.576,192,1.298,214,2.382,223,2.317,224,3.977,259,1.323,269,1.386,294,0.962,363,1.074,383,2.382,395,1.62,446,3.582,471,1.786,501,1.639,529,1.343,533,2.685,543,4.443,544,1.162,592,1.187,593,1.95,599,1.348,622,1.629,624,2.157,627,1.846,628,1.846,630,2.261,752,1.678,835,1.007,836,1.007,845,2.261,848,1.985,849,2.985,852,4.543,853,4.543,854,2.711,855,2.711,856,2.711,857,4.075,858,4.075,859,4.075,860,2.711,861,4.075,862,4.075,864,4.075,865,2.711,866,1.485,889,3.455,890,2.382,891,2.382]],["t/470",[8,0.556,36,3.999,167,3.83,169,4.417,198,4.687,224,3.423,261,4.417,343,4.417,352,4.687,743,4.687,771,3.747,848,4.565,849,3.68,852,5.2,853,5.2,867,5.025,868,5.025,869,5.025,870,5.025,871,5.025,872,5.025]],["t/472",[1,1.087,8,0.638,16,1.69,24,1.458,63,3.078,157,1.136,182,1.205,192,1.692,223,2.569,264,3.188,292,2.175,295,2.231,363,1.224,395,1.704,498,3.595,501,1.6,533,2.977,544,1.937,552,3.022,695,3.769,730,5.436,731,4.214,734,3.444,752,1.93,866,1.936,873,3.117,874,3.117,875,4.518,876,3.117,877,3.117,878,3.117,879,4.518,891,2.739,892,6.522]],["t/475",[66,2.412,750,4.114,752,4.236,795,4.14,880,3.891]],["t/478",[8,0.628,15,2.767,16,0.939,17,1.418,21,2.328,41,0.657,77,1.227,113,1.623,154,1.549,166,2.572,192,1.031,202,1.659,259,1.051,269,0.824,292,1.831,294,0.765,334,1.359,337,1.586,346,1.481,363,1.155,395,1.434,422,2.328,423,1.663,501,1.398,511,1.481,529,0.888,575,1.833,595,2.506,596,3.06,597,2.385,598,2.222,599,1.071,606,1.449,757,1.252,770,2.572,835,1.203,836,1.203,866,1.18,881,1.842,893,3.02,894,3.06,895,2.641,896,4.082,897,4.332,898,2.792,899,1.663,900,1.663,901,1.586,902,1.549]],["t/480",[8,0.637,15,2.639,16,0.891,21,2.26,41,0.624,66,1.839,77,1.165,113,1.541,154,1.471,166,2.477,192,0.979,202,1.598,259,0.998,269,0.782,292,1.778,294,0.726,334,1.29,337,1.505,346,1.406,363,1.132,395,1.393,422,2.242,423,1.578,449,2.947,501,1.346,511,1.406,529,0.843,575,2.285,595,2.414,596,2.947,597,2.296,598,2.14,599,1.017,606,1.375,757,1.189,770,2.477,835,1.142,836,1.142,866,1.12,881,1.748,894,2.947,895,2.543,896,3.931,898,2.689,899,1.578,900,1.578,901,1.505,902,1.471,903,2.343,904,1.578]],["t/482",[8,0.638,15,2.712,16,0.879,21,2.242,41,0.615,66,1.82,77,1.149,113,1.52,154,1.451,166,2.452,192,0.966,202,1.582,259,0.984,269,0.771,292,1.764,294,0.716,334,1.273,337,1.484,346,1.387,363,1.126,395,1.382,422,2.22,423,1.557,449,2.917,501,1.333,511,1.387,529,0.831,575,2.27,595,2.389,596,2.917,597,2.274,598,2.118,599,1.003,606,1.357,757,1.172,770,2.452,835,1.127,836,1.127,866,1.105,881,1.724,894,2.917,895,2.518,896,3.892,898,2.662,899,1.557,900,1.557,901,1.484,902,1.451,903,2.311,904,1.557]],["t/485",[757,2.396,880,3.523]],["t/487",[880,3.523,904,3.181]],["t/489",[8,0.539,33,3.203,90,3.035,91,4.361,93,2.817,217,3.393,218,3.295,306,4.361,443,2.453,602,5.481,770,3.035,771,3.295,772,3.117,886,5.975]],["t/492",[8,0.63,15,2.562,16,0.921,17,1.391,21,2.303,41,0.644,77,1.204,113,1.592,154,1.52,157,1.669,192,1.012,202,1.637,259,1.031,269,0.808,292,1.811,294,0.75,334,1.333,336,3.018,337,1.555,340,1.883,346,1.453,363,1.147,366,1.328,395,1.419,422,2.296,423,1.631,501,1.379,511,1.453,529,0.871,575,1.807,595,2.472,597,2.352,598,2.191,599,1.051,606,1.421,757,1.228,771,2.754,835,1.18,836,1.18,866,1.157,881,1.806,893,2.963,895,2.605,897,4.272,898,2.754,899,1.631,900,1.631,901,1.555,902,1.52,905,3.018,906,4.026]],["t/494",[8,0.638,15,2.36,16,0.875,21,2.236,41,0.612,66,1.814,77,1.144,113,1.513,154,1.444,157,1.608,192,0.961,202,1.577,259,0.98,269,0.768,292,1.759,294,0.713,334,1.267,336,2.908,337,1.478,340,1.814,346,1.38,363,1.124,366,1.28,395,1.378,422,2.212,423,1.55,449,2.908,501,1.328,511,1.38,529,0.827,575,2.265,595,2.381,597,2.266,598,2.111,599,0.998,606,1.35,757,1.167,771,2.653,835,1.121,836,1.121,866,1.1,881,1.716,895,2.509,898,2.653,899,1.55,900,1.55,901,1.478,902,1.444,903,2.3,904,1.55,905,2.908,906,3.879]],["t/496",[8,0.639,15,2.497,16,0.863,21,2.219,41,0.604,66,1.796,77,1.129,113,1.493,154,1.425,157,1.592,192,0.948,202,1.561,259,0.966,269,0.758,292,1.745,294,0.703,334,1.25,336,2.879,337,1.458,340,1.796,346,1.362,363,1.117,366,1.267,395,1.367,422,2.19,423,1.529,449,2.879,501,1.315,511,1.362,529,0.816,575,2.25,595,2.358,597,2.244,598,2.091,599,0.985,606,1.332,757,1.151,771,2.627,835,1.106,836,1.106,866,1.085,881,1.693,895,2.485,898,2.627,899,1.529,900,1.529,901,1.458,902,1.425,903,2.269,904,1.529,905,2.879,906,3.84]],["t/499",[757,2.396,880,3.523]],["t/501",[880,3.523,904,3.181]],["t/504",[8,0.625,15,2.611,16,0.967,17,1.461,21,2.366,41,0.677,77,1.264,113,1.672,154,1.596,157,1.728,166,2.627,192,1.062,202,1.695,259,1.083,269,0.849,292,1.861,294,0.788,334,1.4,337,1.633,340,1.95,346,1.526,363,1.169,366,1.375,395,1.458,422,2.378,423,1.713,501,1.428,511,1.526,529,0.915,575,1.872,597,2.436,598,2.27,599,1.104,606,1.493,757,1.29,772,2.697,835,1.24,836,1.24,866,1.215,881,1.897,893,3.111,897,4.424,898,2.852,899,1.713,900,1.713,901,1.633,902,1.596,905,3.125]],["t/506",[8,0.636,15,2.412,16,0.917,21,2.296,41,0.641,66,1.876,77,1.198,113,1.585,154,1.513,157,1.663,166,2.528,192,1.007,202,1.631,259,1.026,269,0.805,292,1.806,294,0.747,334,1.327,337,1.548,340,1.876,346,1.446,363,1.145,366,1.323,395,1.415,422,2.288,423,1.623,449,3.007,501,1.374,511,1.446,529,0.867,575,2.315,597,2.344,598,2.184,599,1.046,606,1.415,757,1.223,772,2.596,835,1.175,836,1.175,866,1.152,881,1.798,898,2.744,899,1.623,900,1.623,901,1.548,902,1.513,903,2.41,904,1.623,905,3.007]],["t/508",[8,0.638,15,2.543,16,0.904,21,2.278,41,0.632,66,1.857,77,1.181,113,1.562,154,1.491,157,1.646,166,2.502,192,0.993,202,1.614,259,1.012,269,0.793,292,1.792,294,0.736,334,1.308,337,1.526,340,1.857,346,1.426,363,1.138,366,1.31,395,1.404,422,2.265,423,1.6,449,2.977,501,1.36,511,1.426,529,0.855,575,2.3,597,2.32,598,2.162,599,1.031,606,1.395,757,1.205,772,2.569,835,1.158,836,1.158,866,1.136,881,1.772,898,2.716,899,1.6,900,1.6,901,1.526,902,1.491,903,2.376,904,1.6,905,2.977]],["t/511",[757,2.396,880,3.523]],["t/513",[880,3.523,904,3.181]],["t/516",[8,0.636,15,2.601,16,1.366,17,1.446,41,0.67,77,1.252,113,1.656,154,1.58,166,2.608,192,1.052,202,1.18,259,1.072,269,0.84,292,1.851,294,0.78,295,2.656,334,1.386,340,1.936,346,1.511,363,1.164,366,1.366,395,1.45,422,2.361,443,2.108,501,1.418,511,1.511,529,0.905,552,2.678,575,1.859,595,2.542,596,3.103,598,2.254,599,1.093,606,1.478,835,1.227,836,1.227,866,1.203,893,3.08,897,4.393,899,1.696,900,1.696,901,1.617,902,1.58]],["t/518",[8,0.642,15,2.401,16,1.314,41,0.635,66,1.864,77,1.187,113,1.57,154,1.498,166,2.51,192,0.997,202,1.119,259,1.016,269,0.797,292,1.797,294,0.74,295,2.602,334,1.314,340,1.864,346,1.432,363,1.14,366,1.314,395,1.407,422,2.273,443,2.029,449,2.987,501,1.365,511,1.432,529,0.859,552,2.578,575,2.305,595,2.446,596,2.987,598,2.169,599,1.036,606,1.401,835,1.164,836,1.164,866,1.141,899,1.608,900,1.608,901,1.533,902,1.498,903,2.387,904,1.608]],["t/520",[8,0.643,15,2.534,16,1.301,41,0.626,66,1.845,77,1.17,113,1.548,154,1.477,166,2.485,192,0.983,202,1.103,259,1.002,269,0.786,292,1.782,294,0.729,295,2.587,334,1.296,340,1.845,346,1.413,363,1.134,366,1.301,395,1.396,422,2.25,443,2.008,449,2.957,501,1.351,511,1.413,529,0.847,552,2.552,575,2.29,595,2.422,596,2.957,598,2.147,599,1.022,606,1.382,835,1.147,836,1.147,866,1.125,899,1.586,900,1.586,901,1.512,902,1.477,903,2.354,904,1.586]],["t/523",[880,3.523,904,3.181]],["t/525",[8,0.477,33,3.399,90,3.221,93,2.493,217,3.601,218,3.497,294,1.608,591,5.112]],["t/527",[1,1.234,8,0.637,16,1.081,17,2.246,24,1.744,41,0.756,140,1.257,192,1.188,259,1.21,269,1.491,294,1.211,363,1.161,395,1.548,471,2.457,501,1.543,529,1.022,544,1.598,592,1.633,599,1.233,622,2.242,627,2.54,628,2.54,835,1.386,836,1.386,837,5.591,866,1.359,889,4.135,907,3.11,908,4.576,909,3.909,910,3.909,911,4.277,912,4.277,913,4.507]],["t/529",[1,1.121,8,0.642,16,0.944,17,1.425,24,1.522,41,0.66,61,2.974,140,1.097,182,1.802,192,1.036,242,2.383,259,1.056,264,3.288,269,1.386,294,1.101,363,1.094,366,1.351,368,2.581,369,1.839,395,1.438,471,2.144,501,1.403,529,0.892,544,1.395,592,1.425,593,2.23,594,3.288,599,1.077,622,1.956,627,2.217,628,2.217,734,3.552,752,2.015,835,1.209,836,1.209,866,1.186,889,3.842,907,2.714,909,3.552,910,3.552,911,3.887,912,3.887,913,4.096]],["t/531",[1,1.171,8,0.644,16,1.002,17,1.514,24,1.617,41,0.701,140,1.166,192,1.101,242,2.532,259,1.122,269,1.433,294,1.149,363,1.124,395,1.487,471,2.278,501,1.464,529,0.948,544,1.482,592,1.514,599,1.144,622,2.078,627,2.355,628,2.355,737,4.538,752,2.14,835,1.285,836,1.285,840,3.458,841,3.458,842,4.865,843,3.458,866,1.26,889,3.972,907,2.884,909,3.708,910,3.708,911,4.058,912,4.058,913,4.276]],["t/533",[1,1.076,8,0.644,16,0.891,17,1.346,24,1.438,33,1.796,41,0.624,140,1.036,192,0.979,224,3.047,242,2.251,259,0.998,269,1.342,294,1.056,339,3.047,363,1.065,395,1.393,471,2.025,501,1.346,529,0.843,544,1.318,592,1.346,599,1.017,622,1.848,627,2.094,628,2.094,752,1.903,835,1.142,836,1.142,844,3.074,845,5.132,846,5.79,847,4.473,848,3.276,849,3.276,850,4.473,851,3.074,866,1.12,889,3.72,907,2.564,909,3.409,910,3.409,911,3.731,912,3.731,913,3.931]],["t/535",[1,1.145,8,0.637,15,1.062,16,1.14,17,1.721,24,1.838,41,0.965,140,0.871,182,1.52,192,1.252,214,2.271,224,3.895,242,1.892,259,1.276,269,1.353,294,0.928,363,1.052,383,2.271,395,1.591,446,3.455,471,1.702,501,1.6,529,1.304,544,1.108,592,1.132,593,1.881,599,1.3,622,1.553,627,1.76,628,1.76,752,1.6,835,0.96,836,0.96,845,2.155,848,1.892,849,2.879,852,4.434,853,4.434,854,2.584,855,2.584,856,2.584,857,3.931,858,3.931,859,3.931,860,2.584,861,3.931,862,3.931,864,3.931,865,2.584,866,1.432,889,3.356,907,2.155,909,2.996,910,2.996,911,3.279,912,3.279,913,3.455,914,4.823]],["t/537",[8,0.556,36,3.999,167,3.83,169,4.417,198,4.687,224,3.423,261,4.417,343,4.417,352,4.687,743,4.687,771,3.747,848,4.565,849,3.68,852,5.2,853,5.2,867,5.025,868,5.025,869,5.025,870,5.025,871,5.025,872,5.025]],["t/539",[1,1.018,8,0.641,16,1.619,17,1.248,24,1.333,63,2.882,157,1.038,182,1.102,192,1.607,242,2.087,264,2.985,292,2.107,295,2.118,363,1.249,395,1.651,498,3.367,501,1.519,544,1.814,552,2.869,695,3.529,730,5.207,731,3.946,734,3.225,752,1.764,866,1.838,873,2.85,874,2.85,875,4.231,876,2.85,877,2.85,878,2.85,879,4.231,907,2.377,909,3.225,910,3.225,911,3.529,912,3.529,915,5.192,916,5.192,917,6.192]],["t/542",[66,2.412,750,4.114,752,4.236,795,4.14,880,3.891]],["t/544",[93,2.584,202,2.154,334,2.53,473,4.796,918,5.622]],["t/546",[8,0.619,16,1.024,17,1.546,21,2.441,41,0.716,77,1.338,113,1.77,154,1.689,157,1.799,166,2.734,192,1.124,202,1.262,259,1.146,269,0.899,292,1.92,294,1.166,323,3.103,334,1.482,337,1.729,340,2.03,346,1.615,363,1.047,366,1.432,395,1.504,422,2.475,423,1.813,501,1.486,511,1.615,529,0.968,575,1.948,597,2.535,598,2.362,599,1.168,606,1.58,757,1.365,772,2.808,835,1.312,836,1.312,866,1.286,881,2.008,898,2.968,899,1.813,900,1.813,901,1.729,902,1.689,905,3.253,919,4.605]],["t/548",[8,0.633,16,0.962,21,2.36,41,0.673,66,1.943,77,1.258,113,1.664,154,1.588,157,1.722,166,2.617,192,1.057,202,1.186,259,1.077,269,0.845,292,1.856,294,1.116,296,3.462,334,1.393,337,1.625,340,1.943,346,1.518,363,1.013,366,1.37,395,1.454,422,2.369,423,1.704,501,1.423,511,1.518,529,0.91,575,2.367,597,2.427,598,2.262,599,1.098,606,1.485,757,1.284,772,2.688,835,1.233,836,1.233,866,1.209,881,1.887,898,2.842,899,1.704,900,1.704,901,1.625,902,1.588,904,1.704,905,3.114,920,2.917]],["t/551",[757,2.396,880,3.523]],["t/553",[880,3.523,904,3.181]],["t/555",[93,2.584,202,2.154,334,2.53,473,4.796,918,5.622]],["t/557",[8,0.61,15,2.015,16,1.013,17,1.53,21,2.427,41,0.709,77,1.324,113,1.751,154,1.672,166,2.714,192,1.113,202,1.248,259,1.134,269,0.889,292,1.909,294,1.157,323,3.071,334,1.466,337,1.711,346,1.598,363,1.041,395,1.495,422,2.457,423,1.794,501,1.475,511,1.598,529,0.958,575,1.934,595,2.645,596,3.229,597,2.517,598,2.345,599,1.156,606,1.563,757,1.351,770,2.714,835,1.298,836,1.298,866,1.273,881,1.987,894,3.229,895,2.787,896,4.308,898,2.946,899,1.794,900,1.794,901,1.711,902,1.672,919,4.571]],["t/559",[8,0.629,15,1.929,16,0.953,21,2.347,41,0.667,66,1.929,77,1.246,113,1.647,154,1.572,166,2.599,192,1.047,202,1.174,259,1.067,269,0.836,292,1.846,294,1.108,296,3.438,334,1.379,337,1.609,346,1.503,363,1.007,395,1.446,422,2.353,423,1.687,501,1.413,511,1.503,529,0.901,575,2.356,595,2.533,596,3.092,597,2.41,598,2.246,599,1.087,606,1.471,757,1.271,770,2.599,835,1.221,836,1.221,866,1.197,881,1.869,894,3.092,895,2.669,896,4.125,898,2.822,899,1.687,900,1.687,901,1.609,902,1.572,904,1.687,920,2.888]],["t/562",[757,2.396,880,3.523]],["t/564",[880,3.523,904,3.181]],["t/566",[1,0.695,8,0.633,21,2.179,24,1.35,41,0.586,51,2.537,61,1.842,77,1.094,136,2.496,138,2.887,160,1.519,272,2.887,273,2.887,274,2.887,275,2.887,276,2.887,277,2.887,283,3.754,292,1.44,294,0.682,295,2.134,300,3.256,337,1.413,363,1.155,364,1.447,365,1.381,366,0.837,368,1.599,369,1.139,395,1.343,419,2.887,443,1.292,460,6.126,544,1.238,557,2.297,575,1.685,593,1.381,657,2.693,658,2.537,667,2.297,770,1.599,771,1.736,772,1.642,804,3.147,921,3.543,922,3.147,923,3.147,924,3.543,925,3.147,926,3.147,927,3.147,928,3.147,929,3.147,930,3.147,931,3.543,932,3.147,933,3.147,934,3.147,935,3.543,936,3.543,937,3.543,938,3.147,939,3.147,940,3.543,941,3.543,942,3.543,943,3.543,944,3.543,945,5.242,946,3.543,947,3.543,948,3.543,949,3.543,950,3.543,951,3.543,952,3.543,953,3.543]],["t/568",[93,2.584,202,2.154,334,2.53,473,4.796,918,5.622]],["t/570",[8,0.63,16,1.432,17,1.546,41,0.716,77,1.338,113,1.77,154,1.689,166,2.734,192,1.124,259,1.146,269,0.899,292,1.92,294,1.166,295,2.723,323,3.103,334,1.482,340,2.03,346,1.615,363,1.047,366,1.432,395,1.504,422,2.475,443,2.209,501,1.486,511,1.615,529,0.968,552,2.808,575,1.948,595,2.664,596,3.253,598,2.362,599,1.168,606,1.58,835,1.312,836,1.312,866,1.286,899,1.813,900,1.813,901,1.729,902,1.689,919,4.605]],["t/572",[8,0.639,16,1.37,41,0.673,66,1.943,77,1.258,113,1.664,154,1.588,166,2.617,192,1.057,259,1.077,269,0.845,292,1.856,294,1.116,295,2.661,296,3.462,334,1.393,340,1.943,346,1.518,363,1.013,366,1.37,395,1.454,422,2.369,443,2.115,501,1.423,511,1.518,529,0.91,552,2.688,575,2.367,595,2.551,596,3.114,598,2.262,599,1.098,606,1.485,835,1.233,836,1.233,866,1.209,899,1.704,900,1.704,901,1.625,902,1.588,904,1.704,920,2.917]],["t/574",[8,0.637,16,1.347,41,0.657,66,1.909,77,1.227,113,1.623,154,1.549,166,2.572,192,1.031,244,2.444,259,1.051,269,0.824,292,1.831,294,1.097,295,2.636,296,3.401,300,2.468,334,1.359,340,1.909,346,1.481,363,0.999,366,1.347,395,1.434,422,2.328,443,2.078,501,1.398,511,1.481,529,0.888,552,2.641,575,2.341,595,2.506,596,3.06,598,2.222,599,1.071,606,1.449,648,3.696,835,1.203,836,1.203,866,1.18,899,1.663,900,1.663,901,1.586,902,1.549,904,1.663,920,2.846]],["t/577",[880,3.523,904,3.181]],["t/579",[8,0.645,41,0.769,61,3.311,156,3.311,182,1.467,223,2.157,269,0.965,292,2.144,294,0.896,295,2.178,363,0.698,366,1.1,368,2.1,369,1.496,395,1.002,440,5.656,498,3.018,552,2.95,593,1.815,594,2.676,621,4.135,622,2.28,623,4.135,657,3.537,658,3.333,810,4.135,954,4.654,955,6.366,956,4.654,957,4.654,958,6.366,959,4.135,960,4.654,961,4.654,962,4.654]],["t/581",[1,0.605,8,0.642,14,2.516,24,1.177,41,0.51,51,2.211,77,0.953,91,2.002,136,2.734,138,3.851,144,3.851,156,2.458,160,1.324,167,3.566,182,0.973,221,2.211,231,3.592,269,0.64,272,2.516,273,2.516,274,2.516,275,2.516,276,3.851,277,4.679,292,1.298,294,0.594,333,2.516,340,1.034,363,1.096,364,1.261,368,1.393,392,2.516,394,3.851,466,2.743,544,1.078,557,2.002,657,2.346,658,2.211,664,2.743,922,2.743,923,2.743,925,2.743,926,2.743,927,2.743,928,2.743,929,2.743,930,2.743,932,2.743,933,2.743,934,4.198,938,2.743,939,2.743,963,3.087,964,3.087,965,3.087,966,4.726,967,3.087,968,4.726,969,3.087,970,3.087,971,3.087,972,3.087,973,3.087,974,3.087,975,3.087,976,3.087,977,3.087,978,3.087,979,3.087,980,4.726,981,3.087,982,3.087,983,3.087,984,3.087,985,3.087,986,3.087,987,3.087,988,4.726,989,3.087,990,4.726,991,3.087,992,3.087,993,3.087,994,3.087,995,3.087,996,3.087,997,3.087,998,3.087,999,3.087,1000,3.087]],["t/583",[1,0.434,8,0.646,15,0.742,16,0.858,17,0.791,19,1.152,41,0.366,43,1.118,62,2.693,116,1.23,131,1.376,136,2.542,140,0.609,156,1.152,157,0.658,160,0.95,202,0.645,213,1.437,239,1.684,285,1.506,287,1.506,294,0.426,295,1.242,337,0.884,339,2.562,340,2.239,346,2.196,363,0.949,364,0.905,366,1.757,368,1,369,0.712,396,1.805,443,1.324,479,1.376,489,1.684,503,2.168,527,1.274,529,1.559,531,1.376,536,2.088,564,1.189,592,0.791,593,0.864,650,1.322,666,3.99,667,1.437,701,1.587,750,1.779,751,1.437,755,1.376,756,2.478,757,1.454,758,1.587,763,2.168,769,1.587,770,2.409,772,1.683,775,1.587,776,1.587,777,1.587,778,1.587,781,4.351,785,3.316,787,1.805,795,2.088,894,1.189,895,1.683,1001,1.437,1002,1.437,1003,1.437,1004,1.968,1005,1.968,1006,1.968,1007,2.469,1008,1.437,1009,2.469,1010,1.437,1011,1.437,1012,1.437,1013,1.437,1014,1.506,1015,2.355,1016,2.355,1017,2.355,1018,1.437,1019,1.437,1020,4.743,1021,1.437,1022,3.227,1023,1.968,1024,1.968,1025,1.968,1026,1.968,1027,1.968,1028,1.968,1029,1.968,1030,1.437,1031,1.437,1032,1.684,1033,1.437,1034,1.684,1035,1.968]],["t/585",[93,2.584,202,2.154,334,2.53,473,4.796,918,5.622]],["t/587",[8,0.621,16,0.982,17,1.483,21,2.386,41,0.687,77,1.284,113,1.698,154,1.62,157,1.747,192,1.079,202,1.21,259,1.099,269,0.862,292,1.877,294,1.132,323,2.977,334,1.422,336,3.159,337,1.658,340,1.971,346,1.549,363,1.024,366,1.39,395,1.47,422,2.404,423,1.739,501,1.443,511,1.549,529,0.929,575,1.892,595,2.588,597,2.462,598,2.294,599,1.12,606,1.516,757,1.31,771,2.883,835,1.259,836,1.259,866,1.234,881,1.926,895,2.727,898,2.883,899,1.739,900,1.739,901,1.658,902,1.62,905,3.159,906,4.214,919,4.472]],["t/589",[8,0.634,16,0.925,21,2.309,41,0.647,66,1.889,77,1.21,113,1.6,154,1.527,157,1.675,192,1.017,202,1.14,259,1.036,269,0.812,292,1.816,294,1.085,296,3.366,334,1.34,336,3.028,337,1.563,340,1.889,346,1.46,363,0.991,366,1.333,395,1.423,422,2.304,423,1.639,501,1.383,511,1.46,529,0.875,575,2.325,595,2.48,597,2.36,598,2.199,599,1.056,606,1.428,757,1.234,771,2.763,835,1.186,836,1.186,866,1.163,881,1.815,895,2.614,898,2.763,899,1.639,900,1.639,901,1.563,902,1.527,904,1.639,905,3.028,906,4.04,920,2.805]],["t/592",[757,2.396,880,3.523]],["t/594",[880,3.523,904,3.181]],["t/596",[1,0.533,8,0.646,15,0.91,17,0.97,19,1.413,41,0.449,43,1.371,62,2.159,116,1.508,131,1.688,136,2.861,140,0.747,157,0.807,160,2.576,202,0.791,244,1.165,294,0.523,295,0.929,339,1.508,340,2.521,363,0.9,364,1.11,366,1.873,368,1.226,369,0.874,443,1.561,479,2.658,503,2.554,527,1.562,529,1.551,531,1.688,536,1.562,564,1.459,592,0.97,593,1.059,650,1.622,666,4.335,750,2.096,751,1.762,755,1.688,756,2.842,757,0.856,763,2.554,764,1.762,770,2.71,772,1.259,785,2.658,795,2.461,894,1.459,895,1.983,905,2.298,1001,1.762,1002,1.762,1003,1.762,1007,1.847,1008,1.762,1009,1.847,1010,1.762,1011,1.762,1012,1.762,1013,1.762,1014,1.847,1015,2.775,1016,2.775,1017,2.775,1018,1.762,1019,1.762,1021,2.775,1030,1.762,1031,1.762,1032,2.065,1033,1.762,1034,2.065,1036,2.065,1037,2.414,1038,2.414,1039,2.414]],["t/598",[1,0.573,8,0.646,15,0.979,17,1.042,19,1.519,41,0.483,43,1.474,62,2.285,116,1.622,131,1.814,136,2.976,140,0.803,157,0.867,160,1.253,202,0.851,294,0.562,339,1.622,340,2.5,363,0.937,364,1.193,366,1.912,368,1.318,369,0.939,443,1.065,479,1.814,503,2.703,527,1.68,529,1.598,531,1.814,536,1.68,564,1.568,592,1.042,593,1.139,650,1.743,666,4.454,750,2.219,751,1.894,755,1.814,756,2.978,757,0.921,763,2.703,770,2.819,772,1.354,785,2.813,795,2.604,894,1.568,895,2.099,1001,1.894,1002,1.894,1003,1.894,1007,1.986,1008,1.894,1009,1.986,1010,1.894,1011,1.894,1012,1.894,1013,1.894,1014,1.986,1015,2.937,1016,2.937,1017,2.937,1018,1.894,1019,1.894,1021,1.894,1030,1.894,1031,1.894,1032,2.22,1033,1.894,1034,2.22,1036,2.22]],["t/600",[1,0.557,8,0.647,15,0.951,17,1.013,19,1.477,41,0.469,43,1.433,62,2.235,116,1.576,131,1.764,136,2.931,140,0.78,156,1.477,157,1.315,160,1.218,202,0.827,244,1.218,294,0.546,339,1.576,340,2.474,363,0.923,364,1.16,366,1.897,368,1.281,369,0.913,443,1.036,479,1.764,503,2.644,527,1.633,529,1.58,531,1.764,536,1.633,564,1.525,592,1.013,593,1.107,648,1.842,650,1.695,666,4.408,750,2.17,751,1.842,755,1.764,756,2.925,757,0.895,763,2.644,770,2.777,772,1.316,785,2.752,795,2.547,894,1.525,895,2.053,1001,1.842,1002,1.842,1003,1.842,1007,1.93,1008,1.842,1009,1.93,1010,1.842,1011,1.842,1012,1.842,1013,1.842,1014,1.93,1015,2.873,1016,2.873,1017,2.873,1018,1.842,1019,1.842,1021,1.842,1030,1.842,1031,1.842,1033,1.842,1036,2.158,1040,2.314,1041,2.314]],["t/602",[1,0.519,8,0.647,15,0.887,17,0.944,19,1.376,41,0.437,43,1.335,62,2.114,116,1.469,131,1.644,136,2.819,140,0.727,156,1.376,157,1.244,160,2.538,202,0.771,244,1.797,294,0.509,295,0.905,339,1.469,340,2.498,363,0.887,364,1.081,366,1.858,368,1.194,369,0.851,443,1.528,479,2.603,503,2.502,527,1.522,529,1.533,531,1.644,536,1.522,564,1.421,592,0.944,593,1.032,648,1.716,650,1.579,666,4.291,750,2.053,751,1.716,755,1.644,756,2.794,757,0.834,763,2.502,764,1.716,770,2.671,772,1.226,785,2.603,795,2.41,894,1.421,895,1.942,905,2.25,1001,1.716,1002,1.716,1003,1.716,1007,1.799,1008,1.716,1009,1.799,1010,1.716,1011,1.716,1012,1.716,1013,1.716,1014,1.799,1015,2.718,1016,2.718,1017,2.718,1018,1.716,1019,1.716,1021,2.718,1030,1.716,1031,1.716,1033,1.716,1036,2.011,1037,2.351,1038,2.351,1039,2.351,1040,2.157,1041,2.157]],["t/604",[8,0.439,37,2.681,41,1.085,90,2.962,162,5.831,165,4.461,331,5.349,423,2.746,560,4.701,561,5.831,562,5.831,563,5.831,564,3.524,565,5.831,566,5.831,567,5.831,652,5.831,1042,5.349,1043,6.563]],["t/606",[1,1.582,2,5.13,7,4.989,8,0.645,37,3.469,77,1.783,219,3.205,221,4.135,222,4.388,224,3.205,1044,7.34,1045,7.34]],["t/608",[1,1.011,41,1.128,46,2.635,66,1.162,76,4.583,82,4.638,109,3.081,119,7.159,135,3.204,140,0.953,147,6.062,148,3.081,154,1.352,161,2.069,169,4.412,182,1.093,193,3.081,203,2.483,231,2.635,250,3.081,321,2.483,366,1.219,380,2.635,386,2.826,404,2.635,450,3.921,457,2.483,506,3.081,512,2.635,622,1.699,682,3.081,683,4.583,700,4.583,712,4.583,768,2.826,791,3.081,1046,3.467,1047,3.467,1048,3.467,1049,5.159,1050,7.918,1051,3.467,1052,5.159,1053,3.467,1054,3.467,1055,3.467,1056,3.467,1057,3.467,1058,3.467,1059,3.467,1060,3.467,1061,3.467,1062,5.159,1063,6.161,1064,3.467,1065,3.467,1066,3.467,1067,3.467,1068,3.467,1069,3.467,1070,3.467,1071,3.467,1072,3.467,1073,3.467,1074,3.467,1075,5.159,1076,3.467,1077,3.467,1078,3.467,1079,3.467,1080,5.159,1081,3.467,1082,3.467,1083,3.467,1084,3.467,1085,3.467,1086,3.467,1087,5.159,1088,3.467,1089,3.467,1090,3.467,1091,3.467,1092,3.467,1093,3.467,1094,3.467]],["t/610",[1,0.425,8,0.647,15,0.726,16,0.843,17,0.774,19,1.128,41,0.358,43,1.094,62,2.658,116,1.204,131,1.347,136,2.51,140,0.596,156,1.856,157,1.059,160,0.93,202,0.631,213,1.406,239,1.648,244,0.93,285,1.474,287,1.474,294,0.417,295,1.22,337,0.865,339,2.524,340,2.219,346,2.171,363,0.939,364,0.886,366,1.744,368,0.978,369,0.697,396,1.767,443,1.301,479,1.347,489,1.648,503,2.13,527,1.247,529,1.546,531,1.347,536,2.052,564,1.164,592,0.774,593,0.845,648,1.406,650,1.294,666,3.953,667,1.406,701,1.553,750,1.748,751,1.406,755,1.347,756,2.441,757,1.433,758,1.553,763,2.13,769,1.553,770,2.378,772,1.653,775,1.553,776,1.553,777,1.553,778,1.553,781,4.294,785,3.273,787,1.767,795,2.052,894,1.164,895,1.653,1001,1.406,1002,1.406,1003,1.406,1004,1.926,1005,1.926,1006,1.926,1007,2.425,1008,1.406,1009,2.425,1010,1.406,1011,1.406,1012,1.406,1013,1.406,1014,1.474,1015,2.314,1016,2.314,1017,2.314,1018,1.406,1019,1.406,1020,4.682,1021,1.406,1022,3.17,1023,1.926,1024,1.926,1025,1.926,1026,1.926,1027,1.926,1028,1.926,1029,1.926,1030,1.406,1031,1.406,1033,1.406,1035,1.926,1040,1.767,1041,1.767]],["t/612",[1,0.805,8,0.648,15,0.629,16,1.603,17,0.67,19,0.977,43,0.948,62,1.597,63,1.043,116,1.758,131,1.967,136,2.295,140,1.128,157,0.558,160,0.806,204,1.669,223,1.902,244,2.066,269,0.657,334,1.083,339,1.043,340,2.079,363,0.722,364,0.767,366,1.704,368,0.848,369,0.604,409,2.053,443,1.962,479,1.167,503,1.121,505,1.669,527,1.08,529,1.202,536,1.08,564,1.009,592,1.13,593,0.732,606,0.685,650,1.121,666,3.704,667,3.125,744,3.451,752,2.714,755,1.167,756,1.7,757,0.592,763,1.89,764,2.053,770,2.941,771,2.36,772,0.871,785,1.967,795,1.08,796,2.813,798,2.813,894,1.009,895,1.467,1001,1.218,1002,2.053,1003,2.053,1008,1.218,1010,1.218,1011,1.218,1012,1.218,1013,1.218,1015,2.053,1016,2.053,1017,2.053,1018,1.218,1019,1.218,1021,1.218,1030,1.218,1031,1.218,1032,1.428,1033,1.218,1034,1.428,1095,1.879,1096,1.879,1097,1.879,1098,1.879,1099,1.879,1100,1.879,1101,1.879,1102,1.879,1103,1.879,1104,4.105,1105,3.167,1106,1.879,1107,1.879,1108,4.105,1109,3.167,1110,1.879,1111,1.879,1112,1.879,1113,1.879,1114,1.879,1115,1.879,1116,6.518,1117,3.167,1118,1.879,1119,3.167,1120,3.167,1121,1.879,1122,3.167,1123,1.879,1124,3.167,1125,3.167]],["t/614",[37,2.703,165,4.497,192,2.073,202,1.926,294,1.273,334,2.263,405,5.029,511,2.466,606,2.413,881,3.066,902,2.58,1126,6.617,1127,6.617,1128,6.617,1129,6.617,1130,6.617,1131,6.617]],["t/616",[1,1.036,8,0.636,16,1.417,157,1.78,161,3.893,182,2.056,192,2.234,202,1.243,223,1.255,263,2.058,269,1.559,294,0.821,295,1.46,305,2.207,306,3.888,363,0.978,365,1.056,366,1.248,369,1.699,395,1.883,405,4.958,473,2.768,511,1.969,533,1.454,544,1.845,552,1.978,593,2.06,606,1.926,838,1.756,866,1.937,901,2.392,902,2.06,909,1.682,910,1.682,959,2.406,1042,2.207,1132,5.796,1133,2.406,1134,2.406,1135,2.708,1136,2.708,1137,5.996,1138,2.708,1139,2.406,1140,2.406,1141,2.708,1142,2.406,1143,2.406,1144,3.792,1145,2.406,1146,2.406]],["t/618",[1,1.003,8,0.637,140,1.406,157,1.732,161,3.802,168,5.192,182,2.008,192,2.137,202,1.196,223,1.195,259,2.064,269,1.476,294,0.79,295,1.405,363,1.017,365,1.006,366,1.209,369,1.645,395,1.772,405,4.842,473,2.663,501,1.007,511,1.907,529,1.423,533,1.385,552,1.903,592,1.826,593,1.995,599,2.104,606,1.866,624,1.673,866,1.892,901,2.542,902,1.995,909,1.602,910,1.602,1042,2.102,1132,5.66,1133,2.292,1134,2.292,1139,2.292,1140,2.292,1142,2.292,1143,2.292,1144,3.649,1145,2.292,1146,2.292,1147,2.58]],["t/620",[1148,7.533,1149,7.533,1150,7.533]]],"invertedIndex":[["",{"_index":8,"t":{"312":{"position":[[133,3]]},"314":{"position":[[384,2],[387,6],[426,16]]},"316":{"position":[[40,10]]},"322":{"position":[[632,1]]},"326":{"position":[[122,1],[132,1],[191,1],[246,2],[249,2],[252,2],[255,2]]},"328":{"position":[[49,1],[61,1],[123,2],[170,2],[173,2]]},"330":{"position":[[7,1],[13,1],[68,1],[110,2]]},"332":{"position":[[7,1],[27,1],[216,2],[385,2]]},"336":{"position":[[56,2]]},"340":{"position":[[254,1],[278,1],[280,2]]},"347":{"position":[[69,1]]},"351":{"position":[[107,2],[255,2],[497,1]]},"355":{"position":[[837,1],[941,1],[968,2],[980,2],[983,1],[1014,1],[1051,2],[1054,1],[1071,1],[1109,2],[1173,2],[1189,2],[1192,1],[1194,2],[1259,3],[1263,2],[1266,2],[1269,2],[1272,3],[1687,1],[1806,2],[1832,2],[1839,1],[1856,3],[1876,1],[1898,2],[1901,1],[1918,1],[1946,2],[1993,2],[2085,3],[2089,1],[2096,1],[2108,1],[2175,2],[2188,1],[2205,1],[2207,2],[2210,3]]},"357":{"position":[[523,1],[674,1],[676,2],[689,3],[727,2],[740,2],[743,1],[780,1],[836,2],[839,2],[867,2],[880,2],[883,1],[920,1],[976,2],[979,2],[1007,2],[1020,2],[1023,1],[1060,1],[1116,2],[1119,2],[1122,2],[1125,3]]},"360":{"position":[[60,1],[62,1],[64,1],[66,1],[100,2],[103,1],[105,2],[114,1],[116,1],[129,1],[131,1],[133,2],[157,1],[159,1],[161,1],[163,1],[243,3],[247,2],[287,1],[289,1],[291,1],[293,1],[359,1],[361,1],[363,1],[365,1]]},"362":{"position":[[165,1],[167,1],[169,1],[199,2],[202,1],[204,2],[266,3],[295,2],[395,1],[407,2],[423,2],[489,2],[492,1],[494,2],[498,1],[500,1],[502,1],[513,1],[515,1],[517,3],[521,2],[573,2],[683,3]]},"364":{"position":[[22,1]]},"366":{"position":[[63,1],[81,1],[96,1],[114,1],[155,1],[187,1],[230,1],[250,1]]},"368":{"position":[[105,1],[140,1],[201,1],[211,1],[256,2],[259,1],[333,1],[343,1],[388,2],[391,1],[466,1],[476,1],[528,1],[538,1],[583,2],[586,1],[620,1],[622,2],[625,1],[627,2],[630,1],[632,2]]},"374":{"position":[[0,2],[18,2],[33,1],[62,2],[136,2],[191,2],[194,2],[210,2],[271,2],[312,1],[356,2],[483,2],[486,1],[498,1],[563,2],[581,2],[584,1],[617,2],[633,2],[636,1],[656,2],[714,3]]},"376":{"position":[[26,1],[40,1],[80,1],[128,3],[153,1],[182,3],[222,1],[250,1],[264,1],[304,1],[340,3],[344,2],[480,3],[534,1]]},"378":{"position":[[12,1],[42,1],[72,2],[75,1],[85,1],[164,3],[179,1],[287,1],[299,4],[319,3]]},"380":{"position":[[0,2]]},"384":{"position":[[67,5]]},"386":{"position":[[7,17],[38,1],[48,2]]},"388":{"position":[[125,2],[128,4],[169,2],[172,9],[199,1],[283,3],[287,2],[290,4],[299,1],[325,1],[359,1],[387,1],[406,1],[412,2],[437,2],[440,3],[465,2],[468,13],[482,1],[496,1],[516,1],[518,2],[521,5],[531,1],[549,1],[583,1],[611,1],[613,1],[625,1],[627,3],[644,2],[669,1],[683,1],[703,1],[705,2],[708,4],[725,1],[746,2],[749,9],[776,1],[854,3],[858,2],[861,4],[892,1],[920,1],[939,1],[978,1],[1002,2],[1005,3],[1030,2],[1033,13],[1047,1],[1049,2],[1052,2],[1055,5],[1087,1],[1115,1],[1117,1],[1129,1],[1131,3],[1173,1],[1197,1],[1199,2]]},"390":{"position":[[0,2],[50,25],[76,23],[124,3],[136,15],[152,6],[167,1],[179,12],[366,1],[368,2],[371,9],[398,1],[482,3],[486,2],[497,6],[512,1],[544,1],[580,1],[608,1],[610,1],[622,1],[624,3],[647,2],[672,2],[675,3],[700,2],[703,13],[717,1],[731,1],[751,1],[765,1],[786,2],[789,9],[816,1],[894,3],[898,2],[909,6],[924,1],[960,1],[988,1],[990,1],[1002,1],[1004,3],[1060,1],[1084,2],[1087,3],[1112,2],[1115,13],[1129,1],[1131,2],[1134,2],[1137,42]]},"392":{"position":[[0,20],[27,30],[58,30],[230,2],[233,14],[259,1],[391,2],[487,2],[621,3],[637,1],[658,2],[661,14],[687,1],[819,2],[915,2],[1049,3],[1053,2],[1056,33],[1090,16],[1120,1],[1160,1],[1162,2],[1221,1],[1272,2],[1332,1],[1346,1],[1366,1],[1368,2],[1477,1],[1479,2],[1539,3],[1543,21],[1582,2],[1631,1],[1661,2],[1717,3],[1721,4],[1726,2],[1813,2],[1891,1],[1893,2],[1943,3],[1947,4],[1952,2],[2039,3]]},"394":{"position":[[7,3],[24,2],[31,9],[99,1],[101,2],[143,1],[227,3],[231,2],[270,1],[306,1],[334,1],[336,1],[348,1],[350,3],[368,2],[371,1],[380,10],[399,3],[403,12],[424,3],[428,2],[431,4],[472,2],[561,2],[632,1],[735,3],[739,2],[778,1],[814,1],[842,1],[844,1],[856,1],[858,3],[876,2],[886,2],[895,6],[950,3],[1004,1],[1006,2],[1036,1],[1108,3],[1112,2],[1181,1],[1199,2],[1253,1],[1292,1],[1301,1],[1315,6],[1356,5],[1383,1],[1404,2],[1440,1],[1518,3],[1580,2],[1583,1],[1604,2],[1636,2]]},"396":{"position":[[0,44],[56,5],[62,3],[97,39],[137,5],[171,1],[274,3],[289,1],[386,3],[390,5],[417,1],[443,1],[521,3],[547,2],[550,11],[583,2],[586,3],[590,1],[604,1],[624,1],[638,1],[697,2],[732,1],[756,2],[862,2],[886,1],[888,2]]},"398":{"position":[[35,1],[71,1],[113,1],[157,2],[217,2],[350,2],[355,1],[377,3],[430,2],[433,1],[461,2],[464,2]]},"401":{"position":[[162,1],[462,1],[500,1],[512,1],[525,2],[540,2],[543,1],[545,2],[578,1],[580,1],[582,1],[621,2],[639,1],[641,1],[648,1],[650,1],[652,3],[686,1],[698,1],[705,2],[720,2],[723,1],[725,2],[735,1],[737,1],[739,1],[767,3],[799,1],[811,1],[818,2],[833,2],[836,1],[838,2],[856,1],[865,3],[869,2],[973,1],[975,1],[977,1],[1006,2],[1009,1],[1011,2],[1029,1],[1038,3]]},"403":{"position":[[14,1],[16,1],[68,2],[112,2],[115,1],[117,2],[170,2],[241,2],[244,4],[249,2],[252,3]]},"405":{"position":[[453,2],[562,1],[590,2],[593,2],[619,1],[693,1],[727,1],[776,1],[798,2],[801,2],[816,2],[898,1],[927,1],[965,1],[1052,2],[1055,1],[1057,2],[1096,1],[1149,1],[1238,3],[1242,3],[1246,2],[1249,1],[1285,2],[1288,3],[1379,2]]},"407":{"position":[[10,1],[40,1],[73,1],[111,1],[226,2],[255,3],[592,1],[635,1],[668,1],[759,1],[777,1],[800,1],[834,2],[837,1],[869,1],[871,2],[895,2],[898,3]]},"410":{"position":[[199,2]]},"412":{"position":[[233,1],[266,1]]},"414":{"position":[[14,1],[34,1],[83,1],[85,1],[119,2],[133,1]]},"416":{"position":[[14,1],[28,1],[71,1],[73,1],[107,2],[121,1]]},"418":{"position":[[37,1],[67,2],[70,1],[72,3],[76,1],[85,1],[87,1],[97,1],[99,1],[101,2],[104,3],[131,1],[161,2],[164,1],[166,3],[170,1],[179,1],[181,1],[191,1],[193,1],[195,2],[198,3]]},"421":{"position":[[68,1],[84,1],[112,1],[171,3],[175,2],[223,1],[253,2],[256,1],[277,3],[281,1],[290,1],[292,1],[302,1],[304,1],[306,2],[309,3],[313,2],[390,2],[393,1],[414,3],[418,1],[427,1],[429,1],[454,1],[456,1],[458,2],[461,3],[513,1],[529,1],[557,1],[635,3],[639,2],[688,1],[703,1],[731,2],[734,1],[755,3],[759,1],[768,1],[770,1],[777,1],[779,1],[781,2],[784,1],[786,2],[789,2],[866,2],[869,1],[890,3],[894,1],[903,1],[905,1],[914,1],[916,1],[918,2],[921,3]]},"423":{"position":[[85,1],[101,1],[129,1],[214,3],[228,1],[230,1],[241,1],[263,1],[276,2],[327,2],[330,1],[351,3],[355,1],[364,1],[366,1],[368,1],[378,1],[380,2],[383,1],[385,1],[395,1],[397,1],[399,1],[401,2],[404,3]]},"425":{"position":[[322,1],[340,1],[368,1],[427,3],[441,1],[443,1],[452,1],[457,2],[508,2],[511,1],[534,3],[538,1],[565,1],[618,3],[672,1],[674,2],[677,3]]},"427":{"position":[[173,1],[191,1],[219,1],[304,3],[318,1],[320,1],[329,1],[341,1],[346,2],[400,2],[403,1],[427,3],[431,1],[443,1],[461,1],[514,3],[569,2],[588,1],[641,3],[695,1],[697,1],[699,2],[702,3]]},"429":{"position":[[69,2],[279,1],[318,1],[346,1],[405,3],[409,3],[429,2],[484,3],[504,2],[564,1],[576,1],[585,3],[589,3],[613,2],[626,1],[719,2],[722,1],[745,3],[749,1],[776,1],[829,3],[883,1],[885,2],[888,3],[1064,3],[1105,2]]},"435":{"position":[[63,1],[114,1],[124,1],[238,3],[290,1],[348,1],[371,1],[413,1],[425,1],[464,1],[647,1],[759,2],[762,2],[878,2],[889,1],[953,1],[1055,3],[1155,1],[1267,2],[1270,2],[1323,1],[1379,1],[1397,2],[1400,1],[1423,2],[1439,2],[1442,1],[1483,3],[1513,1],[1551,1],[1581,2],[1584,1],[1594,1],[1678,3],[1693,1],[1801,1],[1813,4],[1833,2],[1851,2],[1854,1],[1877,2],[1902,1],[1933,3],[1937,1],[1983,1],[1985,1],[2050,3],[2085,1],[2130,2],[2141,2],[2154,3],[2192,1],[2216,1],[2218,1]]},"437":{"position":[[0,2]]},"439":{"position":[[103,1],[122,1],[198,2],[201,1],[215,1],[235,1],[249,1],[287,1],[357,2],[398,2],[401,1],[421,3]]},"441":{"position":[[107,1],[126,1],[210,2],[225,2],[238,3],[242,3],[246,1],[260,1],[280,1],[294,1],[332,1],[410,2],[425,2],[438,3],[442,3],[484,2],[487,1],[507,3]]},"443":{"position":[[107,1],[126,1],[159,2],[162,3],[243,2],[246,3],[250,1],[264,1],[284,1],[298,1],[336,1],[363,2],[366,3],[448,3],[490,2],[493,1],[513,3]]},"445":{"position":[[125,1],[144,1],[177,2],[180,3],[189,1],[191,2],[242,2],[338,2],[341,3],[345,1],[359,1],[379,1],[393,1],[431,1],[458,2],[461,3],[470,1],[472,2],[523,2],[619,2],[622,3],[664,2],[667,1],[687,3]]},"447":{"position":[[294,1],[313,1],[346,2],[349,3],[420,3],[424,1],[438,1],[458,1],[472,1],[486,1],[589,1],[603,1],[623,1],[637,1],[675,1],[702,2],[705,3],[776,3],[818,2],[821,1],[841,3],[924,1],[970,1],[998,1],[1018,3]]},"449":{"position":[[13,1],[77,1],[129,1]]},"451":{"position":[[66,1],[109,1],[148,1],[183,3],[204,1],[251,3],[293,2],[296,1],[316,3],[332,1],[375,1],[414,1],[468,2],[471,1],[513,3],[517,2],[520,3],[562,2],[565,1],[585,3],[666,2],[669,1],[697,1],[725,1],[754,3],[825,2],[828,1],[856,1],[884,1],[913,3],[984,2],[987,1],[1015,1],[1043,1],[1072,3]]},"456":{"position":[[105,1],[140,1],[211,2]]},"458":{"position":[[0,2]]},"460":{"position":[[97,1],[110,1],[192,1],[222,2],[225,3],[262,1],[276,1],[296,1],[310,1],[342,1],[453,1],[481,1],[509,1],[511,2],[514,3],[551,3],[555,2]]},"462":{"position":[[95,1],[108,1],[180,2],[195,2],[208,3],[212,3],[233,1],[263,2],[266,3],[303,1],[317,1],[337,1],[351,1],[383,1],[455,2],[470,2],[483,3],[487,3],[537,1],[565,1],[593,1],[595,2],[598,3],[635,3],[639,2]]},"464":{"position":[[95,1],[108,1],[129,2],[132,3],[213,2],[216,3],[237,1],[267,2],[270,3],[307,1],[321,1],[341,1],[355,1],[387,1],[408,2],[411,3],[493,3],[543,1],[571,1],[599,1],[601,2],[604,3],[641,3],[645,2]]},"466":{"position":[[113,1],[126,1],[147,2],[150,3],[159,1],[161,2],[212,2],[308,2],[311,3],[332,1],[362,2],[365,3],[402,1],[416,1],[436,1],[450,1],[482,1],[503,2],[506,3],[515,1],[517,2],[568,2],[664,2],[667,3],[717,1],[745,1],[773,1],[775,2],[778,3],[815,3],[834,2]]},"468":{"position":[[282,1],[295,1],[316,2],[319,3],[390,3],[411,1],[441,2],[444,3],[481,1],[495,1],[515,1],[529,1],[543,1],[640,1],[654,1],[674,1],[688,1],[720,1],[741,2],[744,3],[815,3],[865,1],[893,1],[921,1],[923,2],[926,3],[963,3],[1046,1],[1086,1],[1114,1],[1134,3],[1138,2]]},"470":{"position":[[13,1],[77,1],[129,1]]},"472":{"position":[[54,1],[97,1],[136,1],[171,3],[186,1],[227,3],[243,1],[286,1],[319,1],[367,2],[370,1],[412,3],[416,2],[419,3],[494,2],[497,1],[525,1],[553,1],[582,3],[647,2],[650,1],[678,1],[706,1],[735,3],[800,2],[803,1],[831,1],[859,1],[888,3]]},"478":{"position":[[63,1],[75,1],[120,3],[124,3],[128,7],[149,1],[200,1],[283,1],[297,1],[317,1],[329,1],[374,3],[378,3],[382,7],[403,1],[485,2],[488,1],[516,1],[544,1],[588,3],[768,2]]},"480":{"position":[[58,1],[70,1],[115,3],[119,3],[123,7],[144,1],[195,1],[237,2],[240,3],[258,3],[304,1],[318,1],[338,1],[350,1],[395,3],[399,3],[403,7],[424,1],[472,1],[487,2],[490,3],[508,2],[533,2],[536,1],[564,1],[592,1],[636,1],[638,2],[817,2]]},"482":{"position":[[73,1],[85,1],[130,3],[134,3],[138,7],[159,1],[210,1],[238,1],[245,2],[248,3],[266,2],[276,2],[321,1],[335,1],[355,1],[367,1],[412,3],[416,3],[420,7],[441,1],[489,1],[496,2],[499,3],[517,2],[550,2],[553,1],[581,1],[609,1],[653,1],[655,2],[834,2]]},"489":{"position":[[0,2],[43,1]]},"492":{"position":[[63,1],[75,1],[103,1],[105,1],[120,1],[122,1],[147,1],[186,1],[269,1],[283,1],[303,1],[315,1],[343,1],[345,1],[360,1],[362,1],[387,1],[457,2],[460,1],[488,1],[516,1],[560,3],[740,2]]},"494":{"position":[[58,1],[70,1],[98,1],[100,1],[115,1],[117,1],[142,1],[181,1],[223,2],[226,3],[244,3],[290,1],[304,1],[324,1],[336,1],[364,1],[366,1],[381,1],[383,1],[408,1],[444,1],[459,2],[462,3],[480,2],[505,2],[508,1],[536,1],[564,1],[608,1],[610,2],[789,2]]},"496":{"position":[[73,1],[85,1],[113,1],[115,1],[130,1],[132,1],[157,1],[196,1],[224,1],[231,2],[234,3],[252,2],[262,2],[307,1],[321,1],[341,1],[353,1],[381,1],[383,1],[398,1],[400,1],[425,1],[461,1],[468,2],[471,3],[489,2],[522,2],[525,1],[553,1],[581,1],[625,1],[627,2],[806,2]]},"504":{"position":[[63,1],[75,1],[111,1],[113,1],[138,1],[173,1],[256,1],[270,1],[290,1],[302,1],[338,1],[340,1],[365,1],[431,2],[434,1],[462,1],[490,1],[534,3],[714,2]]},"506":{"position":[[58,1],[70,1],[106,1],[108,1],[133,1],[168,1],[210,2],[213,3],[231,3],[277,1],[291,1],[311,1],[323,1],[359,1],[361,1],[386,1],[418,1],[433,2],[436,3],[454,2],[479,2],[482,1],[510,1],[538,1],[582,1],[584,2],[763,2]]},"508":{"position":[[73,1],[85,1],[121,1],[123,1],[148,1],[183,1],[211,1],[218,2],[221,3],[239,2],[249,2],[294,1],[308,1],[328,1],[340,1],[376,1],[378,1],[403,1],[435,1],[442,2],[445,3],[463,2],[496,2],[499,1],[527,1],[555,1],[599,1],[601,2],[780,2]]},"516":{"position":[[63,1],[75,1],[85,1],[113,1],[115,1],[127,1],[129,3],[146,1],[183,1],[264,1],[278,1],[298,1],[310,1],[320,1],[348,1],[350,1],[362,1],[364,3],[381,1],[449,2],[452,1],[480,1],[508,1],[550,3],[649,2]]},"518":{"position":[[58,1],[70,1],[80,1],[108,1],[110,1],[122,1],[124,3],[141,1],[178,1],[220,2],[223,3],[241,3],[285,1],[299,1],[319,1],[331,1],[341,1],[369,1],[371,1],[383,1],[385,3],[402,1],[438,1],[453,2],[456,3],[474,2],[497,2],[500,1],[528,1],[556,1],[598,1],[600,2],[698,2]]},"520":{"position":[[73,1],[85,1],[95,1],[123,1],[125,1],[137,1],[139,3],[156,1],[193,1],[221,1],[228,2],[231,3],[249,2],[259,2],[302,1],[316,1],[336,1],[348,1],[358,1],[386,1],[388,1],[400,1],[402,3],[419,1],[455,1],[462,2],[465,3],[483,2],[514,2],[517,1],[545,1],[573,1],[615,1],[617,2],[715,2]]},"525":{"position":[[0,2]]},"527":{"position":[[105,1],[125,1],[228,2],[259,7],[284,1],[331,2],[334,3],[371,1],[385,1],[405,1],[419,1],[458,1],[561,2],[592,7],[665,1],[693,1],[721,1],[723,2],[726,3],[763,3],[767,2]]},"529":{"position":[[103,1],[123,1],[180,1],[233,2],[248,2],[261,3],[265,3],[269,2],[300,7],[325,1],[372,2],[375,3],[412,1],[426,1],[446,1],[460,1],[499,1],[556,1],[609,2],[624,2],[637,3],[641,3],[645,2],[676,7],[749,1],[777,1],[805,1],[807,2],[810,3],[847,3],[851,2]]},"531":{"position":[[103,1],[123,1],[180,1],[182,2],[185,3],[266,2],[269,3],[273,2],[304,7],[329,1],[376,2],[379,3],[416,1],[430,1],[450,1],[464,1],[503,1],[560,1],[562,2],[565,3],[647,3],[651,2],[682,7],[755,1],[783,1],[811,1],[813,2],[816,3],[853,3],[857,2]]},"533":{"position":[[121,1],[141,1],[198,1],[200,2],[203,3],[212,1],[214,2],[265,2],[361,2],[364,3],[368,2],[399,7],[424,1],[471,2],[474,3],[511,1],[525,1],[545,1],[559,1],[598,1],[655,1],[657,2],[660,3],[669,1],[671,2],[722,2],[818,2],[821,3],[825,2],[856,7],[929,1],[957,1],[985,1],[987,2],[990,3],[1027,3],[1046,2]]},"535":{"position":[[290,1],[310,1],[367,1],[369,2],[372,3],[443,3],[447,2],[478,7],[503,1],[550,2],[553,3],[590,1],[604,1],[624,1],[638,1],[652,1],[756,1],[770,1],[790,1],[804,1],[843,1],[900,1],[902,2],[905,3],[976,3],[980,2],[1011,7],[1084,1],[1112,1],[1140,1],[1142,2],[1145,3],[1182,3],[1265,1],[1312,1],[1340,1],[1360,3],[1364,2]]},"537":{"position":[[13,1],[77,1],[129,1]]},"539":{"position":[[62,1],[105,1],[144,1],[179,3],[201,1],[258,1],[280,3],[284,2],[315,7],[343,1],[385,1],[428,1],[468,1],[525,1],[554,2],[557,1],[599,3],[603,2],[606,3],[610,2],[641,7],[669,1],[779,2],[782,1],[810,1],[838,1],[867,3],[941,2],[944,1],[972,1],[1000,1],[1029,3],[1103,2],[1106,1],[1134,1],[1162,1],[1191,3]]},"546":{"position":[[46,1],[58,1],[94,1],[136,1],[209,1],[223,1],[243,1],[255,1],[291,1],[354,2],[357,1],[385,1],[413,1],[457,3],[637,2]]},"548":{"position":[[56,1],[68,1],[104,1],[146,1],[178,2],[181,3],[199,3],[245,1],[259,1],[279,1],[291,1],[327,1],[364,1],[371,2],[374,3],[392,2],[417,2],[420,1],[448,1],[476,1],[520,1],[522,2],[701,2]]},"557":{"position":[[46,1],[58,1],[155,1],[228,1],[242,1],[262,1],[274,1],[392,2],[395,1],[423,1],[451,1],[495,3],[675,2]]},"559":{"position":[[56,1],[68,1],[165,1],[197,2],[200,3],[218,3],[264,1],[278,1],[298,1],[310,1],[402,1],[409,2],[412,3],[430,2],[455,2],[458,1],[486,1],[514,1],[558,1],[560,2],[739,2]]},"566":{"position":[[35,1],[74,1],[132,1],[208,2],[211,1],[395,1],[419,3],[461,2],[464,1],[526,3],[543,1],[652,3],[679,2],[682,1],[756,1],[758,2],[807,2],[881,1],[883,2],[939,1],[963,1],[1076,1],[1083,1],[1085,2],[1147,1],[1216,1],[1218,3],[1222,3],[1267,3]]},"570":{"position":[[46,1],[58,1],[68,1],[96,1],[115,1],[143,1],[214,1],[228,1],[248,1],[260,1],[270,1],[298,1],[317,1],[366,2],[369,1],[397,1],[425,1],[467,3],[566,2]]},"572":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[185,2],[188,3],[206,3],[250,1],[264,1],[284,1],[296,1],[306,1],[334,1],[353,1],[378,1],[385,2],[388,3],[406,2],[429,2],[432,1],[460,1],[488,1],[530,1],[532,2],[630,2]]},"574":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[204,2],[207,3],[225,3],[269,1],[283,1],[303,1],[315,1],[325,1],[353,1],[372,1],[397,1],[423,2],[426,3],[444,2],[467,2],[470,1],[498,1],[526,1],[568,1],[570,2],[677,2]]},"579":{"position":[[34,1],[136,3],[155,2],[158,1],[171,1],[178,1],[188,1],[221,2],[224,1],[253,2],[313,3],[317,1],[319,2],[344,2],[347,1],[360,1],[367,1],[377,1],[408,2],[411,1],[470,2],[473,1],[516,3],[520,3],[524,1],[526,2]]},"581":{"position":[[35,1],[68,1],[124,1],[194,1],[233,1],[277,1],[373,2],[389,1],[401,1],[408,1],[410,2],[464,1],[509,3],[513,1],[515,1],[530,1],[606,2],[609,1],[611,2],[643,2],[693,3],[697,2],[783,2],[856,2],[886,2],[976,3],[1018,2],[1021,1],[1083,3],[1112,2],[1115,1],[1137,1],[1324,2],[1327,3],[1356,4],[1361,3],[1365,10],[1376,7],[1393,4],[1424,7],[1432,4],[1437,8],[1446,6],[1453,11],[1496,3],[1500,3]]},"583":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[329,1],[355,1],[398,2],[401,1],[413,2],[428,3],[467,1],[469,1],[569,2],[596,2],[613,2],[623,2],[626,2],[629,1],[663,1],[665,1],[673,3],[683,3],[697,3],[711,3],[715,2],[729,1],[769,3],[814,2],[885,3],[919,2],[1051,2],[1054,3],[1079,2],[1099,1],[1178,4],[1183,4],[1188,6],[1230,2],[1282,3],[1334,2],[1409,3],[1451,2],[1531,1],[1567,3],[1571,3],[1589,2],[1616,1],[1716,2],[1719,1],[1721,3],[1823,2],[1856,1],[1887,3],[1942,1],[1949,1],[1972,2],[1975,1],[2006,3],[2027,2],[2073,3],[2077,1],[2079,3],[2101,5],[2107,3],[2118,1],[2120,1],[2134,1],[2153,1],[2161,1],[2175,1],[2194,1],[2202,1],[2215,1],[2234,1],[2242,1],[2255,1],[2274,1],[2282,1],[2296,1],[2315,1],[2334,2]]},"587":{"position":[[46,1],[58,1],[86,1],[104,1],[146,1],[219,1],[233,1],[253,1],[265,1],[293,1],[311,1],[374,2],[377,1],[405,1],[433,1],[477,3],[657,2]]},"589":{"position":[[56,1],[68,1],[96,1],[114,1],[156,1],[188,2],[191,3],[209,3],[255,1],[269,1],[289,1],[301,1],[329,1],[347,1],[384,1],[391,2],[394,3],[412,2],[437,2],[440,1],[468,1],[496,1],[540,1],[542,2],[721,2]]},"596":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[435,2],[449,1],[489,3],[534,2],[605,3],[639,2],[771,2],[774,3],[799,2],[819,1],[898,4],[903,4],[908,6],[950,2],[1002,3],[1020,2],[1036,1],[1066,1],[1076,1],[1130,1],[1194,2],[1197,2],[1221,2],[1224,1],[1247,2],[1250,1],[1276,3],[1297,2],[1343,3],[1347,3],[1369,5],[1375,3],[1386,1],[1388,1],[1402,1],[1416,1],[1424,1],[1438,1],[1452,1],[1460,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1544,2]]},"598":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[409,2],[423,1],[463,3],[508,2],[579,3],[613,2],[745,2],[748,3],[773,2],[793,1],[872,4],[877,4],[882,6],[924,2],[976,3],[994,2],[1011,1],[1047,1],[1084,2],[1108,2],[1111,1],[1137,3],[1158,2],[1204,3],[1226,5],[1232,3],[1243,1],[1245,1],[1259,1],[1273,1],[1281,1],[1295,1],[1309,1],[1317,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1401,2]]},"600":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[446,2],[460,1],[500,3],[545,2],[616,3],[650,2],[782,2],[785,3],[810,2],[830,1],[909,4],[914,4],[919,6],[961,2],[1013,3],[1031,2],[1048,1],[1084,1],[1121,2],[1145,2],[1148,1],[1174,3],[1195,2],[1239,3],[1261,5],[1267,3],[1278,1],[1280,1],[1294,1],[1308,1],[1316,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1400,1],[1414,1],[1422,1],[1436,2]]},"602":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[472,2],[486,1],[526,3],[571,2],[642,3],[676,2],[808,2],[811,3],[836,2],[856,1],[935,4],[940,4],[945,6],[987,2],[1039,3],[1057,2],[1073,1],[1103,1],[1113,1],[1167,1],[1231,2],[1234,2],[1258,2],[1261,1],[1284,2],[1287,1],[1313,3],[1334,2],[1378,3],[1382,3],[1404,5],[1410,3],[1421,1],[1423,1],[1437,1],[1451,1],[1459,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1543,1],[1557,1],[1565,1],[1579,2]]},"604":{"position":[[72,2]]},"606":{"position":[[7,3],[24,4],[47,8],[78,5],[98,15],[122,4],[134,3],[142,1],[152,12],[172,12],[185,8],[194,5],[226,14],[251,4],[260,1],[284,4],[289,3]]},"610":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[303,3],[310,2],[324,3],[333,2],[347,1],[373,1],[416,2],[419,1],[431,2],[446,3],[485,1],[487,1],[587,2],[614,2],[631,2],[641,2],[644,2],[647,1],[681,1],[683,1],[691,3],[701,3],[715,3],[729,3],[752,2],[766,1],[806,3],[851,2],[922,3],[956,2],[1088,2],[1091,3],[1116,2],[1136,1],[1215,4],[1220,4],[1225,6],[1267,2],[1319,3],[1371,2],[1446,3],[1488,2],[1568,1],[1604,3],[1608,3],[1626,2],[1653,1],[1753,2],[1756,1],[1758,3],[1860,2],[1893,1],[1924,3],[1979,1],[1986,1],[2009,2],[2012,1],[2043,3],[2064,2],[2108,3],[2112,1],[2114,3],[2136,5],[2142,3],[2153,1],[2155,1],[2169,1],[2188,1],[2196,1],[2210,1],[2229,1],[2237,1],[2250,1],[2269,1],[2277,1],[2290,1],[2309,1],[2317,1],[2331,1],[2350,1],[2369,2]]},"612":{"position":[[15,3],[19,1],[66,2],[76,1],[90,1],[122,1],[130,1],[185,1],[213,1],[241,1],[243,1],[251,3],[261,3],[275,3],[289,3],[293,2],[303,2],[306,2],[309,1],[323,1],[344,3],[389,2],[450,3],[484,2],[606,2],[609,3],[634,2],[654,1],[723,4],[728,4],[733,6],[775,2],[827,3],[845,2],[862,1],[895,1],[932,2],[962,2],[965,1],[991,3],[1012,2],[1058,3],[1092,5],[1098,3],[1109,1],[1111,1],[1125,1],[1139,1],[1147,1],[1161,1],[1175,1],[1183,1],[1196,1],[1210,1],[1218,1],[1231,1],[1245,1],[1253,1],[1267,2],[1270,3],[1274,1],[1321,2],[1331,1],[1396,1],[1440,1],[1534,1],[1553,1],[1578,1],[1610,1],[1612,3],[1683,2],[1713,1],[1742,1],[1774,1],[1776,3],[1804,2],[1823,1],[1907,1],[1909,3],[1965,2],[1991,1],[2077,1],[2079,3],[2112,2],[2133,1],[2217,1],[2219,3],[2297,2],[2319,1],[2405,1],[2407,3],[2435,2],[2456,1],[2542,1],[2544,3],[2600,2],[2628,1],[2716,1],[2718,3],[2751,2],[2774,1],[2860,1],[2862,3],[2940,2],[2964,1],[3052,1],[3054,3],[3085,2],[3105,1],[3125,1],[3127,1]]},"616":{"position":[[166,1],[198,1],[231,3],[241,3],[255,3],[259,3],[301,2],[304,1],[332,1],[379,1],[381,3],[508,1],[540,1],[567,3],[577,3],[591,3],[595,3],[636,2],[639,1],[667,1],[724,1],[726,3],[860,1],[899,1],[953,1],[961,3],[971,3],[985,3],[989,3],[1046,2],[1049,1],[1077,1],[1141,1],[1143,3],[1280,1],[1298,2],[1301,1],[1329,1],[1375,1],[1396,3],[1613,1],[1631,2],[1634,1],[1662,1],[1706,1],[1727,3]]},"618":{"position":[[184,1],[203,1],[242,3],[252,3],[266,3],[270,3],[274,1],[288,1],[316,1],[336,1],[338,1],[489,1],[516,3],[526,3],[540,3],[544,3],[552,1],[571,1],[601,1],[615,1],[643,1],[663,1],[665,1],[830,1],[884,1],[892,3],[902,3],[916,3],[920,3],[928,1],[972,1],[986,1],[1014,1],[1061,1],[1063,1],[1165,1],[1180,1],[1216,1],[1242,1],[1256,1],[1284,1],[1322,1],[1324,1],[1508,1],[1523,1],[1557,1],[1583,1],[1597,1],[1625,1],[1661,1],[1663,1]]}}}],["0",{"_index":156,"t":{"328":{"position":[[255,2]]},"366":{"position":[[121,2]]},"392":{"position":[[569,2],[618,2],[997,2],[1046,2]]},"398":{"position":[[291,2]]},"425":{"position":[[579,2],[596,2],[609,2],[654,2],[670,1]]},"427":{"position":[[475,2],[492,2],[505,2],[551,2],[567,1],[602,2],[619,2],[632,2],[677,2],[693,1]]},"429":{"position":[[790,2],[807,2],[820,2],[865,2],[881,1]]},"579":{"position":[[173,2],[362,2]]},"581":{"position":[[1308,2],[1321,2]]},"583":{"position":[[2332,1]]},"600":{"position":[[292,2]]},"602":{"position":[[292,2]]},"610":{"position":[[313,2],[2367,1]]}}}],["0deprec",{"_index":791,"t":{"431":{"position":[[0,11]]},"608":{"position":[[101,11]]}}}],["0xffffff",{"_index":930,"t":{"566":{"position":[[386,8]]},"581":{"position":[[876,9]]}}}],["1",{"_index":157,"t":{"328":{"position":[[258,2]]},"360":{"position":[[58,1],[155,1],[285,1],[357,1]]},"366":{"position":[[135,1]]},"368":{"position":[[189,3],[222,3],[321,3],[454,3],[516,3]]},"394":{"position":[[1287,4],[1553,3]]},"396":{"position":[[73,1],[477,1],[653,1]]},"398":{"position":[[347,2],[353,1]]},"401":{"position":[[517,2],[703,1],[760,3],[764,2],[816,1],[854,1],[858,1],[986,3],[990,3],[1027,1],[1031,1]]},"418":{"position":[[35,1],[39,1],[129,1],[133,1]]},"421":{"position":[[221,1],[225,1],[686,1],[690,1]]},"423":{"position":[[239,1],[243,1]]},"425":{"position":[[449,2],[454,2]]},"427":{"position":[[326,2],[331,2]]},"429":{"position":[[561,2],[566,2]]},"435":{"position":[[2138,2]]},"451":{"position":[[448,2]]},"472":{"position":[[347,2]]},"492":{"position":[[130,3],[370,3]]},"494":{"position":[[125,3],[391,3]]},"496":{"position":[[140,3],[408,3]]},"504":{"position":[[121,3],[348,3]]},"506":{"position":[[116,3],[369,3]]},"508":{"position":[[131,3],[386,3]]},"539":{"position":[[534,2]]},"546":{"position":[[109,3],[306,3]]},"548":{"position":[[119,3],[342,3]]},"583":{"position":[[2240,1]]},"587":{"position":[[119,3],[326,3]]},"589":{"position":[[129,3],[362,3]]},"596":{"position":[[1493,1]]},"598":{"position":[[1350,1]]},"600":{"position":[[315,2],[1385,1]]},"602":{"position":[[315,2],[1528,1]]},"610":{"position":[[336,2],[2275,1]]},"612":{"position":[[1216,1]]},"616":{"position":[[1278,1],[1282,3],[1611,1],[1615,3]]},"618":{"position":[[1214,1],[1218,4],[1555,1],[1559,4]]}}}],["1+1",{"_index":724,"t":{"407":{"position":[[284,3]]}}}],["1+:toadd",{"_index":555,"t":{"378":{"position":[[269,8]]},"435":{"position":[[1783,8]]}}}],["1,2",{"_index":688,"t":{"401":{"position":[[608,5]]}}}],["1.0.0",{"_index":143,"t":{"326":{"position":[[202,8]]},"435":{"position":[[2026,8]]}}}],["1.1",{"_index":158,"t":{"328":{"position":[[261,4]]}}}],["1.1earli",{"_index":1067,"t":{"608":{"position":[[756,8]]}}}],["1.2",{"_index":159,"t":{"328":{"position":[[266,4]]}}}],["1.2releas",{"_index":1071,"t":{"608":{"position":[[848,10]]}}}],["10",{"_index":557,"t":{"378":{"position":[[296,2]]},"392":{"position":[[374,3],[387,3],[802,3],[815,3]]},"407":{"position":[[237,2]]},"427":{"position":[[532,3]]},"435":{"position":[[1810,2]]},"566":{"position":[[280,3]]},"581":{"position":[[754,3]]}}}],["1000",{"_index":958,"t":{"579":{"position":[[322,6],[529,6]]}}}],["1045",{"_index":976,"t":{"581":{"position":[[504,4]]}}}],["1080",{"_index":735,"t":{"407":{"position":[[864,4]]}}}],["12",{"_index":442,"t":{"360":{"position":[[126,2]]}}}],["120",{"_index":673,"t":{"398":{"position":[[335,4]]}}}],["123",{"_index":664,"t":{"398":{"position":[[152,4]]},"581":{"position":[[689,3]]}}}],["1234",{"_index":928,"t":{"566":{"position":[[330,5]]},"581":{"position":[[817,5]]}}}],["137",{"_index":604,"t":{"390":{"position":[[637,5],[1017,5]]}}}],["14",{"_index":636,"t":{"394":{"position":[[364,3],[872,3]]}}}],["16000",{"_index":483,"t":{"364":{"position":[[86,5]]}}}],["18.x",{"_index":52,"t":{"320":{"position":[[60,5]]}}}],["19",{"_index":896,"t":{"478":{"position":[[160,3],[414,3]]},"480":{"position":[[155,3],[435,3]]},"482":{"position":[[170,3],[452,3]]},"557":{"position":[[112,4],[328,4]]},"559":{"position":[[122,4],[364,4]]}}}],["1998",{"_index":1149,"t":{"620":{"position":[[12,5]]}}}],["1experiment",{"_index":193,"t":{"334":{"position":[[144,13]]},"608":{"position":[[642,13]]}}}],["2",{"_index":160,"t":{"328":{"position":[[271,1]]},"362":{"position":[[293,1],[464,3]]},"376":{"position":[[195,3],[199,4]]},"396":{"position":[[85,1],[489,1],[665,1]]},"401":{"position":[[523,1]]},"418":{"position":[[95,1],[189,1]]},"421":{"position":[[300,1],[701,1],[705,1],[772,2]]},"423":{"position":[[261,1],[265,1],[376,1]]},"425":{"position":[[636,2]]},"427":{"position":[[338,2],[343,2],[659,2]]},"429":{"position":[[573,2],[578,2],[847,2]]},"566":{"position":[[349,2]]},"581":{"position":[[836,2]]},"583":{"position":[[2200,1]]},"596":{"position":[[1117,4],[1171,1],[1180,4],[1458,1]]},"598":{"position":[[1315,1]]},"600":{"position":[[1350,1]]},"602":{"position":[[1154,4],[1208,1],[1217,4],[1493,1]]},"610":{"position":[[2235,1]]},"612":{"position":[[1181,1]]}}}],["2+3",{"_index":814,"t":{"435":{"position":[[785,3],[1292,3]]}}}],["2.0",{"_index":698,"t":{"405":{"position":[[238,3]]}}}],["2.rds.amazonaws.com",{"_index":859,"t":{"447":{"position":[[379,21],[735,21]]},"468":{"position":[[349,21],[774,21]]},"535":{"position":[[402,21],[935,21]]}}}],["20",{"_index":906,"t":{"492":{"position":[[149,4],[389,4]]},"494":{"position":[[144,4],[410,4]]},"496":{"position":[[159,4],[427,4]]},"587":{"position":[[88,2],[295,2]]},"589":{"position":[[98,2],[331,2]]}}}],["2113931265",{"_index":982,"t":{"581":{"position":[[907,11]]}}}],["2119",{"_index":869,"t":{"449":{"position":[[71,5]]},"470":{"position":[[71,5]]},"537":{"position":[[71,5]]}}}],["2130",{"_index":867,"t":{"449":{"position":[[7,5]]},"470":{"position":[[7,5]]},"537":{"position":[[7,5]]}}}],["2131",{"_index":872,"t":{"449":{"position":[[123,5]]},"470":{"position":[[123,5]]},"537":{"position":[[123,5]]}}}],["2181036031",{"_index":983,"t":{"581":{"position":[[936,11]]}}}],["2282",{"_index":1150,"t":{"620":{"position":[[18,5]]}}}],["253",{"_index":996,"t":{"581":{"position":[[1296,4]]}}}],["2stabl",{"_index":161,"t":{"328":{"position":[[288,7],[296,7]]},"421":{"position":[[0,7]]},"423":{"position":[[0,7]]},"425":{"position":[[0,7]]},"427":{"position":[[0,7]]},"429":{"position":[[0,7]]},"608":{"position":[[1114,7]]},"616":{"position":[[17,7],[396,7],[748,7],[1155,7],[1492,7]]},"618":{"position":[[17,7],[351,7],[685,7],[1073,7],[1418,7]]}}}],["3",{"_index":43,"t":{"318":{"position":[[39,2]]},"328":{"position":[[277,2]]},"357":{"position":[[292,3]]},"362":{"position":[[511,1]]},"368":{"position":[[232,3],[354,3],[364,3],[549,3],[559,3]]},"376":{"position":[[388,1]]},"401":{"position":[[646,1]]},"583":{"position":[[2280,1]]},"596":{"position":[[1528,1]]},"598":{"position":[[1385,1]]},"600":{"position":[[1420,1]]},"602":{"position":[[1563,1]]},"610":{"position":[[2315,1]]},"612":{"position":[[1251,1]]}}}],["33",{"_index":992,"t":{"581":{"position":[[1261,3]]}}}],["3306",{"_index":734,"t":{"407":{"position":[[829,4]]},"435":{"position":[[163,5],[980,5],[1633,5]]},"441":{"position":[[219,5],[419,5]]},"451":{"position":[[178,4],[508,4]]},"462":{"position":[[189,5],[464,5]]},"472":{"position":[[166,4],[407,4]]},"529":{"position":[[242,5],[618,5]]},"539":{"position":[[174,4],[594,4]]}}}],["384",{"_index":994,"t":{"581":{"position":[[1279,4]]}}}],["3legaci",{"_index":1083,"t":{"608":{"position":[[1181,7]]}}}],["4",{"_index":763,"t":{"421":{"position":[[775,1]]},"423":{"position":[[393,1]]},"583":{"position":[[2132,1],[2159,1]]},"596":{"position":[[1400,1],[1422,1]]},"598":{"position":[[1257,1],[1279,1]]},"600":{"position":[[1292,1],[1314,1]]},"602":{"position":[[1435,1],[1457,1]]},"610":{"position":[[2167,1],[2194,1]]},"612":{"position":[[1123,1],[1145,1]]}}}],["4.5.2",{"_index":745,"t":{"410":{"position":[[222,8]]}}}],["45",{"_index":596,"t":{"388":{"position":[[408,3],[640,3],[941,4],[1144,4]]},"478":{"position":[[172,4],[426,4]]},"480":{"position":[[167,4],[447,4]]},"482":{"position":[[182,4],[464,4]]},"516":{"position":[[157,4],[392,4]]},"518":{"position":[[152,4],[413,4]]},"520":{"position":[[167,4],[430,4]]},"557":{"position":[[126,5],[342,5]]},"559":{"position":[[136,5],[378,5]]},"570":{"position":[[117,4],[319,4]]},"572":{"position":[[127,4],[355,4]]},"574":{"position":[[127,4],[374,4]]}}}],["5",{"_index":440,"t":{"360":{"position":[[80,3]]},"579":{"position":[[180,2],[369,2]]}}}],["5.6.10",{"_index":981,"t":{"581":{"position":[[773,9]]}}}],["53",{"_index":605,"t":{"390":{"position":[[643,3],[1023,4]]}}}],["6",{"_index":441,"t":{"360":{"position":[[84,3]]}}}],["6.9.0",{"_index":833,"t":{"435":{"position":[[2207,8]]}}}],["60000",{"_index":613,"t":{"392":{"position":[[480,6],[551,5],[908,6],[979,5]]}}}],["8",{"_index":929,"t":{"566":{"position":[[366,2]]},"581":{"position":[[853,2]]}}}],["8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":841,"t":{"443":{"position":[[193,43]]},"464":{"position":[[163,43]]},"531":{"position":[[216,43]]}}}],["8编码支持、二进制文件编码支持、压缩和ssl",{"_index":583,"t":{"384":{"position":[[42,24]]}}}],["_err",{"_index":754,"t":{"418":{"position":[[54,6],[148,6]]},"421":{"position":[[240,6],[377,6],[718,6],[853,6]]},"423":{"position":[[314,6]]},"425":{"position":[[493,6]]},"427":{"position":[[384,6]]},"429":{"position":[[704,6]]}}}],["a,b,c,d",{"_index":691,"t":{"403":{"position":[[31,7]]}}}],["a.j",{"_index":873,"t":{"451":{"position":[[44,4]]},"472":{"position":[[32,4]]},"539":{"position":[[40,4]]}}}],["abov",{"_index":526,"t":{"374":{"position":[[708,5]]},"392":{"position":[[1194,5],[1400,5],[1614,5],[1845,5]]}}}],["accept",{"_index":736,"t":{"407":{"position":[[976,6]]}}}],["access",{"_index":564,"t":{"380":{"position":[[76,6]]},"405":{"position":[[357,6]]},"414":{"position":[[57,7]]},"416":{"position":[[51,7]]},"583":{"position":[[637,7]]},"596":{"position":[[331,7]]},"598":{"position":[[331,7]]},"600":{"position":[[349,7]]},"602":{"position":[[349,7]]},"604":{"position":[[144,6]]},"610":{"position":[[655,7]]},"612":{"position":[[221,7]]}}}],["accord",{"_index":407,"t":{"355":{"position":[[2435,9]]}}}],["accordingli",{"_index":359,"t":{"355":{"position":[[760,12]]}}}],["ack",{"_index":474,"t":{"362":{"position":[[641,3]]}}}],["action",{"_index":190,"t":{"334":{"position":[[101,7],[238,7],[335,7],[530,7]]}}}],["activ",{"_index":1085,"t":{"608":{"position":[[1289,6]]}}}],["ad",{"_index":1135,"t":{"616":{"position":[[122,6]]}}}],["add(group",{"_index":907,"t":{"527":{"position":[[0,10]]},"529":{"position":[[0,10]]},"531":{"position":[[0,10]]},"533":{"position":[[0,10]]},"535":{"position":[[0,10]]},"539":{"position":[[0,10]]}}}],["addit",{"_index":216,"t":{"336":{"position":[[226,10]]},"353":{"position":[[251,8]]},"355":{"position":[[599,10]]},"357":{"position":[[245,10],[296,10]]},"372":{"position":[[3,8]]},"405":{"position":[[3,8]]},"407":{"position":[[905,8]]}}}],["addition",{"_index":631,"t":{"392":{"position":[[2043,13]]}}}],["address",{"_index":1094,"t":{"608":{"position":[[1520,10]]}}}],["advanc",{"_index":793,"t":{"433":{"position":[[80,8]]}}}],["affect",{"_index":1035,"t":{"583":{"position":[[2317,8]]},"610":{"position":[[2352,8]]}}}],["affectedrow",{"_index":285,"t":{"351":{"position":[[222,13]]},"425":{"position":[[242,12],[582,13]]},"427":{"position":[[478,13],[605,13]]},"429":{"position":[[793,13]]},"583":{"position":[[485,15]]},"610":{"position":[[503,15]]}}}],["ag",{"_index":595,"t":{"388":{"position":[[400,5],[619,5],[933,5],[1123,5]]},"390":{"position":[[616,5],[996,5]]},"394":{"position":[[342,5],[850,5]]},"478":{"position":[[106,6],[360,6]]},"480":{"position":[[101,6],[381,6]]},"482":{"position":[[116,6],[398,6]]},"492":{"position":[[97,5],[337,5]]},"494":{"position":[[92,5],[358,5]]},"496":{"position":[[107,5],[375,5]]},"516":{"position":[[121,5],[356,5]]},"518":{"position":[[116,5],[377,5]]},"520":{"position":[[131,5],[394,5]]},"557":{"position":[[89,6],[305,6]]},"559":{"position":[[99,6],[341,6]]},"570":{"position":[[109,5],[311,5]]},"572":{"position":[[119,5],[347,5]]},"574":{"position":[[119,5],[366,5]]},"587":{"position":[[80,5],[287,5]]},"589":{"position":[[90,5],[323,5]]}}}],["again",{"_index":426,"t":{"357":{"position":[[396,6]]},"456":{"position":[[244,6]]}}}],["aim",{"_index":206,"t":{"336":{"position":[[7,4]]}}}],["algorithm",{"_index":411,"t":{"355":{"position":[[2592,9]]}}}],["algoritm",{"_index":427,"t":{"357":{"position":[[502,9]]}}}],["allow",{"_index":123,"t":{"324":{"position":[[181,6]]}}}],["alongsid",{"_index":139,"t":{"326":{"position":[[90,9]]}}}],["alway",{"_index":239,"t":{"340":{"position":[[192,6]]},"355":{"position":[[1488,6],[2239,6]]},"583":{"position":[[1793,6]]},"610":{"position":[[1830,6]]}}}],["amazon",{"_index":852,"t":{"447":{"position":[[56,6],[113,6],[406,7],[762,7]]},"449":{"position":[[36,6],[138,6]]},"468":{"position":[[44,6],[101,6],[376,7],[801,7]]},"470":{"position":[[36,6],[138,6]]},"535":{"position":[[52,6],[109,6],[429,7],[962,7]]},"537":{"position":[[36,6],[138,6]]}}}],["anoth",{"_index":344,"t":{"355":{"position":[[372,7]]}}}],["answer",{"_index":1042,"t":{"604":{"position":[[22,7]]},"616":{"position":[[84,7]]},"618":{"position":[[84,7]]}}}],["api",{"_index":7,"t":{"312":{"position":[[128,4]]},"336":{"position":[[74,3]]},"355":{"position":[[1303,3]]},"372":{"position":[[79,3]]},"394":{"position":[[19,4]]},"606":{"position":[[29,17],[138,3]]}}}],["api文档来知道更多的api",{"_index":10,"t":{"314":{"position":[[26,31]]}}}],["appli",{"_index":25,"t":{"314":{"position":[[242,7]]}}}],["approach",{"_index":1068,"t":{"608":{"position":[[817,11]]}}}],["arg",{"_index":943,"t":{"566":{"position":[[772,5]]}}}],["argument",{"_index":27,"t":{"314":{"position":[[261,10]]},"347":{"position":[[89,9]]}}}],["arguments[1",{"_index":945,"t":{"566":{"position":[[941,13],[1149,13]]}}}],["arguments[2",{"_index":946,"t":{"566":{"position":[[965,13]]}}}],["array",{"_index":300,"t":{"351":{"position":[[536,5]]},"362":{"position":[[230,5],[318,5]]},"396":{"position":[[793,5],[802,6],[824,5]]},"401":{"position":[[398,5],[942,5]]},"403":{"position":[[139,5],[148,6]]},"421":{"position":[[11,5]]},"566":{"position":[[824,7],[840,7]]},"574":{"position":[[614,5]]}}}],["array.isarray(arguments[1",{"_index":944,"t":{"566":{"position":[[851,29]]}}}],["asc",{"_index":1021,"t":{"583":{"position":[[1558,4]]},"596":{"position":[[1107,3],[1161,3]]},"598":{"position":[[1078,5]]},"600":{"position":[[1115,5]]},"602":{"position":[[1144,3],[1198,3]]},"610":{"position":[[1595,4]]},"612":{"position":[[926,5]]}}}],["ascertain",{"_index":1076,"t":{"608":{"position":[[1045,9]]}}}],["ask",{"_index":331,"t":{"355":{"position":[[43,3]]},"396":{"position":[[915,3]]},"604":{"position":[[42,5]]}}}],["assur",{"_index":1048,"t":{"608":{"position":[[162,6]]}}}],["async",{"_index":527,"t":{"376":{"position":[[0,5],[224,5]]},"394":{"position":[[77,5],[982,5]]},"435":{"position":[[92,5],[1962,5]]},"583":{"position":[[616,6]]},"596":{"position":[[310,6]]},"598":{"position":[[310,6]]},"600":{"position":[[328,6]]},"602":{"position":[[328,6]]},"610":{"position":[[634,6]]},"612":{"position":[[296,6]]}}}],["asynchron",{"_index":357,"t":{"355":{"position":[[703,14]]}}}],["attach",{"_index":324,"t":{"353":{"position":[[499,6]]}}}],["auth",{"_index":333,"t":{"355":{"position":[[83,4],[801,4],[952,6],[1869,6]]},"357":{"position":[[702,5],[842,5],[982,5]]},"581":{"position":[[119,4]]}}}],["auth.doublesha1('pass123",{"_index":967,"t":{"581":{"position":[[235,27]]}}}],["auth.verifytoken",{"_index":969,"t":{"581":{"position":[[279,17]]}}}],["authcallback",{"_index":984,"t":{"581":{"position":[[948,13]]}}}],["authent",{"_index":221,"t":{"336":{"position":[[283,14]]},"355":{"position":[[211,14],[610,14]]},"357":{"position":[[34,14],[159,14],[256,14],[412,14]]},"581":{"position":[[962,13]]},"606":{"position":[[262,14]]}}}],["authenticate(param",{"_index":964,"t":{"581":{"position":[[169,20]]}}}],["authentication::native41",{"_index":408,"t":{"355":{"position":[[2448,24]]}}}],["authnextfactor",{"_index":418,"t":{"357":{"position":[[90,14]]}}}],["author",{"_index":829,"t":{"435":{"position":[[2144,9]]}}}],["authplugin",{"_index":335,"t":{"355":{"position":[[103,11],[928,12],[2480,11]]},"357":{"position":[[661,12]]}}}],["authswitchhandl",{"_index":381,"t":{"355":{"position":[[1318,17],[1778,18],[2508,17]]}}}],["authswitchrequest",{"_index":397,"t":{"355":{"position":[[2130,17]]}}}],["auto",{"_index":102,"t":{"322":{"position":[[709,4]]}}}],["auto_incr",{"_index":1011,"t":{"583":{"position":[[993,15]]},"596":{"position":[[713,15]]},"598":{"position":[[687,15]]},"600":{"position":[[724,15]]},"602":{"position":[[750,15]]},"610":{"position":[[1030,15]]},"612":{"position":[[548,15]]}}}],["automat",{"_index":621,"t":{"392":{"position":[[1289,13],[1496,13]]},"579":{"position":[[270,13]]}}}],["avail",{"_index":154,"t":{"328":{"position":[[237,9]]},"407":{"position":[[1080,10]]},"478":{"position":[[758,9]]},"480":{"position":[[807,9]]},"482":{"position":[[824,9]]},"492":{"position":[[730,9]]},"494":{"position":[[779,9]]},"496":{"position":[[796,9]]},"504":{"position":[[704,9]]},"506":{"position":[[753,9]]},"508":{"position":[[770,9]]},"516":{"position":[[639,9]]},"518":{"position":[[688,9]]},"520":{"position":[[705,9]]},"546":{"position":[[627,9]]},"548":{"position":[[691,9]]},"557":{"position":[[665,9]]},"559":{"position":[[729,9]]},"570":{"position":[[556,9]]},"572":{"position":[[620,9]]},"574":{"position":[[667,9]]},"587":{"position":[[647,9]]},"589":{"position":[[711,9]]},"608":{"position":[[1330,10]]}}}],["avg",{"_index":23,"t":{"314":{"position":[[221,5]]}}}],["avoid",{"_index":30,"t":{"314":{"position":[[301,5]]}}}],["await",{"_index":529,"t":{"376":{"position":[[82,5],[155,5],[204,5],[398,5],[516,5]]},"378":{"position":[[356,5]]},"388":{"position":[[201,5],[327,5],[551,5]]},"390":{"position":[[400,5],[546,5]]},"392":{"position":[[1223,5],[1633,5],[1697,5]]},"394":{"position":[[145,5],[272,5],[634,5],[780,5],[1255,5]]},"396":{"position":[[173,5],[445,5]]},"435":{"position":[[126,5],[292,5],[373,5],[675,5],[930,5],[1183,5],[1364,5],[2007,7]]},"439":{"position":[[124,5]]},"441":{"position":[[128,5]]},"443":{"position":[[128,5]]},"445":{"position":[[146,5]]},"447":{"position":[[315,5],[488,5],[547,5]]},"460":{"position":[[194,5]]},"462":{"position":[[235,5]]},"464":{"position":[[239,5]]},"466":{"position":[[334,5]]},"468":{"position":[[413,5],[545,5],[604,5]]},"478":{"position":[[202,5]]},"480":{"position":[[197,5]]},"482":{"position":[[212,5]]},"492":{"position":[[188,5]]},"494":{"position":[[183,5]]},"496":{"position":[[198,5]]},"504":{"position":[[175,5]]},"506":{"position":[[170,5]]},"508":{"position":[[185,5]]},"516":{"position":[[185,5]]},"518":{"position":[[180,5]]},"520":{"position":[[195,5]]},"527":{"position":[[286,5]]},"529":{"position":[[327,5]]},"531":{"position":[[331,5]]},"533":{"position":[[426,5]]},"535":{"position":[[505,5],[654,5],[713,5]]},"546":{"position":[[138,5]]},"548":{"position":[[148,5]]},"557":{"position":[[157,5]]},"559":{"position":[[167,5]]},"570":{"position":[[145,5]]},"572":{"position":[[155,5]]},"574":{"position":[[155,5]]},"583":{"position":[[731,5],[817,5],[922,5],[1101,5],[1337,5],[1454,5],[1618,5],[2083,5]]},"587":{"position":[[148,5]]},"589":{"position":[[158,5]]},"596":{"position":[[451,5],[537,5],[642,5],[821,5],[1038,5],[1351,5]]},"598":{"position":[[425,5],[511,5],[616,5],[795,5],[1013,5],[1208,5]]},"600":{"position":[[462,5],[548,5],[653,5],[832,5],[1050,5],[1243,5]]},"602":{"position":[[488,5],[574,5],[679,5],[858,5],[1075,5],[1386,5]]},"610":{"position":[[768,5],[854,5],[959,5],[1138,5],[1374,5],[1491,5],[1655,5],[2118,5]]},"612":{"position":[[392,5],[487,5],[656,5],[864,5],[1062,5]]},"618":{"position":[[205,5],[573,5],[930,5],[1182,5],[1525,5]]}}}],["await.j",{"_index":799,"t":{"435":{"position":[[0,8],[2062,11]]}}}],["b",{"_index":98,"t":{"322":{"position":[[622,1]]},"403":{"position":[[197,1]]}}}],["b.j",{"_index":874,"t":{"451":{"position":[[49,4]]},"472":{"position":[[37,4]]},"539":{"position":[[45,4]]}}}],["babel",{"_index":832,"t":{"435":{"position":[[2194,6]]}}}],["babelrc",{"_index":801,"t":{"435":{"position":[[15,8]]}}}],["back",{"_index":355,"t":{"355":{"position":[[659,4]]}}}],["backend",{"_index":574,"t":{"382":{"position":[[118,8],[166,8]]}}}],["backward",{"_index":1049,"t":{"608":{"position":[[169,8],[281,8]]}}}],["badg",{"_index":148,"t":{"328":{"position":[[18,6]]},"608":{"position":[[14,6]]}}}],["bar",{"_index":516,"t":{"374":{"position":[[241,6],[528,6]]},"407":{"position":[[730,6]]}}}],["base",{"_index":506,"t":{"372":{"position":[[73,5]]},"608":{"position":[[983,5]]}}}],["basic",{"_index":797,"t":{"433":{"position":[[608,5]]}}}],["befor",{"_index":204,"t":{"334":{"position":[[474,6]]},"612":{"position":[[1651,6]]}}}],["begin",{"_index":787,"t":{"429":{"position":[[551,5]]},"583":{"position":[[1518,5]]},"610":{"position":[[1555,5]]}}}],["behavior",{"_index":317,"t":{"353":{"position":[[363,8]]}}}],["below",{"_index":918,"t":{"544":{"position":[[13,5]]},"555":{"position":[[13,5]]},"568":{"position":[[13,5]]},"585":{"position":[[13,5]]}}}],["benchmark",{"_index":258,"t":{"344":{"position":[[63,10],[85,10],[115,10]]}}}],["beta",{"_index":990,"t":{"581":{"position":[[1222,7],[1239,7]]}}}],["better",{"_index":212,"t":{"336":{"position":[[168,6]]},"360":{"position":[[449,6]]},"456":{"position":[[334,6]]}}}],["between",{"_index":415,"t":{"355":{"position":[[2648,7]]},"410":{"position":[[107,7]]}}}],["bin.000007",{"_index":671,"t":{"398":{"position":[[311,12]]}}}],["binari",{"_index":226,"t":{"336":{"position":[[362,6]]},"351":{"position":[[584,6]]}}}],["bind",{"_index":251,"t":{"342":{"position":[[99,8],[173,8]]},"366":{"position":[[4,4]]}}}],["binlog",{"_index":256,"t":{"342":{"position":[[249,6]]}}}],["binlogpo",{"_index":672,"t":{"398":{"position":[[324,10]]}}}],["binlogstream",{"_index":661,"t":{"398":{"position":[[100,12]]}}}],["binlogstream.pip",{"_index":675,"t":{"398":{"position":[[381,18]]}}}],["blob",{"_index":389,"t":{"355":{"position":[[1607,4]]}}}],["block",{"_index":168,"t":{"330":{"position":[[176,6]]},"398":{"position":[[362,8]]},"618":{"position":[[137,6],[435,6],[769,6],[1154,6],[1497,6]]}}}],["bluebird",{"_index":638,"t":{"394":{"position":[[519,8],[535,8],[549,11],[595,8],[725,9]]}}}],["boolean",{"_index":309,"t":{"353":{"position":[[146,7]]},"366":{"position":[[105,7]]}}}],["both",{"_index":1144,"t":{"616":{"position":[[1417,4],[1748,4]]},"618":{"position":[[1343,4],[1682,4]]}}}],["bound",{"_index":1051,"t":{"608":{"position":[[230,5]]}}}],["branch",{"_index":64,"t":{"322":{"position":[[154,6]]}}}],["browser",{"_index":80,"t":{"322":{"position":[[399,7]]}}}],["buffer",{"_index":353,"t":{"355":{"position":[[630,8],[1667,8]]},"366":{"position":[[222,6]]}}}],["buffer.from",{"_index":840,"t":{"443":{"position":[[180,12]]},"464":{"position":[[150,12]]},"531":{"position":[[203,12]]}}}],["buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":843,"t":{"443":{"position":[[384,55]]},"464":{"position":[[429,55]]},"531":{"position":[[583,55]]}}}],["bug",{"_index":1093,"t":{"608":{"position":[[1488,4]]}}}],["build",{"_index":197,"t":{"334":{"position":[[266,5],[306,5]]}}}],["built",{"_index":40,"t":{"318":{"position":[[16,5]]}}}],["bun",{"_index":871,"t":{"449":{"position":[[119,3]]},"470":{"position":[[119,3]]},"537":{"position":[[119,3]]}}}],["byte",{"_index":313,"t":{"353":{"position":[[242,5]]}}}],["bytes/sec",{"_index":722,"t":{"407":{"position":[[240,9]]}}}],["c",{"_index":548,"t":{"378":{"position":[[83,1]]},"390":{"position":[[635,1],[1015,1]]},"403":{"position":[[214,1]]},"435":{"position":[[122,1],[1592,1]]}}}],["c.end",{"_index":558,"t":{"378":{"position":[[310,8]]},"435":{"position":[[936,8],[1824,8]]}}}],["c.execute('select",{"_index":554,"t":{"378":{"position":[[251,17]]},"435":{"position":[[484,17],[569,17],[695,17],[727,17],[1765,17]]}}}],["c.query('show",{"_index":551,"t":{"378":{"position":[[187,13]]},"435":{"position":[[298,13],[1701,13]]}}}],["c.query('som",{"_index":805,"t":{"435":{"position":[[379,13]]}}}],["ca",{"_index":849,"t":{"445":{"position":[[294,3],[575,3]]},"447":{"position":[[202,2],[214,2]]},"449":{"position":[[153,2]]},"466":{"position":[[264,3],[620,3]]},"468":{"position":[[190,2],[202,2]]},"470":{"position":[[153,2]]},"533":{"position":[[317,3],[774,3]]},"535":{"position":[[198,2],[210,2]]},"537":{"position":[[153,2]]}}}],["cach",{"_index":445,"t":{"360":{"position":[[215,6],[256,6],[322,5],[416,5],[480,5]]},"362":{"position":[[52,5]]},"364":{"position":[[36,6],[63,6],[173,5]]},"456":{"position":[[280,5]]}}}],["call",{"_index":350,"t":{"355":{"position":[[520,4],[560,4],[1549,5],[2556,6]]},"360":{"position":[[209,5]]},"429":{"position":[[88,4],[628,5],[1032,5]]}}}],["callback",{"_index":297,"t":{"351":{"position":[[453,9]]},"355":{"position":[[1443,9]]},"362":{"position":[[598,8]]},"388":{"position":[[116,8]]},"390":{"position":[[317,8]]},"392":{"position":[[185,8],[1147,8],[1573,8]]},"396":{"position":[[151,8],[404,8]]}}}],["callback'",{"_index":1137,"t":{"616":{"position":[[470,10],[822,10],[1226,10],[1561,10]]}}}],["callback(nul",{"_index":391,"t":{"355":{"position":[[1646,14]]}}}],["callback.j",{"_index":836,"t":{"439":{"position":[[51,11]]},"441":{"position":[[55,11]]},"443":{"position":[[55,11]]},"445":{"position":[[55,11]]},"447":{"position":[[242,11]]},"460":{"position":[[45,11]]},"462":{"position":[[43,11]]},"464":{"position":[[43,11]]},"466":{"position":[[43,11]]},"468":{"position":[[230,11]]},"478":{"position":[[47,11]]},"480":{"position":[[42,11]]},"482":{"position":[[57,11]]},"492":{"position":[[47,11]]},"494":{"position":[[42,11]]},"496":{"position":[[57,11]]},"504":{"position":[[47,11]]},"506":{"position":[[42,11]]},"508":{"position":[[57,11]]},"516":{"position":[[47,11]]},"518":{"position":[[42,11]]},"520":{"position":[[57,11]]},"527":{"position":[[53,11]]},"529":{"position":[[51,11]]},"531":{"position":[[51,11]]},"533":{"position":[[51,11]]},"535":{"position":[[238,11]]},"546":{"position":[[30,11]]},"548":{"position":[[40,11]]},"557":{"position":[[30,11]]},"559":{"position":[[40,11]]},"570":{"position":[[30,11]]},"572":{"position":[[40,11]]},"574":{"position":[[40,11]]},"587":{"position":[[30,11]]},"589":{"position":[[40,11]]}}}],["candid",{"_index":1072,"t":{"608":{"position":[[859,9]]}}}],["capabilityflag",{"_index":277,"t":{"351":{"position":[[91,15]]},"566":{"position":[[369,16]]},"581":{"position":[[859,16],[889,16],[919,16]]}}}],["case",{"_index":383,"t":{"355":{"position":[[1461,5]]},"407":{"position":[[352,4]]},"447":{"position":[[148,4]]},"468":{"position":[[136,4]]},"535":{"position":[[144,4]]}}}],["catalog",{"_index":986,"t":{"581":{"position":[[1139,8]]}}}],["catch",{"_index":599,"t":{"388":{"position":[[484,5],[671,5]]},"390":{"position":[[719,5]]},"392":{"position":[[1334,5]]},"396":{"position":[[592,5]]},"435":{"position":[[415,5]]},"439":{"position":[[203,5]]},"441":{"position":[[248,5]]},"443":{"position":[[252,5]]},"445":{"position":[[347,5]]},"447":{"position":[[426,5],[591,5]]},"460":{"position":[[264,5]]},"462":{"position":[[305,5]]},"464":{"position":[[309,5]]},"466":{"position":[[404,5]]},"468":{"position":[[483,5],[642,5]]},"478":{"position":[[285,5]]},"480":{"position":[[306,5]]},"482":{"position":[[323,5]]},"492":{"position":[[271,5]]},"494":{"position":[[292,5]]},"496":{"position":[[309,5]]},"504":{"position":[[258,5]]},"506":{"position":[[279,5]]},"508":{"position":[[296,5]]},"516":{"position":[[266,5]]},"518":{"position":[[287,5]]},"520":{"position":[[304,5]]},"527":{"position":[[373,5]]},"529":{"position":[[414,5]]},"531":{"position":[[418,5]]},"533":{"position":[[513,5]]},"535":{"position":[[592,5],[758,5]]},"546":{"position":[[211,5]]},"548":{"position":[[247,5]]},"557":{"position":[[230,5]]},"559":{"position":[[266,5]]},"570":{"position":[[216,5]]},"572":{"position":[[252,5]]},"574":{"position":[[271,5]]},"587":{"position":[[221,5]]},"589":{"position":[[257,5]]},"618":{"position":[[131,5],[276,5],[429,5],[603,5],[763,5],[974,5],[1148,5],[1244,5],[1491,5],[1585,5]]}}}],["catch((err",{"_index":375,"t":{"355":{"position":[[1176,12]]},"374":{"position":[[620,12]]},"435":{"position":[[1426,12]]}}}],["catch(console.log",{"_index":647,"t":{"394":{"position":[[1607,19]]}}}],["catch(funct",{"_index":825,"t":{"435":{"position":[[1880,15]]}}}],["caus",{"_index":1088,"t":{"608":{"position":[[1407,5]]}}}],["caution",{"_index":109,"t":{"322":{"position":[[816,7]]},"608":{"position":[[387,7]]}}}],["cb",{"_index":392,"t":{"355":{"position":[[1835,3]]},"407":{"position":[[754,4]]},"581":{"position":[[190,3]]}}}],["cb(err",{"_index":399,"t":{"355":{"position":[[2196,8]]}}}],["cb(null",{"_index":394,"t":{"355":{"position":[[2065,8]]},"407":{"position":[[874,8]]},"581":{"position":[[391,9],[455,8]]}}}],["cd",{"_index":68,"t":{"322":{"position":[[189,2],[643,2]]}}}],["cert",{"_index":848,"t":{"445":{"position":[[245,5],[526,5]]},"447":{"position":[[217,4]]},"449":{"position":[[26,5],[156,4]]},"466":{"position":[[215,5],[571,5]]},"468":{"position":[[205,4]]},"470":{"position":[[26,5],[156,4]]},"533":{"position":[[268,5],[725,5]]},"535":{"position":[[213,4]]},"537":{"position":[[26,5],[156,4]]}}}],["cert.pem",{"_index":845,"t":{"445":{"position":[[76,8],[283,10],[326,11],[564,10],[607,11]]},"447":{"position":[[205,8]]},"466":{"position":[[64,8],[253,10],[296,11],[609,10],[652,11]]},"468":{"position":[[193,8]]},"533":{"position":[[72,8],[306,10],[349,11],[763,10],[806,11]]},"535":{"position":[[201,8]]}}}],["certs/ca",{"_index":844,"t":{"445":{"position":[[67,8]]},"466":{"position":[[55,8]]},"533":{"position":[[63,8]]}}}],["chang",{"_index":82,"t":{"322":{"position":[[420,7]]},"326":{"position":[[39,7],[106,8],[211,8],[227,6],[303,7],[343,7],[363,6]]},"425":{"position":[[24,7]]},"427":{"position":[[24,7]]},"429":{"position":[[24,7]]},"608":{"position":[[301,7],[471,7],[747,8],[930,7]]}}}],["changedrow",{"_index":769,"t":{"425":{"position":[[148,11],[657,12]]},"427":{"position":[[554,12],[680,12]]},"429":{"position":[[868,12]]},"583":{"position":[[554,14]]},"610":{"position":[[572,14]]}}}],["changeus",{"_index":476,"t":{"362":{"position":[[749,13]]},"407":{"position":[[963,12]]}}}],["characterset",{"_index":276,"t":{"351":{"position":[[77,13]]},"566":{"position":[[352,13]]},"581":{"position":[[839,13],[1247,13]]}}}],["check",{"_index":183,"t":{"334":{"position":[[13,5],[119,5],[158,6]]},"338":{"position":[[7,5]]},"340":{"position":[[57,5]]},"418":{"position":[[374,5]]},"433":{"position":[[13,5],[372,8],[477,8]]}}}],["checkout",{"_index":97,"t":{"322":{"position":[[612,8]]}}}],["ci",{"_index":71,"t":{"322":{"position":[[240,2],[679,2]]}}}],["class",{"_index":798,"t":{"433":{"position":[[628,5]]},"612":{"position":[[1428,5],[1669,5]]}}}],["classif",{"_index":1079,"t":{"608":{"position":[[1098,15]]}}}],["classifi",{"_index":1062,"t":{"608":{"position":[[618,10],[1354,10]]}}}],["clear",{"_index":196,"t":{"334":{"position":[[256,5],[292,5]]}}}],["cli",{"_index":92,"t":{"322":{"position":[[541,3]]},"435":{"position":[[2201,5]]}}}],["client",{"_index":229,"t":{"336":{"position":[[382,6]]},"342":{"position":[[68,6],[143,7],[220,6]]},"351":{"position":[[276,6],[383,7]]},"353":{"position":[[318,7]]},"355":{"position":[[51,6],[1577,6],[2656,6]]},"357":{"position":[[68,6]]},"382":{"position":[[237,6],[281,6]]},"401":{"position":[[171,6]]}}}],["clientflag",{"_index":921,"t":{"566":{"position":[[62,11]]}}}],["clientflags.compress",{"_index":931,"t":{"566":{"position":[[397,21]]}}}],["clientplugindata(password1",{"_index":434,"t":{"357":{"position":[[789,27]]}}}],["clientplugindata(password2",{"_index":436,"t":{"357":{"position":[[929,27]]}}}],["clientplugindata(password3",{"_index":438,"t":{"357":{"position":[[1069,27]]}}}],["clone",{"_index":95,"t":{"322":{"position":[[557,5]]}}}],["close",{"_index":321,"t":{"353":{"position":[[405,5]]},"360":{"position":[[250,5]]},"362":{"position":[[72,6],[635,5]]},"364":{"position":[[187,7]]},"608":{"position":[[895,5]]}}}],["co",{"_index":545,"t":{"378":{"position":[[39,2],[353,2]]},"435":{"position":[[1548,2],[2004,2]]}}}],["co(funct",{"_index":547,"t":{"378":{"position":[[59,12]]},"435":{"position":[[1568,12]]}}}],["co.j",{"_index":800,"t":{"435":{"position":[[9,5]]}}}],["code",{"_index":167,"t":{"330":{"position":[[171,4]]},"353":{"position":[[230,4]]},"355":{"position":[[821,4]]},"433":{"position":[[24,4]]},"449":{"position":[[98,4]]},"470":{"position":[[98,4]]},"537":{"position":[[98,4]]},"581":{"position":[[425,5],[498,5],[683,5]]}}}],["column",{"_index":460,"t":{"362":{"position":[[239,6],[334,6],[480,8]]},"566":{"position":[[832,7],[955,7],[1029,9],[1066,9]]}}}],["columnlength",{"_index":993,"t":{"581":{"position":[[1265,13]]}}}],["columntyp",{"_index":995,"t":{"581":{"position":[[1284,11]]}}}],["come",{"_index":454,"t":{"362":{"position":[[37,5]]}}}],["command",{"_index":203,"t":{"334":{"position":[[466,7]]},"351":{"position":[[203,8]]},"353":{"position":[[6,7],[162,7],[222,7],[291,8]]},"435":{"position":[[842,8]]},"608":{"position":[[547,7]]}}}],["commandcod",{"_index":310,"t":{"353":{"position":[[190,13]]}}}],["commit",{"_index":205,"t":{"334":{"position":[[495,7]]}}}],["commonli",{"_index":1043,"t":{"604":{"position":[[33,8]]}}}],["compat",{"_index":169,"t":{"330":{"position":[[187,10]]},"449":{"position":[[103,10]]},"470":{"position":[[103,10]]},"537":{"position":[[103,10]]},"608":{"position":[[178,14],[290,10],[1122,13]]}}}],["compil",{"_index":120,"t":{"324":{"position":[[121,8]]},"382":{"position":[[101,9]]}}}],["complet",{"_index":88,"t":{"322":{"position":[[500,8]]},"324":{"position":[[52,8]]}}}],["complianc",{"_index":187,"t":{"334":{"position":[[49,10]]}}}],["compon",{"_index":114,"t":{"324":{"position":[[12,9],[165,11],[273,10]]},"326":{"position":[[12,9],[285,10]]},"328":{"position":[[203,10]]},"330":{"position":[[121,9],[229,10]]},"334":{"position":[[173,10]]}}}],["compress",{"_index":225,"t":{"336":{"position":[[350,11]]}}}],["concept",{"_index":794,"t":{"433":{"position":[[89,9]]}}}],["config",{"_index":242,"t":{"340":{"position":[[239,6]]},"355":{"position":[[126,6],[345,6],[1347,6]]},"357":{"position":[[354,6]]},"401":{"position":[[75,6]]},"529":{"position":[[19,7]]},"531":{"position":[[19,7]]},"533":{"position":[[19,7]]},"535":{"position":[[19,7]]},"539":{"position":[[19,7]]}}}],["confirm",{"_index":1133,"t":{"616":{"position":[[59,9]]},"618":{"position":[[59,9]]}}}],["conn",{"_index":364,"t":{"355":{"position":[[832,4],[1682,4]]},"357":{"position":[[518,4]]},"376":{"position":[[75,4]]},"392":{"position":[[1626,4],[1885,5]]},"394":{"position":[[1435,4],[1522,4]]},"396":{"position":[[166,4],[284,4]]},"414":{"position":[[128,4]]},"416":{"position":[[116,4]]},"421":{"position":[[107,4],[552,4]]},"423":{"position":[[124,4]]},"425":{"position":[[363,4]]},"427":{"position":[[214,4]]},"429":{"position":[[341,4]]},"566":{"position":[[201,6]]},"581":{"position":[[599,6]]},"583":{"position":[[724,4]]},"596":{"position":[[444,4]]},"598":{"position":[[418,4]]},"600":{"position":[[455,4]]},"602":{"position":[[481,4]]},"610":{"position":[[761,4]]},"612":{"position":[[1450,5]]}}}],["conn.clos",{"_index":980,"t":{"581":{"position":[[700,13],[1482,13]]}}}],["conn.end",{"_index":531,"t":{"376":{"position":[[210,11]]},"394":{"position":[[1639,12]]},"583":{"position":[[2089,11]]},"596":{"position":[[1357,11]]},"598":{"position":[[1214,11]]},"600":{"position":[[1249,11]]},"602":{"position":[[1392,11]]},"610":{"position":[[2124,11]]}}}],["conn.execute('select",{"_index":530,"t":{"376":{"position":[[161,20]]},"418":{"position":[[108,20]]}}}],["conn.execute>(sql",{"_index":788,"t":{"429":{"position":[[650,53]]}}}],["conn.query>('cal",{"_index":1023,"t":{"583":{"position":[[1624,45]]},"610":{"position":[[1661,45]]}}}],["conn.query('drop",{"_index":1007,"t":{"583":{"position":[[823,33],[1343,33]]},"596":{"position":[[543,33]]},"598":{"position":[[517,33]]},"600":{"position":[[554,33]]},"602":{"position":[[580,33]]},"610":{"position":[[860,33],[1380,33]]}}}],["conn.query(sql",{"_index":774,"t":{"425":{"position":[[460,32]]}}}],["conn.query(sql",{"_index":780,"t":{"427":{"position":[[349,34]]}}}],["conn.query('select",{"_index":759,"t":{"421":{"position":[[185,35]]}}}],["conn.query('show",{"_index":760,"t":{"421":{"position":[[321,33],[797,33]]}}}],["conn.query(sql",{"_index":765,"t":{"423":{"position":[[279,34]]}}}],["conn.query 45' ); console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } catch (err) { console.log(err); } // 使用占位符 try { const [results] = await connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45] ); console.log(results); } catch (err) { console.log(err); } // 导入模块 const mysql = require('mysql2'); // 创建一个数据库连接 const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // 简单查询 connection.query( 'SELECT * FROM `table` WHERE `name` = \"Page\" AND `age` > 45', function (err, results, fields) { console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } ); // 使用占位符 connection.query( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Page', 45], function (err, results) { console.log(results); } );","s":"查询数据","u":"/node-mysql2/zh-CN/docs","h":"#查询数据","p":311},{"i":318,"t":"使用 MySQL2,您还可以提前准备好SQL预处理语句。 使用准备好的SQL预处理语句,MySQL 不必每次都为相同的查询做准备,这会带来更好的性能。 如果您不知道为什么它们很重要,请查看这些讨论: 如何防止预处理语句SQL注入攻击 MySQL2 提供了 execute 辅助函数,它将准备和查询语句。 您还可以使用 prepare / unprepare 方法手动准备/取消准备。 To explore more Prepared Statements and Placeholders examples, please visit the example section Prepared Statements. Promise Callback import mysql from 'mysql2/promise'; try { // 创建一个数据库连接 const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute 将在内部调用 prepare 和 query const [results, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53] ); console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } catch (err) { console.log(err); } const mysql = require('mysql2'); // 创建一个数据库连接 const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // execute 将在内部调用 prepare 和 query connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Rick C-137', 53], function (err, results, fields) { console.log(results); // 结果集 console.log(fields); // 额外的元数据(如果有的话) } ); 提示 如果再次执行相同的语句,他将从缓存中选取,这能有效的节省准备查询时间获得更好的性能。","s":"SQL预处理的使用","u":"/node-mysql2/zh-CN/docs","h":"#sql预处理的使用","p":311},{"i":320,"t":"连接池通过重用以前的连接来帮助减少连接到 MySQL 服务器所花费的时间,当你完成它们时让它们保持打开而不是关闭。 这改善了查询的延迟,因为您避免了建立新连接所带来的所有开销。 To explore more Connection Pools examples, please visit the example section createPool. Promise Callback import mysql from 'mysql2/promise'; // 创建连接池,设置连接池的参数 const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); const mysql = require('mysql2'); // 创建连接池,设置连接池的参数 const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', waitForConnections: true, connectionLimit: 10, maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit` idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000 queueLimit: 0, enableKeepAlive: true, keepAliveInitialDelay: 0, }); 备注 该池不会预先创建所有连接,而是根据需要创建它们,直到达到连接限制。 您可以像直接连接一样使用池(使用 pool.query() 和 pool.execute()): Promise Callback try { // For pool initialization, see above const [rows, fields] = await pool.query('SELECT `field` FROM `table`'); // Connection is automatically released when query resolves } catch (err) { console.log(err); } // For pool initialization, see above pool.query('SELECT `field` FROM `table`', function (err, rows, fields) { // Connection is automatically released when query resolves }); 或者,也可以手动从池中获取连接并稍后返回: Promise Callback // For pool initialization, see above const conn = await pool.getConnection(); // Do something with the connection await conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); // For pool initialization, see above pool.getConnection(function (err, conn) { // Do something with the connection conn.query(/* ... */); // Don't forget to release the connection when finished! pool.releaseConnection(conn); }); Additionally, directly release the connection using the connection object: conn.release();","s":"连接池的使用","u":"/node-mysql2/zh-CN/docs","h":"#using-connection-pools","p":311},{"i":322,"t":"MySQL2 也支持 Promise API。 这与 ES7 异步等待非常有效。 import mysql from 'mysql2/promise'; async function main() { // create the connection const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); } MySQL2 使用范围内可用的默认 Promise 对象。 但是你可以选择你想使用的 Promise 实现。 // 导入模块 import mysql from 'mysql2/promise'; // get the promise implementation, we will use bluebird import bluebird from 'bluebird'; // create the connection, specify bluebird as Promise const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', Promise: bluebird, }); // query database const [rows, fields] = await connection.execute( 'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14] ); MySQL2 还在 Pools 上公开了一个 .promise()函数,因此您可以从同一个池创建一个 promise/non-promise 连接。 import mysql from 'mysql2'; async function main() { // create the pool const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', }); // now get a Promise wrapped instance of that pool const promisePool = pool.promise(); // query database using promises const [rows, fields] = await promisePool.query('SELECT 1'); } MySQL2 在 Connections 上公开了一个 .promise()函数,以“升级”现有的 non-promise 连接以使用 Promise。 const mysql = require('mysql2'); // create the connection const conn = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', }); conn .promise() .query('SELECT 1') .then(([rows, fields]) => { console.log(rows); }) .catch(console.log) .then(() => conn.end());","s":"Promise封装","u":"/node-mysql2/zh-CN/docs","h":"#promise封装","p":311},{"i":324,"t":"如果你有两个相同名称的列,你可能希望以数组而不是对象的形式获取结果,为了防止冲突,这是与 Node MySQL 库的区别。 例如: SELECT 1 AS `foo`, 2 AS `foo`. 您可以在连接级别(适用于所有查询)或查询级别(仅适用于该特定查询)启用此设置。 连接级别​ Promise Callback const conn = await mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); const conn = mysql.createConnection({ host: 'localhost', database: 'test', user: 'root', rowsAsArray: true, }); 查询级别​ Promise Callback try { const [results, fields] = await conn.query({ sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }); console.log(results); // 返回数组而不是数组对象 console.log(fields); // 无变化 } catch (err) { console.log(err); } conn.query( { sql: 'SELECT 1 AS `foo`, 2 AS `foo`', rowsAsArray: true, }, function (err, results, fields) { console.log(results); // in this query, results will be an array of arrays rather than an array of objects console.log(fields); // fields are unchanged } ); Getting Help Need help? Ask your question on Stack Overflow or GitHub. If you've encountered an issue, please file it on GitHub.","s":"结果返回","u":"/node-mysql2/zh-CN/docs","h":"#结果返回","p":311},{"i":326,"t":"内部协议由@sidorares编写 MySQL-Native 常量、SQL参数插值、连接池、ConnectionConfig 类取自node-mysql 基于@TooTallNate的SSL代码升级代码地址 与MariaSQL客户端兼容安全连接/压缩连接 API。 贡献者","s":"鸣谢","u":"/node-mysql2/zh-CN/docs/acknowledgements","h":"","p":325},{"i":328,"t":"MySQL2大部分的API与 Node MySQL 基本上相同,你应该查看他们的API文档来知道更多的API选项。 One known incompatibility is that DECIMAL values are returned as strings whereas in Node MySQL they are returned as numbers. This includes the result of SUM() and AVG() functions when applied to INTEGER arguments. This is done deliberately to avoid loss of precision - see https://github.com/sidorares/node-mysql2/issues/935. 信息 如果您发现与 Node MySQL 的任何不兼容问题,请通过issue报告。 我们将优先修复报告的不兼容问题。","s":"API配置项","u":"/node-mysql2/zh-CN/docs/api-and-configurations","h":"","p":327},{"i":330,"t":"如果要为node-mysql2做些贡献.请查阅 Contributing.md 来获得更多详细信息。","s":"贡献","u":"/node-mysql2/zh-CN/docs/contributing","h":"","p":329},{"i":332,"t":"This website is built using Docusaurus 3, a modern static website generator.","s":"Website Contributing Guidelines","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"","p":331},{"i":334,"t":"You will need these tools installed on your system: Node.js (18.x or higher)","s":"Environment","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#environment","p":331},{"i":336,"t":"Fork the MySQL2 repository. Download your forked repository locally. The website's workspace is the \"website\" directory in node-mysql2 root. Create a new branch from master (optional). Run cd website to enter the website workspace. Run npm ci to install the dependecies from package-lock.json. Run npm start to starting the local development. It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. For Docusaurus complete documentation, please see here. CLI example git clone https://github.com/sidorares/node-mysql2.git git checkout -b website # optional cd /path-to/node-mysql2/website npm ci npm start Documentation is auto-generated from MDX files placed in these directories: ./docs/documentation ./docs/examples ./docs/faq Caution Note that the website has its own package.json. Please, do not install dependencies for the website in node-mysql2 root.","s":"Development","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#development","p":331},{"i":338,"t":"Every extra component is thoroughly documented with complete typings descriptions. Docusaurus Markdown Features: The MDX compiler transforms Markdown files to React components, and allows you to use JSX in your Markdown content. This enables you to easily interleave React components within your content, and create delightful learning experiences.","s":"Extras Components","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#extras-components","p":331},{"i":340,"t":"The History component displays version changes in a table format, listing version numbers alongside their changes. import { History } from '@site/src/components/History'; 提示 You can also utilize React components in the changes option. Example History Version Changes v1.0.0 Some change message.","s":"History","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#history","p":331},{"i":342,"t":"See the Stability Badges for more detais. import { Stability } from '@site/src/components/Stability'; 提示 You can also utilize React components in the message option. Available levels: 0, 1, 1.1, 1.2, 2 and 3. Example 2Stable 2Stable Some message.","s":"Stability","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#stability","p":331},{"i":344,"t":"import { FAQ } from '@site/src/components/FAQ'; > Some markdown (**MDX**) content. 提示 The FAQ component can be utilized in any section or page. Code blocks are compatible and can be used within the FAQ component. Example Title Some markdown (MDX) content.","s":"FAQ","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#faq","p":331},{"i":346,"t":"import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; Example","s":"ExternalCodeEmbed","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#externalcodeembed","p":331},{"i":348,"t":"npm run test Check Prettier and ESLint rules for compliance npm run lintcheck Included in the GitHub Actions workflow. Check for typings errors 1Experimental Checks for MDX components are missing. npm run typecheck Included in the GitHub Actions workflow. Clear and build the website npm run clear npm run build Included in the GitHub Actions workflow. Fix issues from Prettier and ESLint rules npm run lint To prevent lint issues, it is recommended to execute this command before creating your commit. Not included in the GitHub Actions workflow.","s":"Running Tests","u":"/node-mysql2/zh-CN/docs/contributing/website","h":"#running-tests","p":331},{"i":350,"t":"MySQL2 aims to be a drop in replacement for Node MySQL. 备注 If you see any API incompatibilities with Node MySQL, please report via github issue. Not only MySQL2 offers better performance over Node MySQL, we also support these additional features: Prepared Statements Promise Wrapper Authentication Switch More Features MySQL Server Pooling SSL MySQL Compression Binary Log Protocol Client","s":"Documentation","u":"/node-mysql2/zh-CN/docs/documentation","h":"","p":349},{"i":352,"t":"Please check these examples for MySQL2.","s":"Examples","u":"/node-mysql2/zh-CN/docs/documentation","h":"#examples","p":349},{"i":354,"t":"zeroFill flag is ignored in type conversion. You need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you. DECIMAL and NEWDECIMAL types always returned as string unless you pass this config option: { decimalNumbers: true, } 备注 This option could lose precision on the number as Javascript Number is a Float!","s":"Known incompatibilities with Node MySQL","u":"/node-mysql2/zh-CN/docs/documentation","h":"#known-incompatibilities-with-node-mysql","p":349},{"i":356,"t":"Wire protocol documentation Node MySQL - Most popular node.js mysql client library node-mariasql - Bindings to libmariasql. One of the fastest clients node-libmysqlclient - Bindings to libmysqlclient go-mysql - MySQL Go client (prepared statements, binlog protocol, server)","s":"Other Resources","u":"/node-mysql2/zh-CN/docs/documentation","h":"#other-resources","p":349},{"i":358,"t":"https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b npm run benchmarks node-mysql-benchmarks try to run example benchmarks on your system","s":"Benchmarks","u":"/node-mysql2/zh-CN/docs/documentation","h":"#benchmarks","p":349},{"i":360,"t":"During the connection phase the server may ask the client to switch to a different auth method. If the authPlugins connection config option is set, it must be an object where each key is the name of a potential authentication plugin requested by the server, and the corresponding value must be a function that optionally receives the connection config options and returns another function, which in turn, optionally receives the switch request data. The plugin is loaded with a ({user,password,...}) signature, and each call has a (pluginData) signature. Each call should make the plugin return any additional authentication data (Buffer) that should be sent back to the server, either synchronously or asynchronously using a Promise, or should yield an error accordingly. Example: (imaginary ssh-key-auth plugin) pseudo code const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authPlugins: { 'ssh-key-auth': function ({ password }) { return function (pluginData) { return getPrivate(key) .then((key) => { const response = encrypt(key, password, pluginData); // continue handshake by sending response data return response; }) .catch((err) => { // throw error to propagate error to connect/changeUser handlers }); }; }, }, }); There is also a deprecated API where if a authSwitchHandler connection config option is set it must be a function that receives switch request data and responds via a callback. In this case, the first invocation always has a ({pluginName, pluginData}) signature, following calls - ({pluginData}). The client replies with an opaque blob matching the requested plugin via callback(null, data: Buffer). const conn = mysql.createConnection({ user: 'test_user', password: 'test', database: 'test_database', authSwitchHandler: function ({ pluginName, pluginData }, cb) { if (pluginName === 'ssh-key-auth') { getPrivateKey((key) => { const response = encrypt(key, pluginData); // continue handshake by sending response data // respond with error to propagate error to connect/changeUser handlers cb(null, response); }); } else { const err = new Error( `Unknown AuthSwitchRequest plugin name ${pluginName}` ); err.fatal = true; cb(err); } }, }); The initial handshake is always performed using mysql_native_password plugin. This will be possible to override in future versions. Note that if the mysql_native_password method is requested it will be handled internally according to Authentication::Native41 and no authPlugins function or the authSwitchHandler will be invoked. These MAY be called multiple times if the plugin algorithm requires multiple roundtrips of data exchange between client and server.","s":"Authentication Switch Request","u":"/node-mysql2/zh-CN/docs/documentation/authentication-switch","h":"","p":359},{"i":362,"t":"If the user requires multi-factor authentication in the server, the client will receive a AuthNextFactor request, which is similar in structure to the regular authentication switch request and contains the name and possible initial data for the additional authentication factor plugin (up to 3). Additional passwords can be provided using the connection config options - password2 and password3. Again, for each authentication factor, multiple roundtrips of data exchange can be required by the plugin algoritm. const conn = mysql.createConnection({ user: 'test_user', password: 'secret1', password2: 'secret2', password3: 'secret3', database: 'test_database', authPlugins: { // password1 === password 'auth-plugin1': function ({ password1 }) { return function (serverPluginData) { return clientPluginData(password1, serverPluginData); }; }, 'auth-plugin2': function ({ password2 }) { return function (serverPluginData) { return clientPluginData(password2, serverPluginData); }; }, 'auth-plugin3': function ({ password3 }) { return function (serverPluginData) { return clientPluginData(password3, serverPluginData); }; }, }, });","s":"Multi-factor authentication","u":"/node-mysql2/zh-CN/docs/documentation/authentication-switch","h":"#multi-factor-authentication","p":359},{"i":365,"t":"You can use named placeholders for parameters by setting namedPlaceholders config value or query/execute time option. Named placeholders are converted to unnamed ? on the client (mysql protocol does not support named parameters). If you reference parameter multiple times under the same name it is sent to server multiple times. Unnamed placeholders can still be used by providing the values as an array instead of an object. connection.config.namedPlaceholders = true; connection.execute('select :x + :y as z', { x: 1, y: 2 }, (err, rows) => { // statement prepared as \"select ? + ? as z\" and executed with [1,2] values // rows returned: [ { z: 3 } ] }); connection.execute('select :x + :x as z', { x: 1 }, (err, rows) => { // select ? + ? as z, execute with [1, 1] }); connection.query('select :x + :x as z', { x: 1 }, (err, rows) => { // query select 1 + 1 as z }); // unnamed placeholders are still valid if the values are provided in an array connection.query('select ? + ? as z', [1, 1], (err, rows) => { // query select 1 + 1 as z });","s":"Named placeholders","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#named-placeholders","p":363},{"i":367,"t":"const options = { sql: 'select A,B,C,D from foo', rowsAsArray: true }; connection.query(options, (err, results) => { /* results will be an array of arrays like this now: [[ 'field A value', 'field B value', 'field C value', 'field D value', ], ...] */ });","s":"Receiving rows as array of columns instead of hash with column name as key:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#receiving-rows-as-array-of-columns-instead-of-hash-with-column-name-as-key","p":363},{"i":369,"t":"In addition to sending local fs files you can send any stream using infileStreamFactory query option. If set, it has to be a function that return a readable stream. It gets file path from query as a parameter. Note: starting from version 2.0 infileStreamFactory is required parameter for LOAD DATA LOCAL INFILE. Response from server indicates that it wants access to a local file and no infileStreamFactory option is provided the query ends with error. // local file connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)', onInserted1 ); // local stream const sql = 'LOAD DATA LOCAL INFILE \"mystream\" INTO TABLE test FIELDS TERMINATED BY ? (id, title)'; connection.query( { sql: sql, infileStreamFactory: function (path) { return getStream(); }, }, onInserted2 ); The infileStreamFactory option may also be set at a connection-level: const fs = require('fs'); const mysql = require('mysql2'); const connection = mysql.createConnection({ user: 'test', database: 'test', infileStreamFactory: (path) => { // Validate file path const validPaths = ['/tmp/data.csv']; if (!validPaths.includes(path)) { throw new Error( `invalid file path: ${path}: expected to be one of ${validPaths.join( ',' )}` ); } return fs.createReadStream(path); }, }); connection.query( 'LOAD DATA LOCAL INFILE \"/tmp/data.csv\" INTO TABLE test', onInserted );","s":"Sending tabular data with 'load infile' and local stream:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#sending-tabular-data-with-load-infile-and-local-stream","p":363},{"i":371,"t":"const net = require('net'); const mysql = require('mysql2'); const shape = require('shaper'); const connection = mysql.createConnection({ user: 'test', database: 'test', stream: net.connect('/tmp/mysql.sock').pipe(shape(10)), // emulate 10 bytes/sec link }); connection.query('SELECT 1+1 as test1', console.log); stream also can be a function. In that case function result has to be duplex stream, and it is used for connection transport. This is required if you connect pool using custom transport as new pooled connection needs new stream. Example connecting over socks5 proxy: const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ database: 'test', user: 'foo', password: 'bar', stream: function (cb) { const newStream = new SocksConnection( { host: 'remote.host', port: 3306 }, { host: 'localhost', port: 1080 } ); cb(null, newStream); }, }); In addition to password createConnection(), createPool() and changeUser() accept passwordSha1 option. This is useful when implementing proxies as plaintext password might be not available.","s":"Connecting using custom stream:","u":"/node-mysql2/zh-CN/docs/documentation/extras","h":"#connecting-using-custom-stream","p":363},{"i":374,"t":"createServer() - creates server instance Server.listen - listen port / unix socket (same arguments as net.Server.listen)","s":"Server","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#server","p":372},{"i":376,"t":"connect new incoming connection.","s":"Events","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#events","p":372},{"i":378,"t":"serverHandshake({ serverVersion, protocolVersion, connectionId, statusFlags, characterSet, capabilityFlags }) send server handshake initialisation packet, wait handshake response and start listening for commands writeOk({ affectedRows: num, insertId: num }) send OK packet to client writeEof(warnings, statusFlags) send EOF packet writeTextResult(rows, fields) write query result to client. Rows and fields are in the same format as in connection.query callback. writeColumns(fields) write fields + EOF packets. writeTextRow(row) write array (not hash!) of values as result row TODO: binary protocol","s":"Connection","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#connection","p":372},{"i":380,"t":"Every command packet received by the server will be emitted as a packet event with the parameters: packet: Packet The packet itself knownCommand: boolean is this command known to the server *commandCode: number the parsed command code (first byte) In addition special events are emitted for commands received from the client. If no listener is present a fallback behavior will be invoked. quit() Default: close the connection init_db(schemaName: string) Default: return OK query(sql: string) Please attach a listener to this. Default: return HA_ERR_INTERNAL_ERROR field_list(table: string, fields: string) Default: return ER_WARN_DEPRECATED_SYNTAX ping() - Default: return OK","s":"Events","u":"/node-mysql2/zh-CN/docs/documentation/mysql-server","h":"#events-1","p":372},{"i":383,"t":"Similar to connection.query(). connection.execute('select 1 + ? + ? as result', [5, 6], (err, rows) => { // rows: [ { result: 12 } ] // internally 'select 1 + ? + ? as result' is prepared first. On subsequent calls cached statement is re-used }); // close cached statement for 'select 1 + ? + ? as result'. noop if not in cache connection.unprepare('select 1 + ? + ? as result'); Note that connection.execute() will cache the prepared statement for better performance, remove the cache with connection.unprepare() when you're done.","s":"Automatic creation, cached and re-used by connection","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#automatic-creation-cached-and-re-used-by-connection","p":381},{"i":385,"t":"Manually prepared statements doesn't comes with LRU cache and SHOULD be closed using statement.close() instead of connection.unprepare(). connection.prepare('select ? + ? as tests', (err, statement) => { // statement.parameters - array of column definitions, length === number of params, here 2 // statement.columns - array of result column definitions. Can be empty if result schema is dynamic / not known // statement.id // statement.query statement.execute([1, 2], (err, rows, columns) => { // -> [ { tests: 3 } ] }); // don't use connection.unprepare(), it won't work! // note that there is no callback here. There is no statement close ack at protocol level. statement.close(); }); Note that you should not use statement after connection reset (changeUser() or disconnect). Statement scope is connection, you need to prepare statement for each new connection in order to use it.","s":"Manual prepare / execute","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#manual-prepare--execute","p":381},{"i":387,"t":"maxPreparedStatements : We keep the cached statements in a lru-cache. Default size is 16000 but you can use this option to override it. Any statements that are dropped from cache will be closed.","s":"Configuration","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#configuration","p":381},{"i":389,"t":"The bind parameter values passed to execute are serialized JS -> MySQL as: null -> NULL number -> DOUBLE boolean -> TINY (0 for false, 1 for true) object -> depending on prototype: Date -> DATETIME JSON like object - JSON Buffer -> VAR_STRING Other -> VAR_STRING Passing in undefined or a function will result in an error.","s":"Serialization of bind parameters","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#serialization-of-bind-parameters","p":381},{"i":391,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [1, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); connection.unprepare('select ?+1 as qqq, ? as rrr, ? as yyy'); connection.execute( 'select ?+1 as qqq, ? as rrr, ? as yyy', [3, null, 3], (err, rows, fields) => { console.log(err, rows, fields); } ); } ); } );","s":"Prepared Statements Helper","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#prepared-statements-helper","p":381},{"i":393,"t":"For Prepared Statements examples, please see here.","s":"Examples","u":"/node-mysql2/zh-CN/docs/documentation/prepared-statements","h":"#examples","p":381},{"i":395,"t":"In addition to errback interface there is thin wrapper to expose Promise-based api","s":"Promise Wrappers","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"","p":394},{"i":397,"t":"/* eslint-env es6 */ const mysql = require('mysql2/promise'); // or require('mysql2').createConnectionPromise mysql .createConnection({ /* same parameters as for non-promise createConnection */ }) .then((conn) => conn.query('select foo from bar')) .then(([rows, fields]) => console.log(rows[0].foo)); const pool = require('mysql2/promise').createPool({}); // or require('mysql2').createPoolPromise({}) or require('mysql2').createPool({}).promise() pool .getConnection() .then((conn) => { const res = conn.query('select foo from bar'); conn.release(); return res; }) .then((result) => { console.log(result[0][0].foo); }) .catch((err) => { console.log(err); // any of connection time or query time errors from above });","s":"Basic Promise","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#basic-promise","p":394},{"i":399,"t":"async function example1() { const mysql = require('mysql2/promise'); const conn = await mysql.createConnection({ database: test }); const [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]); await conn.end(); } async function example2() { const mysql = require('mysql2/promise'); const pool = mysql.createPool({ database: test }); // execute in parallel, next console.log in 3 seconds await Promise.all([ pool.query('select sleep(2)'), pool.query('select sleep(3)'), ]); console.log('3 seconds after'); await pool.end(); }","s":"ES7 Async Await","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#es7-async-await","p":394},{"i":401,"t":"const mysql = require('mysql2'); const co = require('co'); co(function* () { const c = yield mysql.createConnectionPromise({ user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }); Examples in /examples/promise-co-await","s":"With CO","u":"/node-mysql2/zh-CN/docs/documentation/promise-wrapper","h":"#with-co","p":394},{"i":404,"t":"npm install --save mysql2 npm install --save-dev @types/node The @types/node ensure the proper interaction between TypeScript and the Node.js modules used by MySQL2 (net, events, stream, tls, etc.). 信息 Requires TypeScript >=4.5.2.","s":"Installation","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#installation","p":402},{"i":406,"t":"You can import MySQL2 in two ways: By setting the esModuleInterop option to true in tsconfig.json import mysql from 'mysql2'; import mysql from 'mysql2/promise'; By setting the esModuleInterop option to false in tsconfig.json import * as mysql from 'mysql2'; import * as mysql from 'mysql2/promise';","s":"Usage","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#usage","p":402},{"i":408,"t":"import mysql, { ConnectionOptions } from 'mysql2'; const access: ConnectionOptions = { user: 'test', database: 'test', }; const conn = mysql.createConnection(access);","s":"Connection","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#connection","p":402},{"i":410,"t":"import mysql, { PoolOptions } from 'mysql2'; const access: PoolOptions = { user: 'test', database: 'test', }; const conn = mysql.createPool(access);","s":"Pool Connection","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#pool-connection","p":402},{"i":412,"t":"A simple query​ conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); conn.execute('SELECT 1 + 1 AS `test`;', (_err, rows) => { /** * @rows: [ { test: 2 } ] */ }); The rows output will be these possible types: RowDataPacket[] RowDataPacket[][] ResultSetHeader ResultSetHeader[] ProcedureCallPacket In this example, you need to manually check the output types","s":"Query and Execute","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#query-and-execute","p":402},{"i":415,"t":"2Stable An array with the returned rows, for example: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); // SELECT conn.query('SELECT 1 + 1 AS `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { test: 2 } ] */ }); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ { Tables_in_test: 'test' } ] */ }); Using rowsAsArray option as true: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', rowsAsArray: true, }); // SELECT conn.query( 'SELECT 1 + 1 AS test, 2 + 2 AS test;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 2, 4 ] ] */ } ); // SHOW conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { console.log(rows); /** * @rows: [ [ 'test' ] ] */ });","s":"RowDataPacket[]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#rowdatapacket","p":402},{"i":417,"t":"2Stable Using multipleStatements option as true with multiple queries: import mysql, { RowDataPacket } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SELECT 1 + 1 AS test; SELECT 2 + 2 AS test; `; conn.query(sql, (_err, rows) => { console.log(rows); /** * @rows: [ [ { test: 2 } ], [ { test: 4 } ] ] */ });","s":"RowDataPacket[][]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#rowdatapacket-1","p":402},{"i":419,"t":"2Stable History Version Changes v3.5.1 OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead. changedRows option is deprecated and might be removed in the future major release. Please use affectedRows instead. For INSERT, UPDATE, DELETE, TRUNCATE, etc.: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); const sql = ` SET @1 = 1; `; conn.query(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ });","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#resultsetheader","p":402},{"i":421,"t":"2Stable History Version Changes v3.5.1 Introduce ResultSetHeader[] For multiples INSERT, UPDATE, DELETE, TRUNCATE, etc. when using multipleStatements as true: import mysql, { ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', multipleStatements: true, }); const sql = ` SET @1 = 1; SET @2 = 2; `; conn.query(sql, (_err, results) => { console.log(results); /** * @results: [ ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 10, warningStatus: 0, changedRows: 0 }, ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } ] */ });","s":"ResultSetHeader[]","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#resultsetheader-1","p":402},{"i":423,"t":"2Stable History Version Changes v3.5.1 Introduce ProcedureCallPacket 提示 By performing a Call Procedure using INSERT, UPDATE, etc., the return will be a ProcedureCallPacket (even if you perform multiples queries and set multipleStatements to true): import mysql, { ProcedureCallPacket, ResultSetHeader } from 'mysql2'; const conn = mysql.createConnection({ user: 'test', database: 'test', }); /** ResultSetHeader */ conn.query('DROP PROCEDURE IF EXISTS myProcedure'); /** ResultSetHeader */ conn.query(` CREATE PROCEDURE myProcedure() BEGIN SET @1 = 1; SET @2 = 2; END `); /** ProcedureCallPacket */ const sql = 'CALL myProcedure()'; conn.query>(sql, (_err, result) => { console.log(result); /** * @result: ResultSetHeader { fieldCount: 0, affectedRows: 0, insertId: 0, info: '', serverStatus: 2, warningStatus: 0, changedRows: 0 } */ }); For CREATE PROCEDURE and DROP PROCEDURE, these returns will be the default ResultSetHeader. By using SELECT and SHOW queries in a Procedure Call, it groups the results as: /** ProcedureCallPacket */ [RowDataPacket[], ResultSetHeader] For ProcedureCallPacket, please see the following examples.","s":"ProcedureCallPacket","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#procedurecallpacket","p":402},{"i":425,"t":"0Deprecated OkPacket is deprecated and might be removed in the future major release. Please use ResultSetHeader instead.","s":"OkPacket","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#okpacket","p":402},{"i":427,"t":"You can also check some code examples using MySQL2 and TypeScript to understand advanced concepts: Extending and using Interfaces with RowDataPacket Extending and using Interfaces with RowDataPacket and rowAsArray Extending and using Interfaces with RowDataPacket and multipleStatements Extending and using Interfaces with RowDataPacket, rowAsArray and multipleStatements Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket from ProcedureCallPacket Checking for ResultSetHeader, extending and using Interfaces with RowDataPacket and rowAsArray from ProcedureCallPacket Creating a basic custom MySQL2 Class","s":"Examples","u":"/node-mysql2/zh-CN/docs/documentation/typescript-examples","h":"#examples","p":402},{"i":429,"t":"提示 To explore the examples, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Examples","u":"/node-mysql2/zh-CN/docs/examples","h":"","p":428},{"i":431,"t":"MySQL-pg-proxy - MySQL to Postgres proxy server. MySQLite.js - MySQL server with JS-only (emscripten compiled) sqlite backend. SQL-engine - MySQL server with LevelDB backend. MySQL-osquery-proxy - Connect to facebook osquery using MySQL client PlyQL - Connect to Druid using MySQL client","s":"Examples using MySQL server API","u":"/node-mysql2/zh-CN/docs/examples","h":"#examples-using-mysql-server-api","p":428},{"i":433,"t":"index.js 'use strict'; const mysql = require('mysql2'); const through2 = require('through2'); const binlogStream = mysql.createBinlogStream({ serverId: 123, // slave ID, first field in \"show slave hosts\" sql response // you can also specify slave host, username, password and port masterId: 0, filename: 'mysql-bin.000007', binlogPos: 120, flags: 1, // 1 = \"non-blocking mode\" }); binlogStream.pipe( through2.obj((obj, enc, next) => { console.log(obj); next(); }) );","s":"Binlog Watcher","u":"/node-mysql2/zh-CN/docs/examples/binlog-watcher","h":"","p":432},{"i":435,"t":"信息 For queries please see the Simple Queries and Prepared Statements examples.","s":"createConnection","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"","p":434},{"i":437,"t":"createConnection(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection( 'mysql://root:password@localhost:3306/test' ); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconnectionuri","p":434},{"i":439,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig","p":434},{"i":441,"t":"createConnection(config: ConnectionOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); connection.addListener('error', (err) => { console.log(err); });","s":"createConnection(config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--sha1","p":434},{"i":443,"t":"createConnection(config: ConnectionOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); connection.addListener('error', (err) => { console.log(err); }); See ssl/certs.","s":"createConnection(config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--ssl","p":434},{"i":445,"t":"createConnection(config: ConnectionOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await connection.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const connection = mysql.createConnection({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); connection.addListener('error', (err) => { console.log(err); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { connection.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); });","s":"createConnection(config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--rds-ssl","p":434},{"i":447,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#related-links","p":434},{"i":449,"t":"createConnection(config: ConnectionOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const connection = mysql.createConnection({ stream: socksProxy, }); connection.addListener('error', (err) => { console.log(err); }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const connection = mysql.createConnection({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); connection.addListener('error', (err) => { console.log(err); }); Testing connection.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createConnection(config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#createconnectionconfig--socks","p":434},{"i":452,"t":"ConnectionOptions Specification","s":"ConnectionOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/create-connection","h":"#connectionoptions","p":434},{"i":454,"t":"信息 For queries please see the Simple Queries and Prepared Statements examples.","s":"createPool","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"","p":453},{"i":456,"t":"createPool(connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool('mysql://root:password@localhost:3306/test'); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconnectionuri","p":453},{"i":458,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config)","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig","p":453},{"i":460,"t":"createPool(config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--sha1","p":453},{"i":462,"t":"createPool(config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--ssl","p":453},{"i":464,"t":"createPool(config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); const connection = await pool.getConnection(); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await pool.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const pool = mysql.createPool({ // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); pool.getConnection(function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { pool.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); 注意 Don't forget to release the connection when finished by using: pool.releaseConnection(connection) connection.release()","s":"createPool(config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--rds-ssl","p":453},{"i":466,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#related-links","p":453},{"i":468,"t":"createPool(config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const pool = mysql.createPool({ stream: socksProxy, }); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const pool = mysql.createPool({ debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); Testing pool.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"createPool(config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#createpoolconfig--socks","p":453},{"i":471,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/create-pool","h":"#pooloptions","p":453},{"i":473,"t":"信息 For queries please see the Simple Queries and Prepared Statements examples.","s":"createPoolCluster","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"","p":472},{"i":475,"t":"add(group: string, connectionUri: string) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', 'mysql://root:password@localhost:3306/test'); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, connectionUri)","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-connectionuri","p":472},{"i":477,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { host: 'localhost', user: 'root', database: 'test', // port: 3306, // password: '', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config)","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config","p":472},{"i":479,"t":"add(group: string, config: PoolOptions) promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from( '8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex' ), }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... passwordSha1: Buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex'), }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SHA1","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--sha1","p":472},{"i":481,"t":"add(group: string, config: PoolOptions) promise.js callback.js certs/ca-cert.pem import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... ssl: { // key: fs.readFileSync('./certs/client-key.pem'), // cert: fs.readFileSync('./certs/client-cert.pem') ca: fs.readFileSync('./certs/ca-cert.pem'), }, }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); See ssl/certs. 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--ssl","p":472},{"i":483,"t":"add(group: string, config: PoolOptions) You can use Amazon RDS string as value to ssl property to connect to Amazon RDS MySQL over SSL. In that case https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used: promise.js callback.js import mysql from 'mysql2/promise'; try { const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); const connection = await poolCluster.getConnection('clusterA'); // ... some query connection.release(); } catch (err) { console.log(err); } Testing try { const [res] = await connection.query('SHOW `status` LIKE \"Ssl_cipher\"'); await poolCluster.end(); console.log(res); } catch (err) { console.log(err); } const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { // ... host: 'db.id.ap-southeast-2.rds.amazonaws.com', ssl: 'Amazon RDS', }); // poolCluster.add('clusterB', '...'); poolCluster.getConnection('clusterA', function (err, connection) { if (err instanceof Error) { console.log(err); return; } // ... some query connection.release(); }); Testing connectionquery('SHOW `status` LIKE \"Ssl_cipher\"', function (err, res) { poolCluster.end(); if (err instanceof Error) { console.log(err); return; } console.log(res); }); 注意 Don't forget to release the connection when finished by using: connection.release()","s":"add(group, config) — RDS SSL","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--rds-ssl","p":472},{"i":485,"t":"Issues #2130 — Update TLS certs for Amazon RDS instances Pull Requests #2119 — fix: make startTls code compatible with Bun #2131 — Update Amazon RDS SSL CA cert","s":"Related Links","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#related-links","p":472},{"i":487,"t":"add(group: string, config: PoolOptions) A.js B.js const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const socksProxy = new SocksConnection({ port: 3306 }); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { stream: socksProxy, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); const mysql = require('mysql2'); const SocksConnection = require('socksjs'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('clusterA', { debug: 1, stream: function () { return new SocksConnection({ port: 3306 }); }, }); // poolCluster.add('clusterB', '...'); const poolNamespace = poolCluster.of('clusterA'); Testing poolNamespace.execute('SELECT SLEEP(1.1) AS `www`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); }); poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows, fields); });","s":"add(group, config) — Socks","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#addgroup-config--socks","p":472},{"i":490,"t":"PoolOptions extends all options from ConnectionOptions: ConnectionOptions Specification PoolOptions Specification","s":"PoolOptions","u":"/node-mysql2/zh-CN/docs/examples/connections/createPoolCluster","h":"#pooloptions","p":472},{"i":492,"t":"await.js co.js .babelrc package.json 'use strict'; const mysql = require('mysql2/promise'); async function test() { const c = await mysql.createConnection({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log('connected!'); const [rows, fields] = await c.query('show databases'); console.log(rows); try { const [rows, fields] = await c.query('some invalid sql here'); } catch (e) { console.log('caught exception!', e); } console.log(await c.execute('select sleep(0.5)')); console.log('after first sleep'); console.log(await c.execute('select sleep(0.5)')); console.log('after second sleep'); let start = +new Date(); console.log( await Promise.all([ c.execute('select sleep(2.5)'), c.execute('select sleep(2.5)'), ]) ); console.log( 'after 2+3 parallel sleep which is in fact not parallel because commands are queued per connection' ); let end = +new Date(); console.log(end - start); await c.end(); const p = mysql.createPool({ port: 3306, user: 'testuser', namedPlaceholders: true, password: 'testpassword', }); console.log(await p.execute('select sleep(0.5)')); console.log('after first pool sleep'); start = +new Date(); console.log( await Promise.all([ p.execute('select sleep(2.5)'), p.execute('select sleep(2.5)'), ]) ); console.log('after 2+3 parallel pool sleep'); end = +new Date(); console.log(end - start); await p.end(); } test() .then(() => { console.log('done'); }) .catch((err) => { console.log('error!', err); throw err; }); 'use strict'; const mysql = require('mysql2/promise'); const co = require('co'); co(function* () { const c = yield mysql.createConnection({ port: 3306, user: 'root', namedPlaceholders: true, }); const rows = yield c.query('show databases'); console.log(rows); console.log(yield c.execute('select 1+:toAdd as qqq', { toAdd: 10 })); yield c.end(); }) .then(function () { console.log('done'); }) .catch(function (err) { console.log(err); throw err; }); { \"plugins\": [\"transform-async-to-generator\"] } { \"name\": \"promise-co-await\", \"version\": \"1.0.0\", \"description\": \"\", \"main\": \"await.js\", \"scripts\": { \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\" }, \"author\": \"\", \"license\": \"ISC\", \"dependencies\": { \"babel-cli\": \"^6.9.0\" } }","s":"await — co","u":"/node-mysql2/zh-CN/docs/examples/promise-wrapper/co-await","h":"","p":491},{"i":494,"t":"MySQL2 provides execute helper which will prepare and query the statement. You can also manually prepare / unprepare statement with prepare / unprepare methods. See detailed documentaion in Prepared Statements. 提示 If you execute same statement again, it will be picked form a LRU cache which will save query preparation time and give better performance. Usage examples: INSERT SELECT UPDATE DELETE","s":"Prepared Statements","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements","h":"","p":493},{"i":497,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executesql-values","p":495},{"i":499,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executeoptions","p":495},{"i":501,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = ? LIMIT 1'; const values = ['Page']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#executeoptions-values","p":495},{"i":504,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#resultsetheader","p":495},{"i":506,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/delete","h":"#queryoptions","p":495},{"i":509,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executesql-values","p":507},{"i":511,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executeoptions","p":507},{"i":513,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (?, ?), (?,?)'; const values = ['Josh', 19, 'Page', 45]; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#executeoptions-values","p":507},{"i":516,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#resultsetheader","p":507},{"i":518,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/insert","h":"#queryoptions","p":507},{"i":521,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute(sql, values); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute(sql, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executesql-values","p":519},{"i":523,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute({ sql, values, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, values, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executeoptions","p":519},{"i":525,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; const [rows, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = ? AND `age` > ?'; const values = ['Page', 45]; connection.execute( { sql, // ... other options }, values, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#executeoptions-values","p":519},{"i":528,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/select","h":"#queryoptions","p":519},{"i":531,"t":"execute(sql: string, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute(sql, values); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute(sql, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(sql, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executesql-values","p":529},{"i":533,"t":"execute(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute({ sql, values, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, values, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executeoptions","p":529},{"i":535,"t":"execute(options: QueryOptions, values: any[]) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; const [result, fields] = await connection.execute( { sql, // ... other options }, values ); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = ? WHERE `name` = ? LIMIT 1'; const values = [20, 'Josh']; connection.execute( { sql, // ... other options }, values, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (execute) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"execute(options, values)","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#executeoptions-values","p":529},{"i":538,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#resultsetheader","p":529},{"i":540,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/prepared-statements/update","h":"#queryoptions","p":529},{"i":542,"t":"信息 For Prepared Statements or Placeholders / Parameters examples, please see here. Usage examples: INSERT SELECT UPDATE DELETE","s":"Simple Queries","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries","h":"","p":541},{"i":544,"t":"The examples below also work for the execute method.","s":"DELETE","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"","p":543},{"i":546,"t":"query(sql: string) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#querysql","p":543},{"i":548,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'DELETE FROM `users` WHERE `name` = \"Page\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#queryoptions","p":543},{"i":551,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#resultsetheader","p":543},{"i":553,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/delete","h":"#queryoptions-1","p":543},{"i":555,"t":"The examples below also work for the execute method.","s":"INSERT","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"","p":554},{"i":557,"t":"query(sql: string) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#querysql","p":554},{"i":559,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'INSERT INTO `users`(`name`, `age`) VALUES (\"Josh\", 19), (\"Page\", 45)'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#queryoptions","p":554},{"i":562,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#resultsetheader","p":554},{"i":564,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/insert","h":"#queryoptions-1","p":554},{"i":566,"t":"The examples below also work for the execute method.","s":"SELECT","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"","p":565},{"i":568,"t":"query(sql: string) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query(sql); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query(sql, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); }); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#querysql","p":565},{"i":570,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server fields contains extra meta data about rows, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions","p":565},{"i":572,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; const [rows, fields] = await connection.query({ sql, rowsAsArray: true, // ... other options }); console.log(rows); console.log(fields); } catch (err) { console.log(err); } const sql = 'SELECT * FROM `users` WHERE `name` = \"Page\" AND `age` > 45'; connection.query( { sql, rowsAsArray: true, // ... other options }, (err, rows, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(rows); console.log(fields); } ); rows contains rows returned by server as array fields contains extra meta data about rows, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options) — Row as Array","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions--row-as-array","p":565},{"i":575,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/select","h":"#queryoptions-1","p":565},{"i":577,"t":"The examples below also work for the execute method.","s":"UPDATE","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"","p":576},{"i":579,"t":"query(sql: string) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query(sql); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query(sql, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); }); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(sql)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#querysql","p":576},{"i":581,"t":"query(options: QueryOptions) promise.js callback.js try { const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; const [result, fields] = await connection.query({ sql, // ... other options }); console.log(result); console.log(fields); } catch (err) { console.log(err); } const sql = 'UPDATE `users` SET `age` = 20 WHERE `name` = \"Josh\" LIMIT 1'; connection.query( { sql, // ... other options }, (err, result, fields) => { if (err instanceof Error) { console.log(err); return; } console.log(result); console.log(fields); } ); result: contains a ResultSetHeader object, which provides details about the operation executed by the server. fields contains extra meta data about the operation, if available 信息 The connection used for the query (.query()) can be obtained through the createConnection, createPool or createPoolCluster methods.","s":"query(options)","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#queryoptions","p":576},{"i":584,"t":"ResultSetHeader Specification","s":"ResultSetHeader","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#resultsetheader","p":576},{"i":586,"t":"QueryOptions Specification","s":"QueryOptions","u":"/node-mysql2/zh-CN/docs/examples/queries/simple-queries/update","h":"#queryoptions-1","p":576},{"i":588,"t":"index.js 'use strict'; const mysql = require('mysql2'); const ClientFlags = require('mysql2/lib/constants/client.js'); const server = mysql.createServer(); server.listen(3307); server.on('connection', (conn) => { console.log('connection'); conn.serverHandshake({ protocolVersion: 10, serverVersion: 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, capabilityFlags: 0xffffff ^ ClientFlags.COMPRESS, }); conn.on('field_list', (table, fields) => { console.log('field list:', table, fields); conn.writeEof(); }); const remote = mysql.createConnection({ user: 'root', database: 'dbname', host: 'server.example.com', password: 'secret', }); conn.on('query', (sql) => { console.log(`proxying query: ${sql}`); remote.query(sql, function (err) { // overloaded args, either (err, result :object) // or (err, rows :array, columns :array) if (Array.isArray(arguments[1])) { // response to a 'select', 'show' or similar const rows = arguments[1], columns = arguments[2]; console.log('rows', rows); console.log('columns', columns); conn.writeTextResult(rows, columns); } else { // response to an 'insert', 'update' or 'delete' const result = arguments[1]; console.log('result', result); conn.writeOk(result); } }); }); conn.on('end', remote.end.bind(remote)); });","s":"MySQL Proxy","u":"/node-mysql2/zh-CN/docs/examples/tests/mysql-proxy","h":"","p":587},{"i":590,"t":"index.js 'use strict'; const pool = require('mysql2').createPool({ host: 'localhost', user: 'root', database: 'test', password: 'root', }); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.query((err, rows, fields) => { console.log(rows, fields); // Connection is automatically released once query resolves }); } }, 1000); setInterval(() => { for (let i = 0; i < 5; ++i) { pool.getConnection((err, db) => { db.query('select sleep(0.5) as qqq', (err, rows, fields) => { console.log(rows, fields); db.release(); }); }); } }, 1000);","s":"Pool","u":"/node-mysql2/zh-CN/docs/examples/tests/pool","h":"","p":589},{"i":592,"t":"index.js 'use strict'; const mysql = require('mysql2'); const flags = require('mysql2/lib/constants/client.js'); const auth = require('mysql2/lib/auth_41.js'); function authenticate(params, cb) { console.log(params); const doubleSha = auth.doubleSha1('pass123'); const isValid = auth.verifyToken( params.authPluginData1, params.authPluginData2, params.authToken, doubleSha ); if (isValid) { cb(null); } else { // for list of codes lib/constants/errors.js cb(null, { message: 'wrong password dude', code: 1045 }); } } const server = mysql.createServer(); server.listen(3333); server.on('connection', (conn) => { // we can deny connection here: // conn.writeError({ message: 'secret', code: 123 }); // conn.close(); conn.serverHandshake({ protocolVersion: 10, serverVersion: '5.6.10', // 'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, // capabilityFlags: 0xffffff, // capabilityFlags: -2113931265, capabilityFlags: 2181036031, authCallback: authenticate, }); conn.on('field_list', (table, fields) => { console.log('FIELD LIST:', table, fields); conn.writeEof(); }); conn.on('query', (query) => { conn.writeColumns([ { catalog: 'def', schema: 'test', table: 'test_table', orgTable: 'test_table', name: 'beta', orgName: 'beta', characterSet: 33, columnLength: 384, columnType: 253, flags: 0, decimals: 0, }, ]); conn.writeTextRow(['test тест テスト փորձարկում পরীক্ষা kiểm tra ']); conn.writeTextRow(['ტესტი પરીક્ષણ מבחן פּרובירן اختبار परीक्षण']); conn.writeEof(); conn.close(); }); });","s":"Server","u":"/node-mysql2/zh-CN/docs/examples/tests/server","h":"","p":591},{"i":594,"t":"index.ts db.ts /** * The types are explicity for learning purpose */ import { PoolOptions } from 'mysql2/promise'; import { MySQL } from './db.js'; interface User extends RowDataPacket { id: number; name: string; } const access: PoolOptions = { host: '', user: '', password: '', database: '', }; (async () => { const mysql = new MySQL(access); /** Deleting the `users` table, if it exists */ await mysql.queryResult('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await mysql.queryResult( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await mysql.executeResult( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await mysql.queryRows( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user: User) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await mysql.connection.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */ /** * The types are explicity for learning purpose */ import { createPool, PoolOptions, Pool, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; export class MySQL { private conn: Pool; private credentials: PoolOptions; constructor(credentials: PoolOptions) { this.credentials = credentials; this.conn = createPool(this.credentials); } /** A random method to simulate a step before to get the class methods */ private ensureConnection() { if (!this?.conn) this.conn = createPool(this.credentials); } /** For `SELECT` and `SHOW` */ get queryRows() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get queryRowsAsArray() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get queryResult() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get queryResults() { this.ensureConnection(); return this.conn.query.bind(this.conn); } /** For `SELECT` and `SHOW` */ get executeRows() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `SELECT` and `SHOW` with `rowAsArray` as `true` */ get executeRowsAsArray() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For `INSERT`, `UPDATE`, etc. */ get executeResult() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** For multiple `INSERT`, `UPDATE`, etc. with `multipleStatements` as `true` */ get executeResults() { this.ensureConnection(); return this.conn.execute.bind(this.conn); } /** Expose the Pool Connection */ get connection() { return this.conn; } }","s":"Basic Custom Class","u":"/node-mysql2/zh-CN/docs/examples/typescript/basic-custom-class","h":"","p":593},{"i":596,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user.id); console.log('name:', user.name); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet","u":"/node-mysql2/zh-CN/docs/examples/typescript/procedure-call/index","h":"","p":595},{"i":598,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ProcedureCallPacket, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } const isResultSetHeader = (data: unknown): data is ResultSetHeader => { if (!data || typeof data !== 'object') return false; const keys = [ 'fieldCount', 'affectedRows', 'insertId', 'info', 'serverStatus', 'warningStatus', 'changedRows', ]; return keys.every((key) => key in data); }; (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Deleting the `getUsers` procedure, if it exists */ await conn.query('DROP PROCEDURE IF EXISTS getUsers'); /** Creating a procedure to get the users */ await conn.query(` CREATE PROCEDURE getUsers() BEGIN SELECT * FROM users ORDER BY name ASC; END `); /** Getting users */ const [procedureResult] = await conn.query>('CALL getUsers()'); procedureResult.forEach((users) => { /** By perform a `SELECT` or `SHOW`, The last item of `procedureResult` always be a `ResultSetHeader` */ if (isResultSetHeader(users)) { console.log('----------------'); console.log('Affected Rows:', users.affectedRows); } else { users.forEach((user) => { console.log('----------------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); } }); await conn.end(); })(); /** Output * * Inserted: 4 * ---------------- * id: 4 * name: Gween * ---------------- * id: 2 * name: John * ---------------- * id: 1 * name: Josh * ---------------- * id: 3 * name: Marie * ---------------- * Affected Rows: 0 */","s":"Procedure Call Packet (Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/procedure-call/row-as-array","h":"","p":597},{"i":600,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/index","h":"","p":599},{"i":602,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { id: number; name: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user.id); console.log('name:', user.name); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/multi-statements","h":"","p":601},{"i":604,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [users] = await conn.query( 'SELECT * FROM `users` ORDER BY `name` ASC;' ); users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/row-as-array","h":"","p":603},{"i":606,"t":"index.ts /** * The types are explicity for learning purpose * By extending the `RowDataPacket`, you can use your Interface in `query` and `execute` */ import mysql, { ConnectionOptions, ResultSetHeader, RowDataPacket, } from 'mysql2/promise'; interface User extends RowDataPacket { /** id */ 0: number; /** name */ 1: string; } (async () => { const access: ConnectionOptions = { host: '', user: '', password: '', database: '', multipleStatements: true, rowsAsArray: true, }; const conn = await mysql.createConnection(access); /** Deleting the `users` table, if it exists */ await conn.query('DROP TABLE IF EXISTS `users`;'); /** Creating a minimal user table */ await conn.query( 'CREATE TABLE `users` (`id` INT(11) AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY (`id`));' ); /** Inserting some users */ const [inserted] = await conn.execute( 'INSERT INTO `users`(`name`) VALUES(?), (?), (?), (?);', ['Josh', 'John', 'Marie', 'Gween'] ); console.log('Inserted:', inserted.affectedRows); /** Getting users */ const [rows] = await conn.query( [ 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2;', 'SELECT * FROM `users` ORDER BY `name` ASC LIMIT 2 OFFSET 2;', ].join(' ') ); rows.forEach((users) => { users.forEach((user) => { console.log('-----------'); console.log('id: ', user[0]); console.log('name:', user[1]); }); }); await conn.end(); })(); /** Output * * Inserted: 4 * ----------- * id: 4 * name: Gween * ----------- * id: 2 * name: John * ----------- * id: 1 * name: Josh * ----------- * id: 3 * name: Marie */","s":"Row Data Packet (Multi Statements and Row as Array)","u":"/node-mysql2/zh-CN/docs/examples/typescript/row-data/row-as-array-multi-statements","h":"","p":605},{"i":608,"t":"This section provides answers to commonly asked questions about MySQL2. 提示 To explore the FAQs, please use the sidebar navigation on desktop or access the menu on mobile devices.","s":"Frequently Asked Questions","u":"/node-mysql2/zh-CN/docs/faq","h":"","p":607},{"i":610,"t":"This section details error handling techniques in MySQL2. It covers essential error management strategies for methods such as createConnection, createPool, createPoolCluster, execute and query.","s":"How to handle errors?","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"","p":609},{"i":612,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors by adding an error event listener: const mysql = require('mysql2'); connection = mysql.createConnection({ host: '', user: '', database: '', }); connection.addListener('error', (err) => { if (err instanceof Error) { console.log(`createConnection error:`, err); } }); createPool 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const pool = mysql.createPool({ host: '', user: '', database: '', }); pool.getConnection((err, connection) => { if (err instanceof Error) { console.log('pool.getConnection error:', err); return; } }); createPoolCluster 2Stable This solution has been tested. Handling connection errors through callback's err parameter: const mysql = require('mysql2'); const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); poolCluster.getConnection('NodeI', (err, connection) => { if (err instanceof Error) { console.log('poolCluster.getConnection error:', err); return; } }); execute 2Stable This solution has been tested. Handling execute errors through callback's err parameter: connection.execute('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('execute error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through callback's err parameter: connection.query('SELEC 1 + 1', (err, rows) => { if (err instanceof Error) { console.log('query error:', err); return; } console.log(rows); }); It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using callbacks","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#using-callbacks","p":609},{"i":614,"t":"createConnection 2Stable This solution has been tested and confirmed as the correct answer. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; try { const connection = await mysql.createConnection({ host: '', user: '', database: '', }); } catch (err) { if (err instanceof Error) { console.log(err); } } createPool 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const pool = mysql.createPool({ host: '', user: '', database: '', }); try { const connection = await pool.getConnection(); } catch (err) { if (err instanceof Error) { console.log(err); } } createPoolCluster 2Stable This solution has been tested. Handling connection errors through try-catch block: import mysql from 'mysql2/promise'; const poolCluster = mysql.createPoolCluster(); poolCluster.add('NodeI', { host: '', user: '', database: '', }); try { await poolCluster.getConnection('NodeI'); } catch (err) { if (err instanceof Error) { console.log('createConnection error:', err); } } execute 2Stable This solution has been tested. Handling execute errors through try-catch block: try { const [rows] = await connection.execute('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('execute error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections. query 2Stable This solution has been tested. Handling query errors through try-catch block: try { const [rows] = await connection.query('SELEC 1 + 1'); console.log(rows); } catch (err) { if (err instanceof Error) { console.log('query error:', err); } } It will work for both createConnection, createPool and createPoolCluster connections.","s":"Using promises","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#using-promises","p":609},{"i":616,"t":"Discussions #1998 #2282","s":"Related Links","u":"/node-mysql2/zh-CN/docs/faq/how-to-handle-errors","h":"#related-links","p":609},{"i":618,"t":"MySQL2 项目是 MySQL-Native 的延续。 协议解析器代码从头开始重写,api 更改为匹配流行的 mysqljs/mysql。 MySQL2 团队正在与 mysqljs/mysql 团队合作,将共享代码分解并移至 mysqljs 组织下。 MySQL2 大部分 API 与 mysqljs 兼容,并支持大部分功能。 MySQL2 还提供了更多的附加功能: 更快、更好的性能 支持预处理 MySQL二进制日志协议 MySQL Server 对编码和排序规则有很好的支持 Promise封装 支持压缩 SSL 和 Authentication Switch 自定义流 连接池","s":"MySQL2的历史以及选择原因","u":"/node-mysql2/zh-CN/docs/history-and-why-mysq2","h":"","p":617},{"i":620,"t":"The Stability Badges are indications of a section's stability. The stability indices are as follows: 0Deprecated The feature might generate warnings and does not assure backward compatibility. Experimental: These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged. Use caution with Experimental features, especially in libraries. Users might not expect changes from these unstable features. To reduce surprises, consider using a command-line flag for Experimental features. Experimental features are classified into stages: 1Experimental Experimental features at this stage are currently in development and prone to considerable changes. 1.1Early Development Experimental features at this stage are approaching minimum viability. 1.2Release Candidate Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification. 2Stable Compatibility with the MySQL ecosystem is a high priority. 3Legacy This feature, while not likely to be removed and still subject to semantic versioning, is not under active maintenance and other options are available. Features are classified as legacy instead of deprecated when they cause no harm and have widespread use in the MySQL ecosystem. It's unlikely that bugs in legacy features will be addressed.","s":"Stability Badges","u":"/node-mysql2/zh-CN/docs/stability-badges","h":"","p":619}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/312",[0,7.533,1,7.533,2,0.504]],["t/314",[2,0.556,3,3.397,4,6.167,5,6.167,6,5.479,7,5.479,8,6.234,9,5.956,10,6.321,11,6.777,12,5.479,13,5.479,14,4.687,15,2.154,16,2.937,17,3.999]],["t/316",[2,0.65,15,1.656,18,2.219,19,2.219,20,0.912,21,1.398,22,2.525,23,2.106,24,2.219,25,1.563,26,1.518,27,1.72,28,2.009,29,0.851,30,0.929,31,1.106,32,1.041,33,0.983,34,1.286,35,1.848,36,1.848,37,2.725,38,1.12,39,2.465,40,1.524,41,1.493,42,1.253,43,2.252,44,1.302,45,3.847,46,2.35,47,3.07,48,2.159,49,2.909,50,2.834,51,3.461,52,2.697,53,1.848,54,1.278,55,1.387,56,1.162,57,1.082,58,1.806]],["t/318",[2,0.648,3,1.37,15,1.758,18,2.402,19,2.402,20,0.968,21,1.513,22,2.733,23,2.279,25,3.627,26,2.465,27,1.861,28,2.175,29,0.921,30,0.987,31,1.197,32,1.006,33,1.043,34,1.124,35,1.962,36,1.962,37,2.893,38,1.189,39,2.617,40,1.618,41,1.586,42,0.887,43,1.758,44,1.383,46,1.835,47,2.396,48,1.686,50,2.213,52,2.105,53,1.962,54,0.904,55,1.083,56,0.822,57,1.171,58,1.278,59,3.353,60,3.353,61,1.078,62,1.758,63,2.733,64,2.733,65,2.701,66,5.032,67,3.824,68,5.032,69,5.032]],["t/320",[2,0.631,15,1.396,16,2.725,18,1.785,19,1.785,20,0.769,21,1.125,22,2.031,23,1.694,27,2.777,28,3.244,29,0.685,30,0.981,31,0.89,32,0.939,33,1.693,34,1.118,36,1.558,37,2.298,38,0.944,39,2.078,40,1.285,41,1.259,42,0.659,44,1.572,47,1.903,54,0.672,55,1.077,56,0.611,57,0.871,58,0.95,70,3.254,71,0.909,72,2.146,73,3.997,74,2.454,75,5.722,76,3.711,77,3.997,78,3.997,79,5.722,80,4.349,81,1.917,82,2.716,83,3.997,84,5.722,85,3.997,86,3.997,87,3.997,88,2.976,89,3.997,90,3.997,91,2.493,92,2.493,93,4.663,94,5.084,95,1.367,96,3.551,97,3.551,98,3.068,99,3.551,100,1.633,101,1.616,102,3.997,103,3.257,104,2.146,105,2.218,106,2.218,107,3.997,108,1.694,109,2.493,110,2.493,111,0.412,112,0.995,113,2.215]],["t/322",[2,0.642,3,2.631,20,0.999,27,4.654,29,1.624,30,1.159,31,1.492,32,1.15,33,1.421,34,1.439,35,2.025,36,2.304,37,3.397,38,1.396,39,3.073,40,2.309,41,1.862,44,1.624,46,1.525,47,1.991,48,1.401,50,1.838,57,0.921,58,1.593,65,2.245,70,2.738,72,1.416,95,1.776,100,1.708,111,0.691,114,1.793,115,2.638,116,2.404,117,3.714,118,2.981,119,4.181,120,4.181,121,2.344,122,6.441,123,2.15,124,2.638,125,2.344,126,2.638,127,1.889,128,2.638,129,2.638,130,2.638,131,1.241,132,2.005,133,2.638,134,2.344,135,1.222,136,2.638,137,1.638]],["t/324",[2,0.632,20,0.703,21,1.649,27,2.977,28,3.477,30,0.716,32,0.952,34,1.198,35,2.091,36,2.091,37,3.083,38,1.267,39,2.789,40,1.724,41,1.69,42,0.966,43,2.219,44,1.745,46,2.316,52,2.244,53,2.091,54,0.985,55,1.154,56,0.896,58,1.393,61,1.724,74,3.001,100,2.19,103,4.37,112,1.458,131,1.886,138,2.269,139,5.921,140,2.724,141,4.538,142,3.946,143,3.654,144,2.181,145,5.362,146,2.483,147,2.978,148,3.246,149,3.654,150,3.654,151,4.37,152,3.654,153,3.654,154,2.369,155,2.777]],["t/326",[2,0.473,30,1.63,114,4.809,138,4.395,156,7.076,157,6.286,158,7.076,159,7.076,160,6.286]],["t/328",[2,0.536,16,2.711,30,1.572,43,1.989,58,2.17,81,1.907,138,4.979,154,3.692,161,5.693,162,5.693,163,4.64,164,4.64,165,5.058,166,4.64,167,1.719,168,2.032,169,5.693,170,2.961,171,5.058,172,5.058,173,5.693,174,5.693,175,5.693,176,5.058,177,5.058,178,5.693,179,5.693,180,5.693,181,5.058,182,5.058,183,5.693]],["t/330",[2,0.499,3,3.049,138,4.636,184,7.464]],["t/332",[111,1.18,185,6.808,186,7.138,187,5.817,188,3.601,189,7.138,190,7.138,191,5.425]],["t/334",[10,5.521,146,4.938,192,7.265,193,6.454,194,5.203,195,7.265,196,7.265]],["t/336",[2,0.266,3,2.722,6,3.531,9,5.214,10,4.332,14,4.332,15,1.388,16,1.893,17,2.577,21,2.572,39,2.964,118,2.005,138,3.54,155,3.02,182,3.531,185,6.536,187,3.239,191,3.02,197,5.699,198,5.699,199,3.974,200,5.92,201,3.974,202,5.699,203,5.699,204,2.206,205,3.974,206,3.974,207,1.909,208,5.43,209,5.699,210,3.974,211,5.699,212,3.974,213,3.974,214,3.974,215,5.533,216,5.063,217,1.76,218,3.974,219,3.531,220,3.974,221,2.701,222,3.974,223,3.974,224,3.974,225,3.974,226,3.974,227,3.531,228,3.531,229,5.699,230,3.974,231,3.974,232,3.974,233,3.531,234,3.531,235,3.974,236,3.974,237,3.974,238,3.02,239,3.974,240,3.974,241,3.974,242,3.974,243,3.531,244,2.846,245,3.531,246,3.239]],["t/338",[14,4.484,111,0.975,118,2.976,155,4.484,187,4.807,227,5.241,238,4.484,247,2.41,248,5.837,249,5.899,250,3.275,251,5.241,252,7.241,253,4.807,254,5.241,255,5.241,256,6.063,257,5.899,258,5.899,259,6.61,260,5.899,261,5.899,262,5.899,263,5.241,264,5.899,265,3.664,266,5.899]],["t/340",[2,0.604,15,1.948,29,1.532,47,2.656,170,2.9,207,1.868,221,6.139,248,5.141,256,4.545,267,6.371,268,5.577,269,5.207,270,4.954,271,4.545,272,5.577,273,5.577,274,5.577,275,4.954,276,5.85,277,4.545,278,5.577]],["t/342",[2,0.586,15,2.017,16,2.75,19,4.135,29,1.586,88,3.003,131,1.714,140,2.476,188,2.913,207,1.934,248,4.135,256,4.705,276,6.576,277,4.705,279,7.544,280,5.13,281,5.774,282,5.774,283,7.34,284,5.774,285,2.251,286,4.705,287,5.774,288,5.774,289,4.381]],["t/344",[2,0.577,15,2.106,23,4.099,29,1.657,49,2.721,111,0.997,238,5.733,248,5.403,252,6.702,259,6.702,263,5.357,277,4.914,290,7.89,291,6.03,292,6.03,293,3.745,294,4.914,295,4.319,296,5.357]],["t/346",[2,0.594,15,2.293,29,1.803,297,8.549,298,6.563,299,6.563,300,6.563,301,6.563,302,6.563,303,6.563,304,6.563,305,6.563,306,6.563,307,6.563]],["t/348",[9,6.104,41,1.519,62,1.403,118,2.431,151,6.45,154,4.227,171,7.032,185,3.927,208,6.946,238,3.663,248,3.451,250,2.675,308,5.291,309,6.519,310,5.792,311,6.519,312,4.819,313,4.819,314,7.915,315,7.915,316,1.251,317,4.281,318,4.819,319,4.819,320,6.519,321,6.519,322,3.663,323,6.519,324,4.819,325,4.819,326,3.451,327,4.281,328,4.819]],["t/350",[2,0.363,3,2.882,16,2.585,19,3.888,21,2.449,25,2.738,26,2.659,27,3.013,30,1.686,70,2.515,114,3.69,138,4.868,151,4.424,154,3.52,165,4.823,217,1.677,253,5.749,329,5.428,330,4.424,331,5.428,332,5.428,333,4.823,334,5.428,335,4.424,336,3.52,337,3.888,338,4.823,339,3.52,340,4.823,341,3.888,342,4.126,343,3.013,344,5.428,345,4.823,346,5.428,347,3.888,348,3.372]],["t/352",[3,3.049,15,2.607,21,3.368,308,5.346]],["t/354",[2,0.538,7,5.094,29,1.575,74,2.459,146,3.897,166,4.672,167,1.355,168,2.608,170,3.8,181,5.094,207,2.448,250,4.056,308,4.106,349,7.307,350,5.554,351,5.733,352,5.733,353,5.094,354,5.733,355,5.094,356,4.106,357,5.733,358,4.358,359,5.733,360,5.094,361,3.422,362,5.733,363,5.733,364,5.733]],["t/356",[14,4.549,25,3.02,26,2.932,30,1.687,138,5.096,160,5.318,163,4.878,194,4.287,217,1.849,347,5.378,348,5.096,365,5.986,366,5.986,367,5.318,368,6.671,369,5.986,370,5.986,371,7.509,372,7.509,373,5.986]],["t/358",[9,4.981,15,2.43,30,1.364,42,1.84,138,4.32,193,6.179,208,6.705,374,6.955,375,8.763]],["t/360",[2,0.615,15,0.749,27,1.191,28,1.391,32,0.868,33,1.086,35,1.379,38,0.836,40,1.137,41,1.115,48,1.185,55,0.462,58,2.513,74,0.92,81,0.719,93,1.748,100,1.445,111,0.585,112,0.856,114,1.458,147,1.748,167,1.368,204,1.191,207,1.94,217,1.617,244,1.537,269,1.333,293,1.333,316,1.618,333,3.143,336,1.391,339,1.391,341,2.533,342,3.43,348,2.803,353,1.906,358,2.689,361,2.694,376,2.145,377,2.145,378,2.145,379,4.267,380,1.21,381,4.01,382,1.899,383,3.678,384,2.906,385,2.145,386,5.615,387,4.148,388,3.678,389,2.145,390,2.145,391,2.457,392,1.906,393,2.145,394,4.513,395,4.267,396,6.592,397,1.631,398,3.143,399,1.906,400,2.145,401,2.145,402,2.145,403,1.748,404,2.145,405,2.145,406,4.513,407,2.145,408,3.143,409,2.363,410,3.143,411,2.145,412,2.145,413,4.464,414,3.537,415,3.537,416,4.01,417,2.883,418,1.748,419,1.748,420,3.537,421,3.537,422,3.537,423,1.631,424,4.513,425,3.537,426,1.537,427,1.537,428,2.145,429,5.236,430,1.748,431,2.145,432,2.145,433,2.145,434,2.145,435,2.145,436,1.748,437,2.145,438,1.748,439,1.748,440,2.145,441,2.145,442,2.145,443,3.537,444,1.748,445,1.906,446,1.631,447,1.631,448,1.906,449,2.145,450,2.145,451,1.906,452,2.294,453,1.631,454,2.145,455,1.537,456,1.906,457,1.906,458,1.906]],["t/362",[2,0.628,32,0.55,33,0.761,35,1.431,38,1.271,40,1.18,48,1.229,58,2.974,93,2.991,100,1.499,111,0.607,167,1.844,188,1.851,207,1.229,217,1.134,219,3.261,339,3.489,341,5.023,342,2.789,348,2.28,361,2.19,379,5.19,381,3.261,383,2.991,386,4.384,387,3.853,388,2.991,391,2.005,408,3.261,409,2.874,410,3.261,444,2.991,452,2.38,455,3.853,456,3.261,457,3.261,459,3.67,460,6.369,461,3.67,462,2.991,463,3.67,464,3.67,465,1.499,466,1.536,467,6.369,468,6.369,469,3.261,470,3.67,471,3.67,472,3.67,473,3.67,474,5.38,475,3.67,476,7.803,477,3.67,478,3.67,479,3.67,480,3.67,481,3.67]],["t/365",[2,0.642,20,0.928,25,1.6,26,1.553,30,0.622,46,2.379,48,2.185,55,1.404,62,1.404,64,5.316,74,1.36,81,2.185,82,2.155,95,2.4,111,0.797,112,1.265,131,2.496,140,1.36,142,2.996,167,0.749,188,1.6,207,1.062,217,0.979,338,2.817,347,2.271,348,1.97,355,2.817,361,1.892,382,1.702,399,2.817,452,3.128,453,4.437,466,2.018,482,3.785,483,2.584,484,3.171,485,5.837,486,3.171,487,2.817,488,4.285,489,2.271,490,3.171,491,3.931,492,7.918,493,4.823,494,8.111,495,3.171,496,4.285,497,2.817]],["t/367",[2,0.63,32,0.86,43,2.553,44,2.327,46,2.091,55,1.234,61,1.844,67,4.358,74,2.459,81,2.837,125,5.094,139,4.358,141,3.718,142,4.539,207,1.921,233,5.094,498,5.733,499,5.733,500,5.733]],["t/369",[2,0.62,20,1.11,30,0.61,32,1.043,33,0.986,35,1.213,38,0.735,40,1,41,2.192,44,1.306,45,3.443,47,2.747,57,1.087,58,1.812,61,1.855,111,0.514,144,1.856,155,5.575,163,2.535,167,1.363,200,6.992,204,1.727,207,1.932,215,2.364,217,0.961,234,6.517,244,2.228,269,1.932,286,2.535,296,4.223,316,1.234,339,2.017,382,2.552,391,2.407,392,5.738,413,2.228,417,3.873,419,2.535,455,2.228,466,1.301,482,3.082,497,2.763,501,4.753,502,3.921,503,7.336,504,3.111,505,3.111,506,6.458,507,2.763,508,1.67,509,2.228,510,5.769,511,4.753,512,2.837,513,3.111,514,3.111,515,3.111,516,3.111,517,3.111,518,3.111,519,3.111,520,2.763,521,2.763,522,3.111,523,3.111,524,3.111]],["t/371",[2,0.614,15,1.282,30,1.055,32,1.24,33,1.548,35,1.431,36,2.098,37,2.11,38,1.271,40,1.73,41,2.007,43,1.282,57,1.879,58,2.427,70,2.951,71,1.338,72,1.97,76,2.38,111,1.053,121,3.261,139,2.789,146,2.495,204,3.535,207,1.229,285,1.431,337,2.629,339,2.38,409,2.874,426,2.629,436,2.991,438,2.991,455,2.629,496,3.261,502,5.075,525,3.261,526,3.67,527,3.67,528,3.67,529,3.67,530,3.67,531,3.67,532,3.67,533,3.67,534,3.67,535,2.11,536,3.67,537,5.38,538,3.261,539,3.67,540,4.78,541,4.089,542,2.789,543,3.261,544,5.38,545,3.67,546,3.093,547,2.28,548,3.67,549,1.368,550,3.261,551,3.67,552,2.789,553,3.67]],["t/374",[2,0.461,82,4.688,118,3.479,127,4.939,176,6.127,217,2.13,546,3.965,554,6.896,555,6.896,556,5.241,557,6.896,558,6.896,559,6.896]],["t/376",[33,1.778,204,4.143,560,7.464]],["t/378",[2,0.497,20,0.938,28,3.162,43,2.296,44,2.042,45,2.91,81,1.634,82,3.315,95,2.248,142,3.029,215,3.706,217,1.506,270,4.333,326,3.493,345,4.333,347,3.493,348,4.082,413,3.493,416,5.838,417,6.057,556,3.706,561,4.877,562,3.974,563,3.974,564,3.974,565,5.355,566,3.974,567,3.974,568,4.877,569,7.066,570,4.877,571,4.877,572,3.315,573,6.572,574,3.315,575,4.333,576,4.877,577,6.572,578,4.877,579,7.433,580,4.877,581,4.877,582,4.877,583,4.877]],["t/380",[21,2.175,33,0.999,44,1.324,80,6.285,164,3.927,167,1.87,168,2.824,170,2.506,217,2.014,293,2.993,326,5.669,339,3.125,348,2.993,388,5.313,427,3.451,451,4.281,482,3.125,556,4.955,569,7.347,575,5.792,584,6.519,585,5.313,586,4.819,587,4.819,588,4.281,589,4.819,590,4.819,591,4.819,592,4.819,593,4.819,594,4.819,595,4.819,596,4.819,597,3.451,598,4.819,599,3.451,600,4.819,601,4.819,602,4.819,603,4.819,604,4.819]],["t/383",[2,0.644,25,3.174,26,3.523,43,2.837,45,2.731,46,2.295,55,0.985,65,2.457,95,2.152,111,0.756,131,2.3,177,4.065,244,3.277,335,3.729,336,2.967,395,3.729,427,3.277,448,4.065,462,3.729,491,3.729,597,3.277,605,4.065,606,4.576,607,4.576,608,4.576,609,6.172,610,3.277,611,4.576,612,4.065,613,3.478,614,4.065,615,4.576]],["t/385",[2,0.632,17,3.709,25,2.885,26,3.936,28,2.59,33,1.386,41,1.802,43,1.998,55,1.231,95,1.366,104,2.144,111,1.206,140,2.453,142,3.552,146,2.714,164,3.254,170,2.077,188,2.015,204,2.217,244,4.096,286,3.254,347,2.86,356,2.86,383,3.254,489,2.86,550,3.548,597,4.096,609,3.035,614,5.081,616,3.994,617,3.994,618,3.254,619,5.719,620,3.994,621,3.994,622,5.936,623,5.719,624,3.994,625,3.994,626,3.994,627,3.994,628,3.548,629,3.994,630,3.994,631,3.994,632,3.994,633,3.994,634,2.59,635,3.994,636,3.994,637,3.994,638,3.994,639,2.48]],["t/387",[2,0.446,26,3.932,80,5.07,111,1.103,207,2.235,330,5.436,445,5.926,597,4.778,609,6.543,618,5.436,640,6.671,641,6.671,642,6.671,643,6.671]],["t/389",[2,0.611,30,1.086,43,1.935,58,2.111,62,1.613,74,2.375,81,1.855,88,2.88,112,2.852,131,1.644,170,2.88,246,4.514,316,1.437,360,6.35,368,4.921,398,4.921,482,3.592,588,4.921,644,5.539,645,4.921,646,6.35,647,5.539,648,5.539,649,4.21,650,5.539,651,4.921,652,5.539,653,7.147,654,7.147,655,5.539]],["t/391",[2,0.634,3,1.742,20,0.821,25,3.495,26,2.936,44,2.256,46,2.526,55,1.491,56,1.699,62,1.242,63,4.883,65,3.719,95,2.808,131,2.35,188,3.993,356,3.055,380,1.459,466,1.784,612,3.789,646,6.155,656,3.789,657,4.873,658,7.514,659,7.514]],["t/393",[15,2.56,16,3.491,17,4.753,21,3.308,25,3.698,26,3.591]],["t/395",[27,3.962,114,4.852,339,4.628,340,6.341,660,7.138,661,4.26,662,7.138,663,6.341,664,6.341]],["t/397",[2,0.64,20,0.901,27,2.598,30,1.253,32,1.091,33,0.971,44,1.286,56,1.148,70,2.962,82,3.182,94,4.159,113,4.159,132,3.558,134,4.159,139,4.858,167,1.106,310,4.159,316,1.215,418,3.815,453,4.858,482,3.035,543,5.678,549,2.382,610,4.577,665,4.681,666,4.681,667,3.815,668,4.681,669,6.391,670,5.678,671,4.681,672,4.681,673,4.681,674,4.681,675,4.681,676,4.681,677,4.681]],["t/399",[2,0.625,30,1.283,32,1.242,34,1.851,35,1.89,40,2.105,41,2.062,44,1.332,58,2.495,62,1.411,70,2.246,72,2.603,95,1.658,96,5.815,100,1.98,116,3.763,137,3.011,140,2.807,172,4.307,188,2.445,535,2.787,667,5.334,678,4.848,679,4.307,680,4.848,681,4.307,682,4.307,683,5.815,684,4.307,685,4.848,686,4.848,687,4.848,688,4.307]],["t/401",[2,0.622,15,1.922,30,1.079,32,1.25,34,1.229,38,1.3,39,2.861,40,1.769,57,1.922,67,4.181,74,2.359,76,3.567,95,1.882,135,2.549,403,6.428,483,4.483,657,3.567,689,6.322,690,4.888,691,4.888,692,5.501,693,4.888,694,4.888,695,4.888,696,4.888,697,4.888,698,4.888,699,5.501]],["t/404",[2,0.409,3,3.11,8,6.205,9,5.453,10,5.787,11,6.205,12,5.437,13,6.764,111,1.012,194,4.383,455,4.383,458,5.437,502,4.16,525,5.437,585,4.988,700,6.12,701,6.12,702,6.12,703,6.12,704,4.652,705,4.383,706,6.12]],["t/406",[2,0.509,3,3.386,29,2.451,30,1.7,31,2.717,74,2.625,207,2.551,382,4.088,649,4.652,707,6.12,708,6.12,709,7.614,710,7.614]],["t/408",[2,0.617,3,2.66,29,1.789,30,1.277,32,1.186,38,1.538,40,2.094,41,2.492,100,2.66,508,3.496,711,3.875,712,4.222]],["t/410",[2,0.617,3,2.66,29,1.789,30,1.277,32,1.186,38,1.538,40,2.094,41,2.492,100,2.66,508,3.496,713,3.99,714,6.511]],["t/412",[2,0.644,15,1.756,20,0.967,24,3.6,41,2.537,95,2.869,131,2.391,140,2.876,146,3.417,250,3.723,308,3.6,356,3.6,444,4.097,670,4.466,679,4.466,715,4.559,716,4.166,717,3.601,718,2.113,719,3.6]],["t/415",[2,0.651,3,2.081,15,1.191,29,1.4,30,0.999,32,0.764,35,1.986,38,1.204,40,1.638,41,2.729,46,2.224,47,2.426,74,2.185,95,2.83,100,2.081,111,0.564,131,2.009,135,3.135,140,2.902,141,3.303,142,2.118,167,0.806,207,1.142,289,2.035,715,4.599,717,2.735,720,3.409,721,3.303,722,5.094,723,3.409,724,3.409,725,2.035]],["t/417",[2,0.645,3,1.969,20,0.927,29,1.324,30,0.945,32,0.977,35,1.879,38,1.139,40,1.55,41,2.686,46,2.377,61,1.55,74,2.795,95,2.23,100,1.969,111,0.797,131,1.936,135,2.233,140,3.168,207,1.614,289,2.876,452,3.125,715,3.276,717,2.587,725,2.876,726,4.227,727,4.819]],["t/419",[2,0.625,3,1.77,21,2.734,29,1.191,30,0.85,32,0.908,35,1.689,38,1.024,40,1.393,41,1.909,43,2.117,52,1.813,61,1.393,88,4.141,98,2.968,100,1.77,111,1.002,131,1.799,140,1.858,207,1.451,221,2.945,267,3.293,269,2.691,289,2.586,382,2.326,423,4.605,446,4.605,489,4.34,572,4.118,574,2.945,613,4.605,705,3.103,715,2.945,718,2.202,728,3.531,729,3.849,730,4.938,731,4.34,732,1.955,733,2.123,734,2.008,735,3.849,736,4.333,737,3.103,738,3.103,739,3.103,740,3.103]],["t/421",[2,0.634,3,1.681,29,1.13,30,0.807,32,0.876,35,1.604,38,0.972,40,1.323,41,1.841,43,2.041,52,1.722,61,1.323,74,2.505,76,2.668,88,4.575,100,1.681,111,0.68,131,1.735,140,2.913,221,2.797,267,3.127,269,2.555,289,2.456,382,3.137,452,2.668,572,3.971,574,3.971,705,2.947,715,2.797,718,2.33,726,3.788,728,3.353,731,4.184,732,1.857,733,2.016,734,1.907,735,3.655,737,4.184,738,4.184,739,4.184,740,4.184,741,3.655,742,4.114]],["t/423",[2,0.629,3,1.441,15,1.232,16,1.68,20,1.005,21,1.592,29,0.969,30,0.692,32,0.783,35,1.375,38,0.833,40,1.134,41,1.646,43,2.174,46,1.286,52,1.476,61,1.134,74,1.513,80,2.681,88,3.82,100,1.441,103,2.875,111,0.864,118,2.636,131,1.551,140,2.669,167,1.234,221,2.398,267,2.681,269,2.191,289,2.105,330,2.875,336,3.388,382,3.341,395,5.071,430,2.875,452,2.287,509,2.526,572,2.398,574,2.398,705,2.526,715,2.398,717,1.894,718,2.424,719,4.457,721,2.287,726,2.287,728,2.875,731,2.526,732,1.592,733,1.728,737,2.526,738,2.526,739,2.526,740,2.526,741,3.134,743,6.269,744,3.527,745,3.527,746,3.527,747,2.191,748,6.223,749,2.875,750,3.527,751,3.527,752,5.225]],["t/425",[21,3.165,98,3.437,111,1.16,423,5.332,446,5.332,489,5.024,613,5.332,718,2.211,729,6.232,730,5.717,753,6.232]],["t/427",[3,2.833,8,4.309,15,1.847,111,1.474,118,2.667,293,3.284,308,5.542,538,4.698,661,5.223,717,4.699,718,2.185,719,4.967,726,4.497,754,5.288,755,5.288,756,5.288,757,5.032,758,6.875,759,5.288,760,4.698]],["t/429",[2,0.465,15,2.43,18,4.981,21,3.138,111,1.15,508,3.734,761,6.179,762,6.179,763,6.179,764,6.179,765,6.179,766,6.179]],["t/431",[30,1.785,33,1.522,61,1.857,111,1.213,217,2.493,254,5.13,348,4.559,540,7.169,645,5.13,767,5.774,768,5.774,769,5.774,770,5.774,771,5.774,772,7.34,773,5.774,774,5.774,775,7.34,776,5.774,777,5.774,778,5.774]],["t/433",[2,0.62,30,1.299,32,1.121,36,2.583,44,1.356,57,1.724,61,1.587,88,2.567,111,0.816,123,4.022,131,1.967,132,3.751,294,4.022,350,3.751,409,2.227,413,3.535,427,3.535,512,2.946,546,2.838,682,5.886,721,3.201,779,3.751,780,3.535,781,4.936,782,4.936,783,4.936,784,4.936,785,4.936,786,4.385,787,7.478,788,4.936,789,4.936,790,4.936,791,4.936,792,4.936,793,4.936,794,4.936,795,4.936,796,4.936,797,4.936,798,4.936]],["t/435",[2,0.477,15,2.493,16,3.399,20,1.608,21,3.221,24,5.112,25,3.601,26,3.497]],["t/437",[2,0.633,29,1.564,30,1.426,31,2.032,32,1.202,33,1.509,34,1.272,35,2.836,42,1.506,54,1.535,55,1.566,56,1.784,57,1.989,168,2.032,799,5.693,800,1.724,801,1.724,802,6.463,803,3.692]],["t/439",[2,0.637,29,1.356,30,1.299,31,1.761,32,1.121,33,1.374,34,1.103,35,2.583,36,2.583,37,3.809,38,1.565,39,3.445,40,2.13,41,2.088,42,1.305,54,1.33,55,1.426,56,1.625,57,1.724,409,2.989,546,3.809,547,4.115,711,2.418,800,1.495,801,1.495,803,3.201,804,3.535]],["t/441",[2,0.64,29,1.462,30,1.365,31,1.899,32,1.164,33,1.444,34,1.189,35,2.715,42,1.408,54,1.435,55,1.499,56,1.708,57,1.859,552,5.293,711,2.607,800,1.612,801,1.612,803,3.451,804,3.812,805,4.337,806,4.337,807,5.675,808,4.337]],["t/443",[2,0.642,16,2.191,29,1.264,30,1.239,31,1.642,32,1.081,33,1.31,34,1.028,35,2.463,42,1.217,54,1.24,55,1.36,56,1.549,57,1.607,343,3.507,384,3.507,711,2.254,800,1.393,801,1.393,803,2.984,804,3.296,809,3.75,810,5.531,811,6.327,812,5.148,813,3.77,814,3.77,815,5.148,816,3.75]],["t/445",[2,0.631,29,1.027,30,1.262,31,1.334,32,1.061,33,1.335,34,1.438,35,2.126,36,2.126,41,1.718,42,1.442,54,1.47,55,1.619,56,1.735,57,1.306,58,1.425,81,1.252,111,0.901,167,0.883,168,1.334,316,0.97,337,2.677,343,4.175,426,2.677,610,3.905,711,1.831,800,1.132,801,1.132,803,2.424,804,2.677,810,2.54,813,2.231,814,3.254,817,4.809,818,4.809,819,3.046,820,3.046,821,3.046,822,4.443,823,4.443,824,4.443,825,3.046,826,4.443,827,4.443,828,5.452,829,4.443,830,3.046,831,1.11]],["t/447",[2,0.556,127,4.417,154,3.999,293,3.83,295,4.417,322,4.687,343,3.423,387,4.417,397,4.687,704,4.687,733,3.747,813,4.565,814,3.68,817,5.2,818,5.2,832,5.025,833,5.025,834,5.025,835,5.025,836,5.025,837,5.025]],["t/449",[2,0.641,30,1.045,32,1.204,33,1.105,35,2.077,41,1.141,44,2.134,55,1.773,56,1.821,57,1.861,58,1.38,95,2.162,131,1.075,135,2.928,167,1.646,204,2.957,316,1.64,491,5.15,502,3.621,541,5.296,542,4.049,546,3.063,547,3.309,657,3.454,711,1.774,803,3.454,804,2.594,831,1.876,838,2.951,839,2.951,840,4.341,841,2.951,842,2.951,843,2.951,844,4.341]],["t/452",[711,3.725,845,3.523]],["t/454",[2,0.477,15,2.493,16,3.399,20,1.608,21,3.221,24,5.112,25,3.601,26,3.497]],["t/456",[2,0.634,20,1.27,29,1.348,30,1.294,31,1.751,32,1.195,33,1.546,34,1.096,42,1.298,54,1.322,55,1.605,56,1.618,57,1.714,70,3.057,98,2.403,101,3.181,104,2.634,105,2.723,106,2.723,108,3.335,111,0.811,167,1.159,168,1.751,316,1.273,800,1.486,801,1.486,831,1.457,846,4.906,847,6.598,848,4.286,849,3.514]],["t/458",[2,0.638,20,1.149,29,1.166,30,1.171,31,1.514,32,1.124,33,1.433,34,0.948,36,2.328,37,3.433,38,1.411,39,3.105,40,1.92,41,1.881,42,1.122,54,1.144,55,1.487,56,1.464,57,1.482,70,2.767,72,3.205,98,2.078,101,2.751,104,2.278,105,2.355,106,2.355,108,2.884,111,0.701,167,1.002,316,1.101,409,2.694,546,3.433,547,3.708,713,2.14,800,1.285,801,1.285,831,1.26,848,3.972,849,3.039,850,3.039]],["t/460",[2,0.641,20,1.202,29,1.243,30,1.224,31,1.615,32,1.156,33,1.483,34,1.011,42,1.197,54,1.22,55,1.539,56,1.532,57,1.581,70,2.894,72,3.353,98,2.217,101,2.934,104,2.429,105,2.512,106,2.512,108,3.076,111,0.748,167,1.069,316,1.174,552,4.746,713,2.283,800,1.37,801,1.37,805,3.688,806,3.688,807,5.089,808,3.688,831,1.344,848,4.111,849,3.241,850,3.241]],["t/462",[2,0.642,16,1.902,20,1.101,29,1.097,30,1.121,31,1.425,32,1.094,33,1.386,34,0.892,42,1.056,54,1.077,55,1.438,56,1.403,57,1.395,70,2.65,72,3.071,98,1.956,101,2.59,104,2.144,105,2.217,106,2.217,108,2.714,111,0.66,167,0.944,316,1.036,343,3.175,384,3.175,713,2.015,800,1.209,801,1.209,809,3.254,810,5.248,811,5.946,812,4.661,813,3.413,814,3.413,815,4.661,816,3.254,831,1.186,848,3.842,849,2.86,850,2.86]],["t/464",[2,0.633,20,0.962,29,0.914,30,1.178,31,1.187,32,1.074,33,1.386,34,1.343,36,1.95,41,1.576,42,1.323,54,1.348,55,1.62,56,1.639,57,1.162,58,1.268,70,2.317,72,2.685,81,1.114,98,1.629,101,2.157,104,1.786,105,1.846,106,1.846,108,2.261,111,0.993,167,1.181,168,1.187,316,1.298,337,2.382,343,3.977,426,2.382,610,3.582,688,4.443,713,1.678,800,1.007,801,1.007,810,2.261,813,1.985,814,2.985,817,4.543,818,4.543,819,2.711,820,2.711,821,2.711,822,4.075,823,4.075,824,4.075,825,2.711,826,4.075,827,4.075,829,4.075,830,2.711,831,1.485,848,3.455,849,2.382,850,2.382]],["t/466",[2,0.556,127,4.417,154,3.999,293,3.83,295,4.417,322,4.687,343,3.423,387,4.417,397,4.687,704,4.687,733,3.747,813,4.565,814,3.68,817,5.2,818,5.2,832,5.025,833,5.025,834,5.025,835,5.025,836,5.025,837,5.025]],["t/468",[2,0.638,30,1.087,32,1.224,41,1.205,44,2.175,55,1.704,56,1.6,57,1.937,58,1.458,70,2.569,72,2.977,95,2.231,131,1.136,135,3.022,167,1.69,204,3.078,316,1.692,502,3.769,541,5.436,542,4.214,546,3.188,547,3.444,657,3.595,713,1.93,831,1.936,838,3.117,839,3.117,840,4.518,841,3.117,842,3.117,843,3.117,844,4.518,850,2.739,851,6.522]],["t/471",[207,2.412,711,4.114,713,4.236,757,4.14,845,3.891]],["t/473",[2,0.477,15,2.493,16,3.399,20,1.608,21,3.221,24,5.112,25,3.601,26,3.497]],["t/475",[2,0.637,20,1.211,29,1.257,30,1.234,31,1.633,32,1.161,33,1.491,34,1.022,42,1.21,54,1.233,55,1.548,56,1.543,57,1.598,58,1.744,98,2.242,104,2.457,105,2.54,106,2.54,111,0.756,167,1.081,168,2.246,316,1.188,800,1.386,801,1.386,802,5.591,831,1.359,848,4.135,852,3.11,853,4.576,854,3.909,855,3.909,856,4.277,857,4.277,858,4.507]],["t/477",[2,0.642,20,1.101,29,1.097,30,1.121,31,1.425,32,1.094,33,1.386,34,0.892,36,2.23,37,3.288,38,1.351,39,2.974,40,1.839,41,1.802,42,1.056,54,1.077,55,1.438,56,1.403,57,1.395,58,1.522,98,1.956,104,2.144,105,2.217,106,2.217,111,0.66,167,0.944,168,1.425,316,1.036,361,2.383,409,2.581,546,3.288,547,3.552,713,2.015,800,1.209,801,1.209,831,1.186,848,3.842,852,2.714,854,3.552,855,3.552,856,3.887,857,3.887,858,4.096]],["t/479",[2,0.644,20,1.149,29,1.166,30,1.171,31,1.514,32,1.124,33,1.433,34,0.948,42,1.122,54,1.144,55,1.487,56,1.464,57,1.482,58,1.617,98,2.078,104,2.278,105,2.355,106,2.355,111,0.701,167,1.002,168,1.514,316,1.101,361,2.532,552,4.538,713,2.14,800,1.285,801,1.285,805,3.458,806,3.458,807,4.865,808,3.458,831,1.26,848,3.972,852,2.884,854,3.708,855,3.708,856,4.058,857,4.058,858,4.276]],["t/481",[2,0.644,16,1.796,20,1.056,29,1.036,30,1.076,31,1.346,32,1.065,33,1.342,34,0.843,42,0.998,54,1.017,55,1.393,56,1.346,57,1.318,58,1.438,98,1.848,104,2.025,105,2.094,106,2.094,111,0.624,167,0.891,168,1.346,316,0.979,343,3.047,361,2.251,384,3.047,713,1.903,800,1.142,801,1.142,809,3.074,810,5.132,811,5.79,812,4.473,813,3.276,814,3.276,815,4.473,816,3.074,831,1.12,848,3.72,852,2.564,854,3.409,855,3.409,856,3.731,857,3.731,858,3.931]],["t/483",[2,0.637,20,0.928,29,0.871,30,1.145,31,1.132,32,1.052,33,1.353,34,1.304,36,1.881,41,1.52,42,1.276,54,1.3,55,1.591,56,1.6,57,1.108,58,1.838,81,1.062,98,1.553,104,1.702,105,1.76,106,1.76,111,0.965,167,1.14,168,1.721,316,1.252,337,2.271,343,3.895,361,1.892,426,2.271,610,3.455,713,1.6,800,0.96,801,0.96,810,2.155,813,1.892,814,2.879,817,4.434,818,4.434,819,2.584,820,2.584,821,2.584,822,3.931,823,3.931,824,3.931,825,2.584,826,3.931,827,3.931,829,3.931,830,2.584,831,1.432,848,3.356,852,2.155,854,2.996,855,2.996,856,3.279,857,3.279,858,3.455,859,4.823]],["t/485",[2,0.556,127,4.417,154,3.999,293,3.83,295,4.417,322,4.687,343,3.423,387,4.417,397,4.687,704,4.687,733,3.747,813,4.565,814,3.68,817,5.2,818,5.2,832,5.025,833,5.025,834,5.025,835,5.025,836,5.025,837,5.025]],["t/487",[2,0.641,30,1.018,32,1.249,41,1.102,44,2.107,55,1.651,56,1.519,57,1.814,58,1.333,95,2.118,131,1.038,135,2.869,167,1.619,168,1.248,204,2.882,316,1.607,361,2.087,502,3.529,541,5.207,542,3.946,546,2.985,547,3.225,657,3.367,713,1.764,831,1.838,838,2.85,839,2.85,840,4.231,841,2.85,842,2.85,843,2.85,844,4.231,852,2.377,854,3.225,855,3.225,856,3.529,857,3.529,860,5.192,861,5.192,862,6.192]],["t/490",[207,2.412,711,4.114,713,4.236,757,4.14,845,3.891]],["t/492",[2,0.633,17,1.473,27,1.261,30,0.727,32,1.093,33,0.471,34,1.574,35,1.445,38,1.109,39,1.181,40,1.192,41,1.707,42,0.601,44,1.018,48,0.761,54,0.612,55,1.166,56,0.557,58,0.866,61,0.73,67,2.817,70,1.717,72,1.219,74,2.013,76,1.473,95,1.606,111,0.613,116,2.131,117,2.017,123,1.851,131,0.674,135,1.717,191,1.726,204,3.008,215,4.118,228,2.017,245,2.017,246,1.851,251,2.017,255,2.017,269,1.41,275,2.017,316,0.589,326,1.626,386,1.851,403,3.826,409,1.672,418,1.851,419,3.02,427,2.654,483,3.826,509,2.654,520,2.017,535,2.7,546,2.7,547,2.916,651,4.814,657,1.473,667,3.02,681,4.171,683,2.017,684,3.293,689,3.293,690,2.017,691,2.017,693,3.293,694,2.017,695,5.304,696,2.017,697,2.017,698,3.293,780,2.654,863,3.706,864,2.271,865,2.271,866,3.706,867,3.706,868,2.017,869,2.271,870,3.706,871,2.271,872,2.271,873,4.695,874,4.171,875,5.418,876,5.97,877,5.418,878,3.706,879,2.271,880,2.271,881,2.271,882,3.706,883,2.271,884,4.695,885,2.271,886,3.706,887,2.271,888,2.271,889,2.271,890,2.271,891,2.271,892,2.271,893,2.271,894,2.271,895,2.271,896,2.271,897,2.271]],["t/494",[2,0.527,3,2.247,11,4.483,15,1.922,16,2.62,20,1.369,25,4.357,26,4.086,46,2.006,62,2.072,63,5.799,82,3.739,335,4.483,336,3.567,356,3.94,380,1.882,453,4.181,466,2.302,469,4.888,609,4.181,618,4.483,656,4.888,732,2.482,733,2.695,734,2.549,898,2.549,899,5.501,900,5.501,901,5.501,902,5.501,903,4.888]],["t/497",[2,0.625,20,0.788,32,1.169,33,0.849,34,0.915,38,1.375,42,1.083,43,2.366,44,1.861,48,1.95,49,2.627,52,2.436,53,2.27,54,1.104,55,1.458,56,1.428,61,1.872,62,1.695,71,1.493,81,2.611,111,0.677,112,1.633,131,1.728,167,0.967,168,1.461,217,1.264,247,1.672,285,1.596,316,1.062,380,1.4,391,1.526,465,2.378,466,1.713,549,1.526,718,1.29,734,2.697,800,1.24,801,1.24,831,1.215,898,1.897,904,3.111,905,3.125,906,4.424,907,2.852,908,1.713,909,1.713,910,1.633,911,1.596]],["t/499",[2,0.636,20,0.747,32,1.145,33,0.805,34,0.867,38,1.323,42,1.026,43,2.296,44,1.806,48,1.876,49,2.528,52,2.344,53,2.184,54,1.046,55,1.415,56,1.374,61,2.315,62,1.631,65,3.007,71,1.415,81,2.412,111,0.641,112,1.548,131,1.663,167,0.917,207,1.876,217,1.198,247,1.585,285,1.513,316,1.007,380,1.327,391,1.446,465,2.288,466,1.623,549,1.446,718,1.223,734,2.596,800,1.175,801,1.175,831,1.152,898,1.798,905,3.007,907,2.744,908,1.623,909,1.623,910,1.548,911,1.513,912,2.41,913,1.623]],["t/501",[2,0.638,20,0.736,32,1.138,33,0.793,34,0.855,38,1.31,42,1.012,43,2.278,44,1.792,48,1.857,49,2.502,52,2.32,53,2.162,54,1.031,55,1.404,56,1.36,61,2.3,62,1.614,65,2.977,71,1.395,81,2.543,111,0.632,112,1.526,131,1.646,167,0.904,207,1.857,217,1.181,247,1.562,285,1.491,316,0.993,380,1.308,391,1.426,465,2.265,466,1.6,549,1.426,718,1.205,734,2.569,800,1.158,801,1.158,831,1.136,898,1.772,905,2.977,907,2.716,908,1.6,909,1.6,910,1.526,911,1.491,912,2.376,913,1.6]],["t/504",[718,2.396,845,3.523]],["t/506",[845,3.523,913,3.181]],["t/509",[2,0.628,20,0.765,32,1.155,33,0.824,34,0.888,42,1.051,43,2.328,44,1.831,49,2.572,50,2.506,51,3.06,52,2.385,53,2.222,54,1.071,55,1.434,56,1.398,61,1.833,62,1.659,71,1.449,81,2.767,111,0.657,112,1.586,167,0.939,168,1.418,217,1.227,247,1.623,285,1.549,316,1.031,380,1.359,391,1.481,465,2.328,466,1.663,549,1.481,718,1.252,732,2.572,800,1.203,801,1.203,831,1.18,898,1.842,904,3.02,906,4.332,907,2.792,908,1.663,909,1.663,910,1.586,911,1.549,914,3.06,915,2.641,916,4.082]],["t/511",[2,0.637,20,0.726,32,1.132,33,0.782,34,0.843,42,0.998,43,2.26,44,1.778,49,2.477,50,2.414,51,2.947,52,2.296,53,2.14,54,1.017,55,1.393,56,1.346,61,2.285,62,1.598,65,2.947,71,1.375,81,2.639,111,0.624,112,1.505,167,0.891,207,1.839,217,1.165,247,1.541,285,1.471,316,0.979,380,1.29,391,1.406,465,2.242,466,1.578,549,1.406,718,1.189,732,2.477,800,1.142,801,1.142,831,1.12,898,1.748,907,2.689,908,1.578,909,1.578,910,1.505,911,1.471,912,2.343,913,1.578,914,2.947,915,2.543,916,3.931]],["t/513",[2,0.638,20,0.716,32,1.126,33,0.771,34,0.831,42,0.984,43,2.242,44,1.764,49,2.452,50,2.389,51,2.917,52,2.274,53,2.118,54,1.003,55,1.382,56,1.333,61,2.27,62,1.582,65,2.917,71,1.357,81,2.712,111,0.615,112,1.484,167,0.879,207,1.82,217,1.149,247,1.52,285,1.451,316,0.966,380,1.273,391,1.387,465,2.22,466,1.557,549,1.387,718,1.172,732,2.452,800,1.127,801,1.127,831,1.105,898,1.724,907,2.662,908,1.557,909,1.557,910,1.484,911,1.451,912,2.311,913,1.557,914,2.917,915,2.518,916,3.892]],["t/516",[718,2.396,845,3.523]],["t/518",[845,3.523,913,3.181]],["t/521",[2,0.636,20,0.78,32,1.164,33,0.84,34,0.905,38,1.366,42,1.072,44,1.851,46,2.108,48,1.936,49,2.608,50,2.542,51,3.103,53,2.254,54,1.093,55,1.45,56,1.418,61,1.859,62,1.18,71,1.478,81,2.601,95,2.656,111,0.67,135,2.678,167,1.366,168,1.446,217,1.252,247,1.656,285,1.58,316,1.052,380,1.386,391,1.511,465,2.361,549,1.511,800,1.227,801,1.227,831,1.203,904,3.08,906,4.393,908,1.696,909,1.696,910,1.617,911,1.58]],["t/523",[2,0.642,20,0.74,32,1.14,33,0.797,34,0.859,38,1.314,42,1.016,44,1.797,46,2.029,48,1.864,49,2.51,50,2.446,51,2.987,53,2.169,54,1.036,55,1.407,56,1.365,61,2.305,62,1.119,65,2.987,71,1.401,81,2.401,95,2.602,111,0.635,135,2.578,167,1.314,207,1.864,217,1.187,247,1.57,285,1.498,316,0.997,380,1.314,391,1.432,465,2.273,549,1.432,800,1.164,801,1.164,831,1.141,908,1.608,909,1.608,910,1.533,911,1.498,912,2.387,913,1.608]],["t/525",[2,0.643,20,0.729,32,1.134,33,0.786,34,0.847,38,1.301,42,1.002,44,1.782,46,2.008,48,1.845,49,2.485,50,2.422,51,2.957,53,2.147,54,1.022,55,1.396,56,1.351,61,2.29,62,1.103,65,2.957,71,1.382,81,2.534,95,2.587,111,0.626,135,2.552,167,1.301,207,1.845,217,1.17,247,1.548,285,1.477,316,0.983,380,1.296,391,1.413,465,2.25,549,1.413,800,1.147,801,1.147,831,1.125,908,1.586,909,1.586,910,1.512,911,1.477,912,2.354,913,1.586]],["t/528",[845,3.523,913,3.181]],["t/531",[2,0.63,20,0.75,32,1.147,33,0.808,34,0.871,38,1.328,42,1.031,43,2.303,44,1.811,48,1.883,50,2.472,52,2.352,53,2.191,54,1.051,55,1.419,56,1.379,61,1.807,62,1.637,71,1.421,81,2.562,111,0.644,112,1.555,131,1.669,167,0.921,168,1.391,217,1.204,247,1.592,285,1.52,316,1.012,380,1.333,382,3.018,391,1.453,465,2.296,466,1.631,549,1.453,718,1.228,733,2.754,800,1.18,801,1.18,831,1.157,898,1.806,904,2.963,905,3.018,906,4.272,907,2.754,908,1.631,909,1.631,910,1.555,911,1.52,915,2.605,917,4.026]],["t/533",[2,0.638,20,0.713,32,1.124,33,0.768,34,0.827,38,1.28,42,0.98,43,2.236,44,1.759,48,1.814,50,2.381,52,2.266,53,2.111,54,0.998,55,1.378,56,1.328,61,2.265,62,1.577,65,2.908,71,1.35,81,2.36,111,0.612,112,1.478,131,1.608,167,0.875,207,1.814,217,1.144,247,1.513,285,1.444,316,0.961,380,1.267,382,2.908,391,1.38,465,2.212,466,1.55,549,1.38,718,1.167,733,2.653,800,1.121,801,1.121,831,1.1,898,1.716,905,2.908,907,2.653,908,1.55,909,1.55,910,1.478,911,1.444,912,2.3,913,1.55,915,2.509,917,3.879]],["t/535",[2,0.639,20,0.703,32,1.117,33,0.758,34,0.816,38,1.267,42,0.966,43,2.219,44,1.745,48,1.796,50,2.358,52,2.244,53,2.091,54,0.985,55,1.367,56,1.315,61,2.25,62,1.561,65,2.879,71,1.332,81,2.497,111,0.604,112,1.458,131,1.592,167,0.863,207,1.796,217,1.129,247,1.493,285,1.425,316,0.948,380,1.25,382,2.879,391,1.362,465,2.19,466,1.529,549,1.362,718,1.151,733,2.627,800,1.106,801,1.106,831,1.085,898,1.693,905,2.879,907,2.627,908,1.529,909,1.529,910,1.458,911,1.425,912,2.269,913,1.529,915,2.485,917,3.84]],["t/538",[718,2.396,845,3.523]],["t/540",[845,3.523,913,3.181]],["t/542",[2,0.539,15,2.817,16,3.203,17,4.361,21,3.035,25,3.393,26,3.295,46,2.453,64,5.481,482,4.361,732,3.035,733,3.295,734,3.117,903,5.975]],["t/544",[15,2.584,62,2.154,380,2.53,634,4.796,918,5.622]],["t/546",[2,0.619,20,1.166,32,1.047,33,0.899,34,0.968,38,1.432,42,1.146,43,2.441,44,1.92,48,2.03,49,2.734,52,2.535,53,2.362,54,1.168,55,1.504,56,1.486,61,1.948,62,1.262,71,1.58,111,0.716,112,1.729,131,1.799,167,1.024,168,1.546,217,1.338,247,1.77,285,1.689,316,1.124,380,1.482,391,1.615,465,2.475,466,1.813,549,1.615,599,3.103,718,1.365,734,2.808,800,1.312,801,1.312,831,1.286,898,2.008,905,3.253,907,2.968,908,1.813,909,1.813,910,1.729,911,1.689,919,4.605]],["t/548",[2,0.633,20,1.116,32,1.013,33,0.845,34,0.91,38,1.37,42,1.077,43,2.36,44,1.856,45,3.462,48,1.943,49,2.617,52,2.427,53,2.262,54,1.098,55,1.454,56,1.423,61,2.367,62,1.186,71,1.485,111,0.673,112,1.625,131,1.722,167,0.962,207,1.943,217,1.258,247,1.664,285,1.588,316,1.057,380,1.393,391,1.518,465,2.369,466,1.704,549,1.518,718,1.284,734,2.688,800,1.233,801,1.233,831,1.209,898,1.887,905,3.114,907,2.842,908,1.704,909,1.704,910,1.625,911,1.588,913,1.704,920,2.917]],["t/551",[718,2.396,845,3.523]],["t/553",[845,3.523,913,3.181]],["t/555",[15,2.584,62,2.154,380,2.53,634,4.796,918,5.622]],["t/557",[2,0.61,20,1.157,32,1.041,33,0.889,34,0.958,42,1.134,43,2.427,44,1.909,49,2.714,50,2.645,51,3.229,52,2.517,53,2.345,54,1.156,55,1.495,56,1.475,61,1.934,62,1.248,71,1.563,81,2.015,111,0.709,112,1.711,167,1.013,168,1.53,217,1.324,247,1.751,285,1.672,316,1.113,380,1.466,391,1.598,465,2.457,466,1.794,549,1.598,599,3.071,718,1.351,732,2.714,800,1.298,801,1.298,831,1.273,898,1.987,907,2.946,908,1.794,909,1.794,910,1.711,911,1.672,914,3.229,915,2.787,916,4.308,919,4.571]],["t/559",[2,0.629,20,1.108,32,1.007,33,0.836,34,0.901,42,1.067,43,2.347,44,1.846,45,3.438,49,2.599,50,2.533,51,3.092,52,2.41,53,2.246,54,1.087,55,1.446,56,1.413,61,2.356,62,1.174,71,1.471,81,1.929,111,0.667,112,1.609,167,0.953,207,1.929,217,1.246,247,1.647,285,1.572,316,1.047,380,1.379,391,1.503,465,2.353,466,1.687,549,1.503,718,1.271,732,2.599,800,1.221,801,1.221,831,1.197,898,1.869,907,2.822,908,1.687,909,1.687,910,1.609,911,1.572,913,1.687,914,3.092,915,2.669,916,4.125,920,2.888]],["t/562",[718,2.396,845,3.523]],["t/564",[845,3.523,913,3.181]],["t/566",[15,2.584,62,2.154,380,2.53,634,4.796,918,5.622]],["t/568",[2,0.63,20,1.166,32,1.047,33,0.899,34,0.968,38,1.432,42,1.146,44,1.92,46,2.209,48,2.03,49,2.734,50,2.664,51,3.253,53,2.362,54,1.168,55,1.504,56,1.486,61,1.948,71,1.58,95,2.723,111,0.716,135,2.808,167,1.432,168,1.546,217,1.338,247,1.77,285,1.689,316,1.124,380,1.482,391,1.615,465,2.475,549,1.615,599,3.103,800,1.312,801,1.312,831,1.286,908,1.813,909,1.813,910,1.729,911,1.689,919,4.605]],["t/570",[2,0.639,20,1.116,32,1.013,33,0.845,34,0.91,38,1.37,42,1.077,44,1.856,45,3.462,46,2.115,48,1.943,49,2.617,50,2.551,51,3.114,53,2.262,54,1.098,55,1.454,56,1.423,61,2.367,71,1.485,95,2.661,111,0.673,135,2.688,167,1.37,207,1.943,217,1.258,247,1.664,285,1.588,316,1.057,380,1.393,391,1.518,465,2.369,549,1.518,800,1.233,801,1.233,831,1.209,908,1.704,909,1.704,910,1.625,911,1.588,913,1.704,920,2.917]],["t/572",[2,0.637,20,1.097,32,0.999,33,0.824,34,0.888,38,1.347,42,1.051,44,1.831,45,3.401,46,2.078,48,1.909,49,2.572,50,2.506,51,3.06,53,2.222,54,1.071,55,1.434,56,1.398,61,2.341,71,1.449,74,2.444,95,2.636,111,0.657,135,2.641,141,3.696,142,2.468,167,1.347,207,1.909,217,1.227,247,1.623,285,1.549,316,1.031,380,1.359,391,1.481,465,2.328,549,1.481,800,1.203,801,1.203,831,1.18,908,1.663,909,1.663,910,1.586,911,1.549,913,1.663,920,2.846]],["t/575",[845,3.523,913,3.181]],["t/577",[15,2.584,62,2.154,380,2.53,634,4.796,918,5.622]],["t/579",[2,0.621,20,1.132,32,1.024,33,0.862,34,0.929,38,1.39,42,1.099,43,2.386,44,1.877,48,1.971,50,2.588,52,2.462,53,2.294,54,1.12,55,1.47,56,1.443,61,1.892,62,1.21,71,1.516,111,0.687,112,1.658,131,1.747,167,0.982,168,1.483,217,1.284,247,1.698,285,1.62,316,1.079,380,1.422,382,3.159,391,1.549,465,2.404,466,1.739,549,1.549,599,2.977,718,1.31,733,2.883,800,1.259,801,1.259,831,1.234,898,1.926,905,3.159,907,2.883,908,1.739,909,1.739,910,1.658,911,1.62,915,2.727,917,4.214,919,4.472]],["t/581",[2,0.634,20,1.085,32,0.991,33,0.812,34,0.875,38,1.333,42,1.036,43,2.309,44,1.816,45,3.366,48,1.889,50,2.48,52,2.36,53,2.199,54,1.056,55,1.423,56,1.383,61,2.325,62,1.14,71,1.428,111,0.647,112,1.563,131,1.675,167,0.925,207,1.889,217,1.21,247,1.6,285,1.527,316,1.017,380,1.34,382,3.028,391,1.46,465,2.304,466,1.639,549,1.46,718,1.234,733,2.763,800,1.186,801,1.186,831,1.163,898,1.815,905,3.028,907,2.763,908,1.639,909,1.639,910,1.563,911,1.527,913,1.639,915,2.614,917,4.04,920,2.805]],["t/584",[718,2.396,845,3.523]],["t/586",[845,3.523,913,3.181]],["t/588",[2,0.633,20,0.682,30,0.695,32,1.155,35,1.381,36,1.381,38,0.837,39,1.842,40,1.139,43,2.179,44,1.44,46,1.292,47,2.496,55,1.343,57,1.238,58,1.35,61,1.685,76,2.297,95,2.134,100,1.447,111,0.586,112,1.413,140,1.519,142,3.256,194,2.537,217,1.094,271,2.887,409,1.599,413,3.754,462,2.887,562,2.887,563,2.887,564,2.887,565,2.887,566,2.887,567,2.887,622,6.126,721,2.297,732,1.599,733,1.736,734,1.642,779,2.693,780,2.537,868,3.147,921,3.543,922,3.147,923,3.147,924,3.543,925,3.147,926,3.147,927,3.147,928,3.147,929,3.147,930,3.147,931,3.543,932,3.147,933,3.147,934,3.147,935,3.543,936,3.543,937,3.543,938,3.147,939,3.147,940,3.543,941,3.543,942,3.543,943,3.543,944,3.543,945,5.242,946,3.543,947,3.543,948,3.543,949,3.543,950,3.543,951,3.543,952,3.543,953,3.543]],["t/590",[2,0.645,20,0.896,32,0.698,33,0.965,36,1.815,37,2.676,38,1.1,39,3.311,40,1.496,41,1.467,44,2.144,55,1.002,70,2.157,88,3.311,95,2.178,97,4.135,98,2.28,99,4.135,111,0.769,135,2.95,409,2.1,605,5.656,657,3.018,779,3.537,780,3.333,874,4.135,954,4.654,955,6.366,956,4.654,957,4.654,958,6.366,959,4.135,960,4.654,961,4.654,962,4.654]],["t/592",[2,0.642,17,2.002,20,0.594,30,0.605,32,1.096,33,0.64,41,0.973,44,1.298,47,2.734,48,1.034,57,1.078,58,1.177,76,2.002,88,2.458,100,1.261,111,0.51,140,1.324,166,2.516,194,2.211,217,0.953,271,3.851,276,3.851,293,3.566,341,2.211,350,3.592,379,2.516,409,1.393,436,2.516,438,3.851,562,2.516,563,2.516,564,2.516,565,2.516,566,3.851,567,4.679,628,2.743,779,2.346,780,2.211,786,2.743,922,2.743,923,2.743,925,2.743,926,2.743,927,2.743,928,2.743,929,2.743,930,2.743,932,2.743,933,2.743,934,4.198,938,2.743,939,2.743,963,3.087,964,3.087,965,3.087,966,4.726,967,3.087,968,4.726,969,3.087,970,3.087,971,3.087,972,3.087,973,3.087,974,3.087,975,3.087,976,3.087,977,3.087,978,3.087,979,3.087,980,4.726,981,3.087,982,3.087,983,3.087,984,3.087,985,3.087,986,3.087,987,3.087,988,4.726,989,3.087,990,4.726,991,3.087,992,3.087,993,3.087,994,3.087,995,3.087,996,3.087,997,3.087,998,3.087,999,3.087,1000,3.087]],["t/594",[2,0.648,29,1.128,30,0.805,31,1.13,32,0.722,33,0.657,34,1.202,36,0.732,38,1.704,40,0.604,46,1.962,47,2.295,48,2.079,70,1.902,71,0.685,74,2.066,81,0.629,100,0.767,116,1.08,118,1.597,131,0.558,140,0.806,144,1.121,167,1.603,168,0.67,170,0.977,188,0.948,204,1.043,250,1.758,265,1.967,327,1.669,380,1.083,384,1.043,409,0.848,452,2.053,508,1.009,512,3.704,535,1.08,639,1.167,661,1.121,663,1.669,705,3.451,713,2.714,716,1.167,717,1.7,718,0.592,721,3.125,725,1.89,726,2.053,732,2.941,733,2.36,734,0.871,747,1.967,757,1.08,758,2.813,760,2.813,914,1.009,915,1.467,1001,1.218,1002,1.879,1003,2.053,1004,2.053,1005,1.879,1006,1.879,1007,1.879,1008,1.218,1009,1.879,1010,1.218,1011,1.218,1012,1.218,1013,1.218,1014,1.879,1015,2.053,1016,2.053,1017,2.053,1018,1.218,1019,1.218,1020,1.879,1021,1.218,1022,1.218,1023,1.218,1024,1.428,1025,1.218,1026,1.428,1027,1.879,1028,1.879,1029,4.105,1030,3.167,1031,1.879,1032,1.879,1033,4.105,1034,3.167,1035,1.879,1036,1.879,1037,1.879,1038,1.879,1039,1.879,1040,1.879,1041,6.518,1042,3.167,1043,1.879,1044,3.167,1045,3.167,1046,1.879,1047,3.167,1048,1.879,1049,3.167,1050,3.167]],["t/596",[2,0.646,20,0.426,29,0.609,30,0.434,31,0.791,32,0.949,34,1.559,36,0.864,38,1.757,40,0.712,46,1.324,47,2.542,48,2.239,62,0.645,81,0.742,88,1.152,95,1.242,100,0.905,111,0.366,112,0.884,116,1.274,118,2.693,131,0.658,137,1.376,140,0.95,144,1.322,167,0.858,168,0.791,170,1.152,188,1.118,250,1.23,265,1.376,336,1.437,358,1.684,384,2.562,391,2.196,409,1,439,1.805,508,1.189,509,1.587,512,3.99,535,2.088,572,1.506,574,1.506,639,1.376,649,1.684,661,2.168,711,1.779,712,1.437,716,1.376,717,2.478,718,1.454,719,1.587,721,1.437,725,2.168,731,1.587,732,2.409,734,1.683,737,1.587,738,1.587,739,1.587,740,1.587,743,4.351,747,3.316,749,1.805,757,2.088,914,1.189,915,1.683,1001,1.437,1003,1.437,1004,1.437,1008,1.437,1010,1.437,1011,1.437,1012,1.437,1013,1.437,1015,2.355,1016,2.355,1017,2.355,1018,1.437,1019,1.437,1021,1.437,1022,1.437,1023,1.437,1024,1.684,1025,1.437,1026,1.684,1051,1.968,1052,1.968,1053,1.968,1054,2.469,1055,2.469,1056,1.506,1057,4.743,1058,3.227,1059,1.968,1060,1.968,1061,1.968,1062,1.968,1063,1.968,1064,1.968,1065,1.968,1066,1.968]],["t/598",[2,0.647,20,0.417,29,0.596,30,0.425,31,0.774,32,0.939,34,1.546,36,0.845,38,1.744,40,0.697,46,1.301,47,2.51,48,2.219,62,0.631,74,0.93,81,0.726,88,1.856,95,1.22,100,0.886,111,0.358,112,0.865,116,1.247,118,2.658,131,1.059,137,1.347,140,0.93,141,1.406,144,1.294,167,0.843,168,0.774,170,1.128,188,1.094,250,1.204,265,1.347,336,1.406,358,1.648,384,2.524,391,2.171,409,0.978,439,1.767,508,1.164,509,1.553,512,3.953,535,2.052,572,1.474,574,1.474,639,1.347,649,1.648,661,2.13,711,1.748,712,1.406,716,1.347,717,2.441,718,1.433,719,1.553,721,1.406,725,2.13,731,1.553,732,2.378,734,1.653,737,1.553,738,1.553,739,1.553,740,1.553,743,4.294,747,3.273,749,1.767,757,2.052,914,1.164,915,1.653,1001,1.406,1003,1.406,1004,1.406,1008,1.406,1010,1.406,1011,1.406,1012,1.406,1013,1.406,1015,2.314,1016,2.314,1017,2.314,1018,1.406,1019,1.406,1021,1.406,1022,1.406,1023,1.406,1025,1.406,1051,1.926,1052,1.926,1053,1.926,1054,2.425,1055,2.425,1056,1.474,1057,4.682,1058,3.17,1059,1.926,1060,1.926,1061,1.926,1062,1.926,1063,1.926,1064,1.926,1065,1.926,1066,1.926,1067,1.767,1068,1.767]],["t/600",[2,0.646,20,0.562,29,0.803,30,0.573,31,1.042,32,0.937,34,1.598,36,1.139,38,1.912,40,0.939,46,1.065,47,2.976,48,2.5,62,0.851,81,0.979,100,1.193,111,0.483,116,1.68,118,2.285,131,0.867,137,1.814,140,1.253,144,1.743,168,1.042,170,1.519,188,1.474,250,1.622,265,1.814,384,1.622,409,1.318,508,1.568,512,4.454,535,1.68,639,1.814,661,2.703,711,2.219,712,1.894,716,1.814,717,2.978,718,0.921,725,2.703,732,2.819,734,1.354,747,2.813,757,2.604,914,1.568,915,2.099,1001,1.894,1003,1.894,1004,1.894,1008,1.894,1010,1.894,1011,1.894,1012,1.894,1013,1.894,1015,2.937,1016,2.937,1017,2.937,1018,1.894,1019,1.894,1021,1.894,1022,1.894,1023,1.894,1024,2.22,1025,1.894,1026,2.22,1054,1.986,1055,1.986,1056,1.986,1069,2.22]],["t/602",[2,0.646,20,0.523,29,0.747,30,0.533,31,0.97,32,0.9,34,1.551,36,1.059,38,1.873,40,0.874,46,1.561,47,2.861,48,2.521,62,0.791,74,1.165,81,0.91,95,0.929,100,1.11,111,0.449,116,1.562,118,2.159,131,0.807,137,1.688,140,2.576,144,1.622,168,0.97,170,1.413,188,1.371,250,1.508,265,1.688,384,1.508,409,1.226,508,1.459,512,4.335,535,1.562,639,2.658,661,2.554,711,2.096,712,1.762,716,1.688,717,2.842,718,0.856,725,2.554,726,1.762,732,2.71,734,1.259,747,2.658,757,2.461,905,2.298,914,1.459,915,1.983,1001,1.762,1003,1.762,1004,1.762,1008,1.762,1010,1.762,1011,1.762,1012,1.762,1013,1.762,1015,2.775,1016,2.775,1017,2.775,1018,1.762,1019,1.762,1021,2.775,1022,1.762,1023,1.762,1024,2.065,1025,1.762,1026,2.065,1054,1.847,1055,1.847,1056,1.847,1069,2.065,1070,2.414,1071,2.414,1072,2.414]],["t/604",[2,0.647,20,0.546,29,0.78,30,0.557,31,1.013,32,0.923,34,1.58,36,1.107,38,1.897,40,0.913,46,1.036,47,2.931,48,2.474,62,0.827,74,1.218,81,0.951,88,1.477,100,1.16,111,0.469,116,1.633,118,2.235,131,1.315,137,1.764,140,1.218,141,1.842,144,1.695,168,1.013,170,1.477,188,1.433,250,1.576,265,1.764,384,1.576,409,1.281,508,1.525,512,4.408,535,1.633,639,1.764,661,2.644,711,2.17,712,1.842,716,1.764,717,2.925,718,0.895,725,2.644,732,2.777,734,1.316,747,2.752,757,2.547,914,1.525,915,2.053,1001,1.842,1003,1.842,1004,1.842,1008,1.842,1010,1.842,1011,1.842,1012,1.842,1013,1.842,1015,2.873,1016,2.873,1017,2.873,1018,1.842,1019,1.842,1021,1.842,1022,1.842,1023,1.842,1025,1.842,1054,1.93,1055,1.93,1056,1.93,1067,2.314,1068,2.314,1069,2.158]],["t/606",[2,0.647,20,0.509,29,0.727,30,0.519,31,0.944,32,0.887,34,1.533,36,1.032,38,1.858,40,0.851,46,1.528,47,2.819,48,2.498,62,0.771,74,1.797,81,0.887,88,1.376,95,0.905,100,1.081,111,0.437,116,1.522,118,2.114,131,1.244,137,1.644,140,2.538,141,1.716,144,1.579,168,0.944,170,1.376,188,1.335,250,1.469,265,1.644,384,1.469,409,1.194,508,1.421,512,4.291,535,1.522,639,2.603,661,2.502,711,2.053,712,1.716,716,1.644,717,2.794,718,0.834,725,2.502,726,1.716,732,2.671,734,1.226,747,2.603,757,2.41,905,2.25,914,1.421,915,1.942,1001,1.716,1003,1.716,1004,1.716,1008,1.716,1010,1.716,1011,1.716,1012,1.716,1013,1.716,1015,2.718,1016,2.718,1017,2.718,1018,1.716,1019,1.716,1021,2.718,1022,1.716,1023,1.716,1025,1.716,1054,1.799,1055,1.799,1056,1.799,1067,2.157,1068,2.157,1069,2.011,1070,2.351,1071,2.351,1072,2.351]],["t/608",[2,0.439,3,2.681,18,4.701,21,2.962,23,4.461,111,1.085,147,5.349,148,5.831,290,5.831,466,2.746,508,3.524,761,5.831,762,5.831,763,5.831,764,5.831,765,5.831,766,5.831,1073,5.349,1074,6.563]],["t/610",[3,2.703,20,1.273,23,4.497,62,1.926,71,2.413,316,2.073,380,2.263,447,5.029,549,2.466,898,3.066,911,2.58,1075,6.617,1076,6.617,1077,6.617,1078,6.617,1079,6.617,1080,6.617]],["t/612",[2,0.636,20,0.821,30,1.036,32,0.978,33,1.559,35,1.056,36,2.06,38,1.248,40,1.699,41,2.056,55,1.883,57,1.845,62,1.243,70,1.255,71,1.926,72,1.454,95,1.46,131,1.78,135,1.978,167,1.417,289,3.893,316,2.234,447,4.958,482,3.888,549,1.969,556,2.058,585,2.207,634,2.768,803,1.756,831,1.937,854,1.682,855,1.682,910,2.392,911,2.06,959,2.406,1073,2.207,1081,5.796,1082,2.406,1083,2.406,1084,2.708,1085,2.708,1086,5.996,1087,2.708,1088,2.406,1089,2.406,1090,2.708,1091,2.406,1092,2.406,1093,3.792,1094,2.406,1095,2.406]],["t/614",[2,0.637,20,0.79,29,1.406,30,1.003,31,1.826,32,1.017,33,1.476,34,1.423,35,1.006,36,1.995,38,1.209,40,1.645,41,2.008,42,2.064,54,2.104,55,1.772,56,1.007,62,1.196,70,1.195,71,1.866,72,1.385,95,1.405,101,1.673,131,1.732,135,1.903,289,3.802,294,5.192,316,2.137,447,4.842,549,1.907,634,2.663,831,1.892,854,1.602,855,1.602,910,2.542,911,1.995,1073,2.102,1081,5.66,1082,2.292,1083,2.292,1088,2.292,1089,2.292,1091,2.292,1092,2.292,1093,3.649,1094,2.292,1095,2.292,1096,2.58]],["t/616",[1097,7.533,1098,7.533,1099,7.533]],["t/618",[2,0.645,3,3.469,27,3.205,30,1.582,114,4.989,157,5.13,217,1.783,341,4.135,342,4.388,343,3.205,1100,7.34,1101,7.34]],["t/620",[29,0.953,30,1.011,38,1.219,41,1.093,98,1.699,111,1.128,132,2.635,191,2.635,207,1.162,216,4.583,221,4.638,243,3.081,253,7.159,269,3.204,279,6.062,280,3.081,285,1.352,289,2.069,295,4.412,317,3.081,326,2.483,350,2.635,367,3.081,423,2.635,430,2.826,446,2.635,487,3.081,488,4.583,489,2.483,507,4.583,521,4.583,597,2.483,613,3.921,664,3.081,730,2.826,753,3.081,1102,3.467,1103,3.467,1104,3.467,1105,5.159,1106,7.918,1107,3.467,1108,5.159,1109,3.467,1110,3.467,1111,3.467,1112,3.467,1113,3.467,1114,3.467,1115,3.467,1116,3.467,1117,3.467,1118,5.159,1119,6.161,1120,3.467,1121,3.467,1122,3.467,1123,3.467,1124,3.467,1125,3.467,1126,3.467,1127,3.467,1128,3.467,1129,3.467,1130,3.467,1131,5.159,1132,3.467,1133,3.467,1134,3.467,1135,3.467,1136,5.159,1137,3.467,1138,3.467,1139,3.467,1140,3.467,1141,3.467,1142,3.467,1143,5.159,1144,3.467,1145,3.467,1146,3.467,1147,3.467,1148,3.467,1149,3.467,1150,3.467]]],"invertedIndex":[["",{"_index":2,"t":{"312":{"position":[[67,5]]},"314":{"position":[[7,17],[38,1],[48,2]]},"316":{"position":[[125,2],[128,4],[169,2],[172,9],[199,1],[283,3],[287,2],[290,4],[299,1],[325,1],[359,1],[387,1],[406,1],[412,2],[437,2],[440,3],[465,2],[468,13],[482,1],[496,1],[516,1],[518,2],[521,5],[531,1],[549,1],[583,1],[611,1],[613,1],[625,1],[627,3],[644,2],[669,1],[683,1],[703,1],[705,2],[708,4],[725,1],[746,2],[749,9],[776,1],[854,3],[858,2],[861,4],[892,1],[920,1],[939,1],[978,1],[1002,2],[1005,3],[1030,2],[1033,13],[1047,1],[1049,2],[1052,2],[1055,5],[1087,1],[1115,1],[1117,1],[1129,1],[1131,3],[1173,1],[1197,1],[1199,2]]},"318":{"position":[[0,2],[50,25],[76,23],[124,3],[136,15],[152,6],[167,1],[179,12],[366,1],[368,2],[371,9],[398,1],[482,3],[486,2],[497,6],[512,1],[544,1],[580,1],[608,1],[610,1],[622,1],[624,3],[647,2],[672,2],[675,3],[700,2],[703,13],[717,1],[731,1],[751,1],[765,1],[786,2],[789,9],[816,1],[894,3],[898,2],[909,6],[924,1],[960,1],[988,1],[990,1],[1002,1],[1004,3],[1060,1],[1084,2],[1087,3],[1112,2],[1115,13],[1129,1],[1131,2],[1134,2],[1137,42]]},"320":{"position":[[0,20],[27,30],[58,30],[230,2],[233,14],[259,1],[391,2],[487,2],[621,3],[637,1],[658,2],[661,14],[687,1],[819,2],[915,2],[1049,3],[1053,2],[1056,33],[1090,16],[1120,1],[1160,1],[1162,2],[1221,1],[1272,2],[1332,1],[1346,1],[1366,1],[1368,2],[1477,1],[1479,2],[1539,3],[1543,21],[1582,2],[1631,1],[1661,2],[1717,3],[1721,4],[1726,2],[1813,2],[1891,1],[1893,2],[1943,3],[1947,4],[1952,2],[2039,3]]},"322":{"position":[[7,3],[24,2],[31,9],[99,1],[101,2],[143,1],[227,3],[231,2],[270,1],[306,1],[334,1],[336,1],[348,1],[350,3],[368,2],[371,1],[380,10],[399,3],[403,12],[424,3],[428,2],[431,4],[472,2],[561,2],[632,1],[735,3],[739,2],[778,1],[814,1],[842,1],[844,1],[856,1],[858,3],[876,2],[886,2],[895,6],[950,3],[1004,1],[1006,2],[1036,1],[1108,3],[1112,2],[1181,1],[1199,2],[1253,1],[1292,1],[1301,1],[1315,6],[1356,5],[1383,1],[1404,2],[1440,1],[1518,3],[1580,2],[1583,1],[1604,2],[1636,2]]},"324":{"position":[[0,44],[56,5],[62,3],[97,39],[137,5],[171,1],[274,3],[289,1],[386,3],[390,5],[417,1],[443,1],[521,3],[547,2],[550,11],[583,2],[586,3],[590,1],[604,1],[624,1],[638,1],[697,2],[732,1],[756,2],[862,2],[886,1],[888,2]]},"326":{"position":[[133,3]]},"328":{"position":[[384,2],[387,6],[426,16]]},"330":{"position":[[40,10]]},"336":{"position":[[632,1]]},"340":{"position":[[122,1],[132,1],[191,1],[246,2],[249,2],[252,2],[255,2]]},"342":{"position":[[49,1],[61,1],[123,2],[170,2],[173,2]]},"344":{"position":[[7,1],[13,1],[68,1],[110,2]]},"346":{"position":[[7,1],[27,1],[216,2],[385,2]]},"350":{"position":[[56,2]]},"354":{"position":[[254,1],[278,1],[280,2]]},"360":{"position":[[837,1],[941,1],[968,2],[980,2],[983,1],[1014,1],[1051,2],[1054,1],[1071,1],[1109,2],[1173,2],[1189,2],[1192,1],[1194,2],[1259,3],[1263,2],[1266,2],[1269,2],[1272,3],[1687,1],[1806,2],[1832,2],[1839,1],[1856,3],[1876,1],[1898,2],[1901,1],[1918,1],[1946,2],[1993,2],[2085,3],[2089,1],[2096,1],[2108,1],[2175,2],[2188,1],[2205,1],[2207,2],[2210,3]]},"362":{"position":[[523,1],[674,1],[676,2],[689,3],[727,2],[740,2],[743,1],[780,1],[836,2],[839,2],[867,2],[880,2],[883,1],[920,1],[976,2],[979,2],[1007,2],[1020,2],[1023,1],[1060,1],[1116,2],[1119,2],[1122,2],[1125,3]]},"365":{"position":[[162,1],[462,1],[500,1],[512,1],[525,2],[540,2],[543,1],[545,2],[578,1],[580,1],[582,1],[621,2],[639,1],[641,1],[648,1],[650,1],[652,3],[686,1],[698,1],[705,2],[720,2],[723,1],[725,2],[735,1],[737,1],[739,1],[767,3],[799,1],[811,1],[818,2],[833,2],[836,1],[838,2],[856,1],[865,3],[869,2],[973,1],[975,1],[977,1],[1006,2],[1009,1],[1011,2],[1029,1],[1038,3]]},"367":{"position":[[14,1],[16,1],[68,2],[112,2],[115,1],[117,2],[170,2],[241,2],[244,4],[249,2],[252,3]]},"369":{"position":[[453,2],[562,1],[590,2],[593,2],[619,1],[693,1],[727,1],[776,1],[798,2],[801,2],[816,2],[898,1],[927,1],[965,1],[1052,2],[1055,1],[1057,2],[1096,1],[1149,1],[1238,3],[1242,3],[1246,2],[1249,1],[1285,2],[1288,3],[1379,2]]},"371":{"position":[[10,1],[40,1],[73,1],[111,1],[226,2],[255,3],[592,1],[635,1],[668,1],[759,1],[777,1],[800,1],[834,2],[837,1],[869,1],[871,2],[895,2],[898,3]]},"374":{"position":[[69,1]]},"378":{"position":[[107,2],[255,2],[497,1]]},"383":{"position":[[60,1],[62,1],[64,1],[66,1],[100,2],[103,1],[105,2],[114,1],[116,1],[129,1],[131,1],[133,2],[157,1],[159,1],[161,1],[163,1],[243,3],[247,2],[287,1],[289,1],[291,1],[293,1],[359,1],[361,1],[363,1],[365,1]]},"385":{"position":[[165,1],[167,1],[169,1],[199,2],[202,1],[204,2],[266,3],[295,2],[395,1],[407,2],[423,2],[489,2],[492,1],[494,2],[498,1],[500,1],[502,1],[513,1],[515,1],[517,3],[521,2],[573,2],[683,3]]},"387":{"position":[[22,1]]},"389":{"position":[[63,1],[81,1],[96,1],[114,1],[155,1],[187,1],[230,1],[250,1]]},"391":{"position":[[105,1],[140,1],[201,1],[211,1],[256,2],[259,1],[333,1],[343,1],[388,2],[391,1],[466,1],[476,1],[528,1],[538,1],[583,2],[586,1],[620,1],[622,2],[625,1],[627,2],[630,1],[632,2]]},"397":{"position":[[0,2],[18,2],[33,1],[62,2],[136,2],[191,2],[194,2],[210,2],[271,2],[312,1],[356,2],[483,2],[486,1],[498,1],[563,2],[581,2],[584,1],[617,2],[633,2],[636,1],[656,2],[714,3]]},"399":{"position":[[26,1],[40,1],[80,1],[128,3],[153,1],[182,3],[222,1],[250,1],[264,1],[304,1],[340,3],[344,2],[480,3],[534,1]]},"401":{"position":[[12,1],[42,1],[72,2],[75,1],[85,1],[164,3],[179,1],[287,1],[299,4],[319,3]]},"404":{"position":[[199,2]]},"406":{"position":[[233,1],[266,1]]},"408":{"position":[[14,1],[34,1],[83,1],[85,1],[119,2],[133,1]]},"410":{"position":[[14,1],[28,1],[71,1],[73,1],[107,2],[121,1]]},"412":{"position":[[37,1],[67,2],[70,1],[72,3],[76,1],[85,1],[87,1],[97,1],[99,1],[101,2],[104,3],[131,1],[161,2],[164,1],[166,3],[170,1],[179,1],[181,1],[191,1],[193,1],[195,2],[198,3]]},"415":{"position":[[68,1],[84,1],[112,1],[171,3],[175,2],[223,1],[253,2],[256,1],[277,3],[281,1],[290,1],[292,1],[302,1],[304,1],[306,2],[309,3],[313,2],[390,2],[393,1],[414,3],[418,1],[427,1],[429,1],[454,1],[456,1],[458,2],[461,3],[513,1],[529,1],[557,1],[635,3],[639,2],[688,1],[703,1],[731,2],[734,1],[755,3],[759,1],[768,1],[770,1],[777,1],[779,1],[781,2],[784,1],[786,2],[789,2],[866,2],[869,1],[890,3],[894,1],[903,1],[905,1],[914,1],[916,1],[918,2],[921,3]]},"417":{"position":[[85,1],[101,1],[129,1],[214,3],[228,1],[230,1],[241,1],[263,1],[276,2],[327,2],[330,1],[351,3],[355,1],[364,1],[366,1],[368,1],[378,1],[380,2],[383,1],[385,1],[395,1],[397,1],[399,1],[401,2],[404,3]]},"419":{"position":[[322,1],[340,1],[368,1],[427,3],[441,1],[443,1],[452,1],[457,2],[508,2],[511,1],[534,3],[538,1],[565,1],[618,3],[672,1],[674,2],[677,3]]},"421":{"position":[[173,1],[191,1],[219,1],[304,3],[318,1],[320,1],[329,1],[341,1],[346,2],[400,2],[403,1],[427,3],[431,1],[443,1],[461,1],[514,3],[569,2],[588,1],[641,3],[695,1],[697,1],[699,2],[702,3]]},"423":{"position":[[69,2],[279,1],[318,1],[346,1],[405,3],[409,3],[429,2],[484,3],[504,2],[564,1],[576,1],[585,3],[589,3],[613,2],[626,1],[719,2],[722,1],[745,3],[749,1],[776,1],[829,3],[883,1],[885,2],[888,3],[1064,3],[1105,2]]},"429":{"position":[[0,2]]},"433":{"position":[[35,1],[71,1],[113,1],[157,2],[217,2],[350,2],[355,1],[377,3],[430,2],[433,1],[461,2],[464,2]]},"435":{"position":[[0,2]]},"437":{"position":[[103,1],[122,1],[198,2],[201,1],[215,1],[235,1],[249,1],[287,1],[357,2],[398,2],[401,1],[421,3]]},"439":{"position":[[107,1],[126,1],[210,2],[225,2],[238,3],[242,3],[246,1],[260,1],[280,1],[294,1],[332,1],[410,2],[425,2],[438,3],[442,3],[484,2],[487,1],[507,3]]},"441":{"position":[[107,1],[126,1],[159,2],[162,3],[243,2],[246,3],[250,1],[264,1],[284,1],[298,1],[336,1],[363,2],[366,3],[448,3],[490,2],[493,1],[513,3]]},"443":{"position":[[125,1],[144,1],[177,2],[180,3],[189,1],[191,2],[242,2],[338,2],[341,3],[345,1],[359,1],[379,1],[393,1],[431,1],[458,2],[461,3],[470,1],[472,2],[523,2],[619,2],[622,3],[664,2],[667,1],[687,3]]},"445":{"position":[[294,1],[313,1],[346,2],[349,3],[420,3],[424,1],[438,1],[458,1],[472,1],[486,1],[589,1],[603,1],[623,1],[637,1],[675,1],[702,2],[705,3],[776,3],[818,2],[821,1],[841,3],[924,1],[970,1],[998,1],[1018,3]]},"447":{"position":[[13,1],[77,1],[129,1]]},"449":{"position":[[66,1],[109,1],[148,1],[183,3],[204,1],[251,3],[293,2],[296,1],[316,3],[332,1],[375,1],[414,1],[468,2],[471,1],[513,3],[517,2],[520,3],[562,2],[565,1],[585,3],[666,2],[669,1],[697,1],[725,1],[754,3],[825,2],[828,1],[856,1],[884,1],[913,3],[984,2],[987,1],[1015,1],[1043,1],[1072,3]]},"454":{"position":[[0,2]]},"456":{"position":[[97,1],[110,1],[192,1],[222,2],[225,3],[262,1],[276,1],[296,1],[310,1],[342,1],[453,1],[481,1],[509,1],[511,2],[514,3],[551,3],[555,2]]},"458":{"position":[[95,1],[108,1],[180,2],[195,2],[208,3],[212,3],[233,1],[263,2],[266,3],[303,1],[317,1],[337,1],[351,1],[383,1],[455,2],[470,2],[483,3],[487,3],[537,1],[565,1],[593,1],[595,2],[598,3],[635,3],[639,2]]},"460":{"position":[[95,1],[108,1],[129,2],[132,3],[213,2],[216,3],[237,1],[267,2],[270,3],[307,1],[321,1],[341,1],[355,1],[387,1],[408,2],[411,3],[493,3],[543,1],[571,1],[599,1],[601,2],[604,3],[641,3],[645,2]]},"462":{"position":[[113,1],[126,1],[147,2],[150,3],[159,1],[161,2],[212,2],[308,2],[311,3],[332,1],[362,2],[365,3],[402,1],[416,1],[436,1],[450,1],[482,1],[503,2],[506,3],[515,1],[517,2],[568,2],[664,2],[667,3],[717,1],[745,1],[773,1],[775,2],[778,3],[815,3],[834,2]]},"464":{"position":[[282,1],[295,1],[316,2],[319,3],[390,3],[411,1],[441,2],[444,3],[481,1],[495,1],[515,1],[529,1],[543,1],[640,1],[654,1],[674,1],[688,1],[720,1],[741,2],[744,3],[815,3],[865,1],[893,1],[921,1],[923,2],[926,3],[963,3],[1046,1],[1086,1],[1114,1],[1134,3],[1138,2]]},"466":{"position":[[13,1],[77,1],[129,1]]},"468":{"position":[[54,1],[97,1],[136,1],[171,3],[186,1],[227,3],[243,1],[286,1],[319,1],[367,2],[370,1],[412,3],[416,2],[419,3],[494,2],[497,1],[525,1],[553,1],[582,3],[647,2],[650,1],[678,1],[706,1],[735,3],[800,2],[803,1],[831,1],[859,1],[888,3]]},"473":{"position":[[0,2]]},"475":{"position":[[105,1],[125,1],[228,2],[259,7],[284,1],[331,2],[334,3],[371,1],[385,1],[405,1],[419,1],[458,1],[561,2],[592,7],[665,1],[693,1],[721,1],[723,2],[726,3],[763,3],[767,2]]},"477":{"position":[[103,1],[123,1],[180,1],[233,2],[248,2],[261,3],[265,3],[269,2],[300,7],[325,1],[372,2],[375,3],[412,1],[426,1],[446,1],[460,1],[499,1],[556,1],[609,2],[624,2],[637,3],[641,3],[645,2],[676,7],[749,1],[777,1],[805,1],[807,2],[810,3],[847,3],[851,2]]},"479":{"position":[[103,1],[123,1],[180,1],[182,2],[185,3],[266,2],[269,3],[273,2],[304,7],[329,1],[376,2],[379,3],[416,1],[430,1],[450,1],[464,1],[503,1],[560,1],[562,2],[565,3],[647,3],[651,2],[682,7],[755,1],[783,1],[811,1],[813,2],[816,3],[853,3],[857,2]]},"481":{"position":[[121,1],[141,1],[198,1],[200,2],[203,3],[212,1],[214,2],[265,2],[361,2],[364,3],[368,2],[399,7],[424,1],[471,2],[474,3],[511,1],[525,1],[545,1],[559,1],[598,1],[655,1],[657,2],[660,3],[669,1],[671,2],[722,2],[818,2],[821,3],[825,2],[856,7],[929,1],[957,1],[985,1],[987,2],[990,3],[1027,3],[1046,2]]},"483":{"position":[[290,1],[310,1],[367,1],[369,2],[372,3],[443,3],[447,2],[478,7],[503,1],[550,2],[553,3],[590,1],[604,1],[624,1],[638,1],[652,1],[756,1],[770,1],[790,1],[804,1],[843,1],[900,1],[902,2],[905,3],[976,3],[980,2],[1011,7],[1084,1],[1112,1],[1140,1],[1142,2],[1145,3],[1182,3],[1265,1],[1312,1],[1340,1],[1360,3],[1364,2]]},"485":{"position":[[13,1],[77,1],[129,1]]},"487":{"position":[[62,1],[105,1],[144,1],[179,3],[201,1],[258,1],[280,3],[284,2],[315,7],[343,1],[385,1],[428,1],[468,1],[525,1],[554,2],[557,1],[599,3],[603,2],[606,3],[610,2],[641,7],[669,1],[779,2],[782,1],[810,1],[838,1],[867,3],[941,2],[944,1],[972,1],[1000,1],[1029,3],[1103,2],[1106,1],[1134,1],[1162,1],[1191,3]]},"492":{"position":[[63,1],[114,1],[124,1],[238,3],[290,1],[348,1],[371,1],[413,1],[425,1],[464,1],[647,1],[759,2],[762,2],[878,2],[889,1],[953,1],[1055,3],[1155,1],[1267,2],[1270,2],[1323,1],[1379,1],[1397,2],[1400,1],[1423,2],[1439,2],[1442,1],[1483,3],[1513,1],[1551,1],[1581,2],[1584,1],[1594,1],[1678,3],[1693,1],[1801,1],[1813,4],[1833,2],[1851,2],[1854,1],[1877,2],[1902,1],[1933,3],[1937,1],[1983,1],[1985,1],[2050,3],[2085,1],[2130,2],[2141,2],[2154,3],[2192,1],[2216,1],[2218,1]]},"494":{"position":[[105,1],[140,1],[211,2]]},"497":{"position":[[63,1],[75,1],[111,1],[113,1],[138,1],[173,1],[256,1],[270,1],[290,1],[302,1],[338,1],[340,1],[365,1],[431,2],[434,1],[462,1],[490,1],[534,3],[714,2]]},"499":{"position":[[58,1],[70,1],[106,1],[108,1],[133,1],[168,1],[210,2],[213,3],[231,3],[277,1],[291,1],[311,1],[323,1],[359,1],[361,1],[386,1],[418,1],[433,2],[436,3],[454,2],[479,2],[482,1],[510,1],[538,1],[582,1],[584,2],[763,2]]},"501":{"position":[[73,1],[85,1],[121,1],[123,1],[148,1],[183,1],[211,1],[218,2],[221,3],[239,2],[249,2],[294,1],[308,1],[328,1],[340,1],[376,1],[378,1],[403,1],[435,1],[442,2],[445,3],[463,2],[496,2],[499,1],[527,1],[555,1],[599,1],[601,2],[780,2]]},"509":{"position":[[63,1],[75,1],[120,3],[124,3],[128,7],[149,1],[200,1],[283,1],[297,1],[317,1],[329,1],[374,3],[378,3],[382,7],[403,1],[485,2],[488,1],[516,1],[544,1],[588,3],[768,2]]},"511":{"position":[[58,1],[70,1],[115,3],[119,3],[123,7],[144,1],[195,1],[237,2],[240,3],[258,3],[304,1],[318,1],[338,1],[350,1],[395,3],[399,3],[403,7],[424,1],[472,1],[487,2],[490,3],[508,2],[533,2],[536,1],[564,1],[592,1],[636,1],[638,2],[817,2]]},"513":{"position":[[73,1],[85,1],[130,3],[134,3],[138,7],[159,1],[210,1],[238,1],[245,2],[248,3],[266,2],[276,2],[321,1],[335,1],[355,1],[367,1],[412,3],[416,3],[420,7],[441,1],[489,1],[496,2],[499,3],[517,2],[550,2],[553,1],[581,1],[609,1],[653,1],[655,2],[834,2]]},"521":{"position":[[63,1],[75,1],[85,1],[113,1],[115,1],[127,1],[129,3],[146,1],[183,1],[264,1],[278,1],[298,1],[310,1],[320,1],[348,1],[350,1],[362,1],[364,3],[381,1],[449,2],[452,1],[480,1],[508,1],[550,3],[649,2]]},"523":{"position":[[58,1],[70,1],[80,1],[108,1],[110,1],[122,1],[124,3],[141,1],[178,1],[220,2],[223,3],[241,3],[285,1],[299,1],[319,1],[331,1],[341,1],[369,1],[371,1],[383,1],[385,3],[402,1],[438,1],[453,2],[456,3],[474,2],[497,2],[500,1],[528,1],[556,1],[598,1],[600,2],[698,2]]},"525":{"position":[[73,1],[85,1],[95,1],[123,1],[125,1],[137,1],[139,3],[156,1],[193,1],[221,1],[228,2],[231,3],[249,2],[259,2],[302,1],[316,1],[336,1],[348,1],[358,1],[386,1],[388,1],[400,1],[402,3],[419,1],[455,1],[462,2],[465,3],[483,2],[514,2],[517,1],[545,1],[573,1],[615,1],[617,2],[715,2]]},"531":{"position":[[63,1],[75,1],[103,1],[105,1],[120,1],[122,1],[147,1],[186,1],[269,1],[283,1],[303,1],[315,1],[343,1],[345,1],[360,1],[362,1],[387,1],[457,2],[460,1],[488,1],[516,1],[560,3],[740,2]]},"533":{"position":[[58,1],[70,1],[98,1],[100,1],[115,1],[117,1],[142,1],[181,1],[223,2],[226,3],[244,3],[290,1],[304,1],[324,1],[336,1],[364,1],[366,1],[381,1],[383,1],[408,1],[444,1],[459,2],[462,3],[480,2],[505,2],[508,1],[536,1],[564,1],[608,1],[610,2],[789,2]]},"535":{"position":[[73,1],[85,1],[113,1],[115,1],[130,1],[132,1],[157,1],[196,1],[224,1],[231,2],[234,3],[252,2],[262,2],[307,1],[321,1],[341,1],[353,1],[381,1],[383,1],[398,1],[400,1],[425,1],[461,1],[468,2],[471,3],[489,2],[522,2],[525,1],[553,1],[581,1],[625,1],[627,2],[806,2]]},"542":{"position":[[0,2],[43,1]]},"546":{"position":[[46,1],[58,1],[94,1],[136,1],[209,1],[223,1],[243,1],[255,1],[291,1],[354,2],[357,1],[385,1],[413,1],[457,3],[637,2]]},"548":{"position":[[56,1],[68,1],[104,1],[146,1],[178,2],[181,3],[199,3],[245,1],[259,1],[279,1],[291,1],[327,1],[364,1],[371,2],[374,3],[392,2],[417,2],[420,1],[448,1],[476,1],[520,1],[522,2],[701,2]]},"557":{"position":[[46,1],[58,1],[155,1],[228,1],[242,1],[262,1],[274,1],[392,2],[395,1],[423,1],[451,1],[495,3],[675,2]]},"559":{"position":[[56,1],[68,1],[165,1],[197,2],[200,3],[218,3],[264,1],[278,1],[298,1],[310,1],[402,1],[409,2],[412,3],[430,2],[455,2],[458,1],[486,1],[514,1],[558,1],[560,2],[739,2]]},"568":{"position":[[46,1],[58,1],[68,1],[96,1],[115,1],[143,1],[214,1],[228,1],[248,1],[260,1],[270,1],[298,1],[317,1],[366,2],[369,1],[397,1],[425,1],[467,3],[566,2]]},"570":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[185,2],[188,3],[206,3],[250,1],[264,1],[284,1],[296,1],[306,1],[334,1],[353,1],[378,1],[385,2],[388,3],[406,2],[429,2],[432,1],[460,1],[488,1],[530,1],[532,2],[630,2]]},"572":{"position":[[56,1],[68,1],[78,1],[106,1],[125,1],[153,1],[204,2],[207,3],[225,3],[269,1],[283,1],[303,1],[315,1],[325,1],[353,1],[372,1],[397,1],[423,2],[426,3],[444,2],[467,2],[470,1],[498,1],[526,1],[568,1],[570,2],[677,2]]},"579":{"position":[[46,1],[58,1],[86,1],[104,1],[146,1],[219,1],[233,1],[253,1],[265,1],[293,1],[311,1],[374,2],[377,1],[405,1],[433,1],[477,3],[657,2]]},"581":{"position":[[56,1],[68,1],[96,1],[114,1],[156,1],[188,2],[191,3],[209,3],[255,1],[269,1],[289,1],[301,1],[329,1],[347,1],[384,1],[391,2],[394,3],[412,2],[437,2],[440,1],[468,1],[496,1],[540,1],[542,2],[721,2]]},"588":{"position":[[35,1],[74,1],[132,1],[208,2],[211,1],[395,1],[419,3],[461,2],[464,1],[526,3],[543,1],[652,3],[679,2],[682,1],[756,1],[758,2],[807,2],[881,1],[883,2],[939,1],[963,1],[1076,1],[1083,1],[1085,2],[1147,1],[1216,1],[1218,3],[1222,3],[1267,3]]},"590":{"position":[[34,1],[136,3],[155,2],[158,1],[171,1],[178,1],[188,1],[221,2],[224,1],[253,2],[313,3],[317,1],[319,2],[344,2],[347,1],[360,1],[367,1],[377,1],[408,2],[411,1],[470,2],[473,1],[516,3],[520,3],[524,1],[526,2]]},"592":{"position":[[35,1],[68,1],[124,1],[194,1],[233,1],[277,1],[373,2],[389,1],[401,1],[408,1],[410,2],[464,1],[509,3],[513,1],[515,1],[530,1],[606,2],[609,1],[611,2],[643,2],[693,3],[697,2],[783,2],[856,2],[886,2],[976,3],[1018,2],[1021,1],[1083,3],[1112,2],[1115,1],[1137,1],[1324,2],[1327,3],[1356,4],[1361,3],[1365,10],[1376,7],[1393,4],[1424,7],[1432,4],[1437,8],[1446,6],[1453,11],[1496,3],[1500,3]]},"594":{"position":[[15,3],[19,1],[66,2],[76,1],[90,1],[122,1],[130,1],[185,1],[213,1],[241,1],[243,1],[251,3],[261,3],[275,3],[289,3],[293,2],[303,2],[306,2],[309,1],[323,1],[344,3],[389,2],[450,3],[484,2],[606,2],[609,3],[634,2],[654,1],[723,4],[728,4],[733,6],[775,2],[827,3],[845,2],[862,1],[895,1],[932,2],[962,2],[965,1],[991,3],[1012,2],[1058,3],[1092,5],[1098,3],[1109,1],[1111,1],[1125,1],[1139,1],[1147,1],[1161,1],[1175,1],[1183,1],[1196,1],[1210,1],[1218,1],[1231,1],[1245,1],[1253,1],[1267,2],[1270,3],[1274,1],[1321,2],[1331,1],[1396,1],[1440,1],[1534,1],[1553,1],[1578,1],[1610,1],[1612,3],[1683,2],[1713,1],[1742,1],[1774,1],[1776,3],[1804,2],[1823,1],[1907,1],[1909,3],[1965,2],[1991,1],[2077,1],[2079,3],[2112,2],[2133,1],[2217,1],[2219,3],[2297,2],[2319,1],[2405,1],[2407,3],[2435,2],[2456,1],[2542,1],[2544,3],[2600,2],[2628,1],[2716,1],[2718,3],[2751,2],[2774,1],[2860,1],[2862,3],[2940,2],[2964,1],[3052,1],[3054,3],[3085,2],[3105,1],[3125,1],[3127,1]]},"596":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[329,1],[355,1],[398,2],[401,1],[413,2],[428,3],[467,1],[469,1],[569,2],[596,2],[613,2],[623,2],[626,2],[629,1],[663,1],[665,1],[673,3],[683,3],[697,3],[711,3],[715,2],[729,1],[769,3],[814,2],[885,3],[919,2],[1051,2],[1054,3],[1079,2],[1099,1],[1178,4],[1183,4],[1188,6],[1230,2],[1282,3],[1334,2],[1409,3],[1451,2],[1531,1],[1567,3],[1571,3],[1589,2],[1616,1],[1716,2],[1719,1],[1721,3],[1823,2],[1856,1],[1887,3],[1942,1],[1949,1],[1972,2],[1975,1],[2006,3],[2027,2],[2073,3],[2077,1],[2079,3],[2101,5],[2107,3],[2118,1],[2120,1],[2134,1],[2153,1],[2161,1],[2175,1],[2194,1],[2202,1],[2215,1],[2234,1],[2242,1],[2255,1],[2274,1],[2282,1],[2296,1],[2315,1],[2334,2]]},"598":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[239,1],[301,1],[303,3],[310,2],[324,3],[333,2],[347,1],[373,1],[416,2],[419,1],[431,2],[446,3],[485,1],[487,1],[587,2],[614,2],[631,2],[641,2],[644,2],[647,1],[681,1],[683,1],[691,3],[701,3],[715,3],[729,3],[752,2],[766,1],[806,3],[851,2],[922,3],[956,2],[1088,2],[1091,3],[1116,2],[1136,1],[1215,4],[1220,4],[1225,6],[1267,2],[1319,3],[1371,2],[1446,3],[1488,2],[1568,1],[1604,3],[1608,3],[1626,2],[1653,1],[1753,2],[1756,1],[1758,3],[1860,2],[1893,1],[1924,3],[1979,1],[1986,1],[2009,2],[2012,1],[2043,3],[2064,2],[2108,3],[2112,1],[2114,3],[2136,5],[2142,3],[2153,1],[2155,1],[2169,1],[2188,1],[2196,1],[2210,1],[2229,1],[2237,1],[2250,1],[2269,1],[2277,1],[2290,1],[2309,1],[2317,1],[2331,1],[2350,1],[2369,2]]},"600":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[409,2],[423,1],[463,3],[508,2],[579,3],[613,2],[745,2],[748,3],[773,2],[793,1],[872,4],[877,4],[882,6],[924,2],[976,3],[994,2],[1011,1],[1047,1],[1084,2],[1108,2],[1111,1],[1137,3],[1158,2],[1204,3],[1226,5],[1232,3],[1243,1],[1245,1],[1259,1],[1273,1],[1281,1],[1295,1],[1309,1],[1317,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1401,2]]},"602":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[308,1],[317,2],[320,2],[323,1],[357,1],[359,1],[367,3],[377,3],[391,3],[405,3],[435,2],[449,1],[489,3],[534,2],[605,3],[639,2],[771,2],[774,3],[799,2],[819,1],[898,4],[903,4],[908,6],[950,2],[1002,3],[1020,2],[1036,1],[1066,1],[1076,1],[1130,1],[1194,2],[1197,2],[1221,2],[1224,1],[1247,2],[1250,1],[1276,3],[1297,2],[1343,3],[1347,3],[1369,5],[1375,3],[1386,1],[1388,1],[1402,1],[1416,1],[1424,1],[1438,1],[1452,1],[1460,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1544,2]]},"604":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[446,2],[460,1],[500,3],[545,2],[616,3],[650,2],[782,2],[785,3],[810,2],[830,1],[909,4],[914,4],[919,6],[961,2],[1013,3],[1031,2],[1048,1],[1084,1],[1121,2],[1145,2],[1148,1],[1174,3],[1195,2],[1239,3],[1261,5],[1267,3],[1278,1],[1280,1],[1294,1],[1308,1],[1316,1],[1330,1],[1344,1],[1352,1],[1365,1],[1379,1],[1387,1],[1400,1],[1414,1],[1422,1],[1436,2]]},"606":{"position":[[9,3],[13,1],[60,1],[148,2],[165,1],[218,1],[280,1],[282,3],[289,2],[303,3],[312,2],[326,1],[335,2],[338,2],[341,1],[375,1],[377,1],[385,3],[395,3],[409,3],[423,3],[472,2],[486,1],[526,3],[571,2],[642,3],[676,2],[808,2],[811,3],[836,2],[856,1],[935,4],[940,4],[945,6],[987,2],[1039,3],[1057,2],[1073,1],[1103,1],[1113,1],[1167,1],[1231,2],[1234,2],[1258,2],[1261,1],[1284,2],[1287,1],[1313,3],[1334,2],[1378,3],[1382,3],[1404,5],[1410,3],[1421,1],[1423,1],[1437,1],[1451,1],[1459,1],[1473,1],[1487,1],[1495,1],[1508,1],[1522,1],[1530,1],[1543,1],[1557,1],[1565,1],[1579,2]]},"608":{"position":[[72,2]]},"612":{"position":[[166,1],[198,1],[231,3],[241,3],[255,3],[259,3],[301,2],[304,1],[332,1],[379,1],[381,3],[508,1],[540,1],[567,3],[577,3],[591,3],[595,3],[636,2],[639,1],[667,1],[724,1],[726,3],[860,1],[899,1],[953,1],[961,3],[971,3],[985,3],[989,3],[1046,2],[1049,1],[1077,1],[1141,1],[1143,3],[1280,1],[1298,2],[1301,1],[1329,1],[1375,1],[1396,3],[1613,1],[1631,2],[1634,1],[1662,1],[1706,1],[1727,3]]},"614":{"position":[[184,1],[203,1],[242,3],[252,3],[266,3],[270,3],[274,1],[288,1],[316,1],[336,1],[338,1],[489,1],[516,3],[526,3],[540,3],[544,3],[552,1],[571,1],[601,1],[615,1],[643,1],[663,1],[665,1],[830,1],[884,1],[892,3],[902,3],[916,3],[920,3],[928,1],[972,1],[986,1],[1014,1],[1061,1],[1063,1],[1165,1],[1180,1],[1216,1],[1242,1],[1256,1],[1284,1],[1322,1],[1324,1],[1508,1],[1523,1],[1557,1],[1583,1],[1597,1],[1625,1],[1661,1],[1663,1]]},"618":{"position":[[7,3],[24,4],[47,8],[78,5],[98,15],[122,4],[134,3],[142,1],[152,12],[172,12],[185,8],[194,5],[226,14],[251,4],[260,1],[284,4],[289,3]]}}}],["0",{"_index":88,"t":{"320":{"position":[[569,2],[618,2],[997,2],[1046,2]]},"342":{"position":[[255,2]]},"389":{"position":[[121,2]]},"419":{"position":[[579,2],[596,2],[609,2],[654,2],[670,1]]},"421":{"position":[[475,2],[492,2],[505,2],[551,2],[567,1],[602,2],[619,2],[632,2],[677,2],[693,1]]},"423":{"position":[[790,2],[807,2],[820,2],[865,2],[881,1]]},"433":{"position":[[291,2]]},"590":{"position":[[173,2],[362,2]]},"592":{"position":[[1308,2],[1321,2]]},"596":{"position":[[2332,1]]},"598":{"position":[[313,2],[2367,1]]},"604":{"position":[[292,2]]},"606":{"position":[[292,2]]}}}],["0deprec",{"_index":753,"t":{"425":{"position":[[0,11]]},"620":{"position":[[101,11]]}}}],["0xffffff",{"_index":930,"t":{"588":{"position":[[386,8]]},"592":{"position":[[876,9]]}}}],["1",{"_index":131,"t":{"322":{"position":[[1287,4],[1553,3]]},"324":{"position":[[73,1],[477,1],[653,1]]},"342":{"position":[[258,2]]},"365":{"position":[[517,2],[703,1],[760,3],[764,2],[816,1],[854,1],[858,1],[986,3],[990,3],[1027,1],[1031,1]]},"383":{"position":[[58,1],[155,1],[285,1],[357,1]]},"389":{"position":[[135,1]]},"391":{"position":[[189,3],[222,3],[321,3],[454,3],[516,3]]},"412":{"position":[[35,1],[39,1],[129,1],[133,1]]},"415":{"position":[[221,1],[225,1],[686,1],[690,1]]},"417":{"position":[[239,1],[243,1]]},"419":{"position":[[449,2],[454,2]]},"421":{"position":[[326,2],[331,2]]},"423":{"position":[[561,2],[566,2]]},"433":{"position":[[347,2],[353,1]]},"449":{"position":[[448,2]]},"468":{"position":[[347,2]]},"487":{"position":[[534,2]]},"492":{"position":[[2138,2]]},"497":{"position":[[121,3],[348,3]]},"499":{"position":[[116,3],[369,3]]},"501":{"position":[[131,3],[386,3]]},"531":{"position":[[130,3],[370,3]]},"533":{"position":[[125,3],[391,3]]},"535":{"position":[[140,3],[408,3]]},"546":{"position":[[109,3],[306,3]]},"548":{"position":[[119,3],[342,3]]},"579":{"position":[[119,3],[326,3]]},"581":{"position":[[129,3],[362,3]]},"594":{"position":[[1216,1]]},"596":{"position":[[2240,1]]},"598":{"position":[[336,2],[2275,1]]},"600":{"position":[[1350,1]]},"602":{"position":[[1493,1]]},"604":{"position":[[315,2],[1385,1]]},"606":{"position":[[315,2],[1528,1]]},"612":{"position":[[1278,1],[1282,3],[1611,1],[1615,3]]},"614":{"position":[[1214,1],[1218,4],[1555,1],[1559,4]]}}}],["1+1",{"_index":533,"t":{"371":{"position":[[284,3]]}}}],["1+:toadd",{"_index":696,"t":{"401":{"position":[[269,8]]},"492":{"position":[[1783,8]]}}}],["1,2",{"_index":495,"t":{"365":{"position":[[608,5]]}}}],["1.0.0",{"_index":275,"t":{"340":{"position":[[202,8]]},"492":{"position":[[2026,8]]}}}],["1.1",{"_index":287,"t":{"342":{"position":[[261,4]]}}}],["1.1earli",{"_index":1123,"t":{"620":{"position":[[756,8]]}}}],["1.2",{"_index":288,"t":{"342":{"position":[[266,4]]}}}],["1.2releas",{"_index":1127,"t":{"620":{"position":[[848,10]]}}}],["10",{"_index":76,"t":{"320":{"position":[[374,3],[387,3],[802,3],[815,3]]},"371":{"position":[[237,2]]},"401":{"position":[[296,2]]},"421":{"position":[[532,3]]},"492":{"position":[[1810,2]]},"588":{"position":[[280,3]]},"592":{"position":[[754,3]]}}}],["1000",{"_index":958,"t":{"590":{"position":[[322,6],[529,6]]}}}],["1045",{"_index":976,"t":{"592":{"position":[[504,4]]}}}],["1080",{"_index":548,"t":{"371":{"position":[[864,4]]}}}],["12",{"_index":607,"t":{"383":{"position":[[126,2]]}}}],["120",{"_index":793,"t":{"433":{"position":[[335,4]]}}}],["123",{"_index":786,"t":{"433":{"position":[[152,4]]},"592":{"position":[[689,3]]}}}],["1234",{"_index":928,"t":{"588":{"position":[[330,5]]},"592":{"position":[[817,5]]}}}],["137",{"_index":68,"t":{"318":{"position":[[637,5],[1017,5]]}}}],["14",{"_index":120,"t":{"322":{"position":[[364,3],[872,3]]}}}],["16000",{"_index":643,"t":{"387":{"position":[[86,5]]}}}],["18.x",{"_index":195,"t":{"334":{"position":[[60,5]]}}}],["19",{"_index":916,"t":{"509":{"position":[[160,3],[414,3]]},"511":{"position":[[155,3],[435,3]]},"513":{"position":[[170,3],[452,3]]},"557":{"position":[[112,4],[328,4]]},"559":{"position":[[122,4],[364,4]]}}}],["1998",{"_index":1098,"t":{"616":{"position":[[12,5]]}}}],["1experiment",{"_index":317,"t":{"348":{"position":[[144,13]]},"620":{"position":[[642,13]]}}}],["2",{"_index":140,"t":{"324":{"position":[[85,1],[489,1],[665,1]]},"342":{"position":[[271,1]]},"365":{"position":[[523,1]]},"385":{"position":[[293,1],[464,3]]},"399":{"position":[[195,3],[199,4]]},"412":{"position":[[95,1],[189,1]]},"415":{"position":[[300,1],[701,1],[705,1],[772,2]]},"417":{"position":[[261,1],[265,1],[376,1]]},"419":{"position":[[636,2]]},"421":{"position":[[338,2],[343,2],[659,2]]},"423":{"position":[[573,2],[578,2],[847,2]]},"588":{"position":[[349,2]]},"592":{"position":[[836,2]]},"594":{"position":[[1181,1]]},"596":{"position":[[2200,1]]},"598":{"position":[[2235,1]]},"600":{"position":[[1315,1]]},"602":{"position":[[1117,4],[1171,1],[1180,4],[1458,1]]},"604":{"position":[[1350,1]]},"606":{"position":[[1154,4],[1208,1],[1217,4],[1493,1]]}}}],["2+3",{"_index":878,"t":{"492":{"position":[[785,3],[1292,3]]}}}],["2.0",{"_index":505,"t":{"369":{"position":[[238,3]]}}}],["2.rds.amazonaws.com",{"_index":824,"t":{"445":{"position":[[379,21],[735,21]]},"464":{"position":[[349,21],[774,21]]},"483":{"position":[[402,21],[935,21]]}}}],["20",{"_index":917,"t":{"531":{"position":[[149,4],[389,4]]},"533":{"position":[[144,4],[410,4]]},"535":{"position":[[159,4],[427,4]]},"579":{"position":[[88,2],[295,2]]},"581":{"position":[[98,2],[331,2]]}}}],["2113931265",{"_index":982,"t":{"592":{"position":[[907,11]]}}}],["2119",{"_index":834,"t":{"447":{"position":[[71,5]]},"466":{"position":[[71,5]]},"485":{"position":[[71,5]]}}}],["2130",{"_index":832,"t":{"447":{"position":[[7,5]]},"466":{"position":[[7,5]]},"485":{"position":[[7,5]]}}}],["2131",{"_index":837,"t":{"447":{"position":[[123,5]]},"466":{"position":[[123,5]]},"485":{"position":[[123,5]]}}}],["2181036031",{"_index":983,"t":{"592":{"position":[[936,11]]}}}],["2282",{"_index":1099,"t":{"616":{"position":[[18,5]]}}}],["253",{"_index":996,"t":{"592":{"position":[[1296,4]]}}}],["2stabl",{"_index":289,"t":{"342":{"position":[[288,7],[296,7]]},"415":{"position":[[0,7]]},"417":{"position":[[0,7]]},"419":{"position":[[0,7]]},"421":{"position":[[0,7]]},"423":{"position":[[0,7]]},"612":{"position":[[17,7],[396,7],[748,7],[1155,7],[1492,7]]},"614":{"position":[[17,7],[351,7],[685,7],[1073,7],[1418,7]]},"620":{"position":[[1114,7]]}}}],["3",{"_index":188,"t":{"332":{"position":[[39,2]]},"342":{"position":[[277,2]]},"362":{"position":[[292,3]]},"365":{"position":[[646,1]]},"385":{"position":[[511,1]]},"391":{"position":[[232,3],[354,3],[364,3],[549,3],[559,3]]},"399":{"position":[[388,1]]},"594":{"position":[[1251,1]]},"596":{"position":[[2280,1]]},"598":{"position":[[2315,1]]},"600":{"position":[[1385,1]]},"602":{"position":[[1528,1]]},"604":{"position":[[1420,1]]},"606":{"position":[[1563,1]]}}}],["33",{"_index":992,"t":{"592":{"position":[[1261,3]]}}}],["3306",{"_index":547,"t":{"371":{"position":[[829,4]]},"439":{"position":[[219,5],[419,5]]},"449":{"position":[[178,4],[508,4]]},"458":{"position":[[189,5],[464,5]]},"468":{"position":[[166,4],[407,4]]},"477":{"position":[[242,5],[618,5]]},"487":{"position":[[174,4],[594,4]]},"492":{"position":[[163,5],[980,5],[1633,5]]}}}],["384",{"_index":994,"t":{"592":{"position":[[1279,4]]}}}],["3legaci",{"_index":1139,"t":{"620":{"position":[[1181,7]]}}}],["4",{"_index":725,"t":{"415":{"position":[[775,1]]},"417":{"position":[[393,1]]},"594":{"position":[[1123,1],[1145,1]]},"596":{"position":[[2132,1],[2159,1]]},"598":{"position":[[2167,1],[2194,1]]},"600":{"position":[[1257,1],[1279,1]]},"602":{"position":[[1400,1],[1422,1]]},"604":{"position":[[1292,1],[1314,1]]},"606":{"position":[[1435,1],[1457,1]]}}}],["4.5.2",{"_index":706,"t":{"404":{"position":[[222,8]]}}}],["45",{"_index":51,"t":{"316":{"position":[[408,3],[640,3],[941,4],[1144,4]]},"509":{"position":[[172,4],[426,4]]},"511":{"position":[[167,4],[447,4]]},"513":{"position":[[182,4],[464,4]]},"521":{"position":[[157,4],[392,4]]},"523":{"position":[[152,4],[413,4]]},"525":{"position":[[167,4],[430,4]]},"557":{"position":[[126,5],[342,5]]},"559":{"position":[[136,5],[378,5]]},"568":{"position":[[117,4],[319,4]]},"570":{"position":[[127,4],[355,4]]},"572":{"position":[[127,4],[374,4]]}}}],["5",{"_index":605,"t":{"383":{"position":[[80,3]]},"590":{"position":[[180,2],[369,2]]}}}],["5.6.10",{"_index":981,"t":{"592":{"position":[[773,9]]}}}],["53",{"_index":69,"t":{"318":{"position":[[643,3],[1023,4]]}}}],["6",{"_index":606,"t":{"383":{"position":[[84,3]]}}}],["6.9.0",{"_index":897,"t":{"492":{"position":[[2207,8]]}}}],["60000",{"_index":84,"t":{"320":{"position":[[480,6],[551,5],[908,6],[979,5]]}}}],["8",{"_index":929,"t":{"588":{"position":[[366,2]]},"592":{"position":[[853,2]]}}}],["8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":806,"t":{"441":{"position":[[193,43]]},"460":{"position":[[163,43]]},"479":{"position":[[216,43]]}}}],["8编码支持、二进制文件编码支持、压缩和ssl",{"_index":1,"t":{"312":{"position":[[42,24]]}}}],["_err",{"_index":715,"t":{"412":{"position":[[54,6],[148,6]]},"415":{"position":[[240,6],[377,6],[718,6],[853,6]]},"417":{"position":[[314,6]]},"419":{"position":[[493,6]]},"421":{"position":[[384,6]]},"423":{"position":[[704,6]]}}}],["a,b,c,d",{"_index":498,"t":{"367":{"position":[[31,7]]}}}],["a.j",{"_index":838,"t":{"449":{"position":[[44,4]]},"468":{"position":[[32,4]]},"487":{"position":[[40,4]]}}}],["abov",{"_index":94,"t":{"320":{"position":[[1194,5],[1400,5],[1614,5],[1845,5]]},"397":{"position":[[708,5]]}}}],["accept",{"_index":551,"t":{"371":{"position":[[976,6]]}}}],["access",{"_index":508,"t":{"369":{"position":[[357,6]]},"408":{"position":[[57,7]]},"410":{"position":[[51,7]]},"429":{"position":[[76,6]]},"594":{"position":[[221,7]]},"596":{"position":[[637,7]]},"598":{"position":[[655,7]]},"600":{"position":[[331,7]]},"602":{"position":[[331,7]]},"604":{"position":[[349,7]]},"606":{"position":[[349,7]]},"608":{"position":[[144,6]]}}}],["accord",{"_index":449,"t":{"360":{"position":[[2435,9]]}}}],["accordingli",{"_index":404,"t":{"360":{"position":[[760,12]]}}}],["ack",{"_index":635,"t":{"385":{"position":[[641,3]]}}}],["action",{"_index":314,"t":{"348":{"position":[[101,7],[238,7],[335,7],[530,7]]}}}],["activ",{"_index":1141,"t":{"620":{"position":[[1289,6]]}}}],["ad",{"_index":1084,"t":{"612":{"position":[[122,6]]}}}],["add(group",{"_index":852,"t":{"475":{"position":[[0,10]]},"477":{"position":[[0,10]]},"479":{"position":[[0,10]]},"481":{"position":[[0,10]]},"483":{"position":[[0,10]]},"487":{"position":[[0,10]]}}}],["addit",{"_index":339,"t":{"350":{"position":[[226,10]]},"360":{"position":[[599,10]]},"362":{"position":[[245,10],[296,10]]},"369":{"position":[[3,8]]},"371":{"position":[[905,8]]},"380":{"position":[[251,8]]},"395":{"position":[[3,8]]}}}],["addition",{"_index":109,"t":{"320":{"position":[[2043,13]]}}}],["address",{"_index":1150,"t":{"620":{"position":[[1520,10]]}}}],["advanc",{"_index":755,"t":{"427":{"position":[[80,8]]}}}],["affect",{"_index":1066,"t":{"596":{"position":[[2317,8]]},"598":{"position":[[2352,8]]}}}],["affectedrow",{"_index":572,"t":{"378":{"position":[[222,13]]},"419":{"position":[[242,12],[582,13]]},"421":{"position":[[478,13],[605,13]]},"423":{"position":[[793,13]]},"596":{"position":[[485,15]]},"598":{"position":[[503,15]]}}}],["ag",{"_index":50,"t":{"316":{"position":[[400,5],[619,5],[933,5],[1123,5]]},"318":{"position":[[616,5],[996,5]]},"322":{"position":[[342,5],[850,5]]},"509":{"position":[[106,6],[360,6]]},"511":{"position":[[101,6],[381,6]]},"513":{"position":[[116,6],[398,6]]},"521":{"position":[[121,5],[356,5]]},"523":{"position":[[116,5],[377,5]]},"525":{"position":[[131,5],[394,5]]},"531":{"position":[[97,5],[337,5]]},"533":{"position":[[92,5],[358,5]]},"535":{"position":[[107,5],[375,5]]},"557":{"position":[[89,6],[305,6]]},"559":{"position":[[99,6],[341,6]]},"568":{"position":[[109,5],[311,5]]},"570":{"position":[[119,5],[347,5]]},"572":{"position":[[119,5],[366,5]]},"579":{"position":[[80,5],[287,5]]},"581":{"position":[[90,5],[323,5]]}}}],["again",{"_index":469,"t":{"362":{"position":[[396,6]]},"494":{"position":[[244,6]]}}}],["aim",{"_index":329,"t":{"350":{"position":[[7,4]]}}}],["algorithm",{"_index":454,"t":{"360":{"position":[[2592,9]]}}}],["algoritm",{"_index":470,"t":{"362":{"position":[[502,9]]}}}],["allow",{"_index":257,"t":{"338":{"position":[[181,6]]}}}],["alongsid",{"_index":272,"t":{"340":{"position":[[90,9]]}}}],["alway",{"_index":358,"t":{"354":{"position":[[192,6]]},"360":{"position":[[1488,6],[2239,6]]},"596":{"position":[[1793,6]]},"598":{"position":[[1830,6]]}}}],["amazon",{"_index":817,"t":{"445":{"position":[[56,6],[113,6],[406,7],[762,7]]},"447":{"position":[[36,6],[138,6]]},"464":{"position":[[44,6],[101,6],[376,7],[801,7]]},"466":{"position":[[36,6],[138,6]]},"483":{"position":[[52,6],[109,6],[429,7],[962,7]]},"485":{"position":[[36,6],[138,6]]}}}],["anoth",{"_index":389,"t":{"360":{"position":[[372,7]]}}}],["answer",{"_index":1073,"t":{"608":{"position":[[22,7]]},"612":{"position":[[84,7]]},"614":{"position":[[84,7]]}}}],["api",{"_index":114,"t":{"322":{"position":[[19,4]]},"326":{"position":[[128,4]]},"350":{"position":[[74,3]]},"360":{"position":[[1303,3]]},"395":{"position":[[79,3]]},"618":{"position":[[29,17],[138,3]]}}}],["api文档来知道更多的api",{"_index":162,"t":{"328":{"position":[[26,31]]}}}],["appli",{"_index":174,"t":{"328":{"position":[[242,7]]}}}],["approach",{"_index":1124,"t":{"620":{"position":[[817,11]]}}}],["arg",{"_index":943,"t":{"588":{"position":[[772,5]]}}}],["argument",{"_index":176,"t":{"328":{"position":[[261,10]]},"374":{"position":[[89,9]]}}}],["arguments[1",{"_index":945,"t":{"588":{"position":[[941,13],[1149,13]]}}}],["arguments[2",{"_index":946,"t":{"588":{"position":[[965,13]]}}}],["array",{"_index":142,"t":{"324":{"position":[[793,5],[802,6],[824,5]]},"365":{"position":[[398,5],[942,5]]},"367":{"position":[[139,5],[148,6]]},"378":{"position":[[536,5]]},"385":{"position":[[230,5],[318,5]]},"415":{"position":[[11,5]]},"572":{"position":[[614,5]]},"588":{"position":[[824,7],[840,7]]}}}],["array.isarray(arguments[1",{"_index":944,"t":{"588":{"position":[[851,29]]}}}],["asc",{"_index":1021,"t":{"594":{"position":[[926,5]]},"596":{"position":[[1558,4]]},"598":{"position":[[1595,4]]},"600":{"position":[[1078,5]]},"602":{"position":[[1107,3],[1161,3]]},"604":{"position":[[1115,5]]},"606":{"position":[[1144,3],[1198,3]]}}}],["ascertain",{"_index":1132,"t":{"620":{"position":[[1045,9]]}}}],["ask",{"_index":147,"t":{"324":{"position":[[915,3]]},"360":{"position":[[43,3]]},"608":{"position":[[42,5]]}}}],["assur",{"_index":1104,"t":{"620":{"position":[[162,6]]}}}],["async",{"_index":116,"t":{"322":{"position":[[77,5],[982,5]]},"399":{"position":[[0,5],[224,5]]},"492":{"position":[[92,5],[1962,5]]},"594":{"position":[[296,6]]},"596":{"position":[[616,6]]},"598":{"position":[[634,6]]},"600":{"position":[[310,6]]},"602":{"position":[[310,6]]},"604":{"position":[[328,6]]},"606":{"position":[[328,6]]}}}],["asynchron",{"_index":402,"t":{"360":{"position":[[703,14]]}}}],["attach",{"_index":600,"t":{"380":{"position":[[499,6]]}}}],["auth",{"_index":379,"t":{"360":{"position":[[83,4],[801,4],[952,6],[1869,6]]},"362":{"position":[[702,5],[842,5],[982,5]]},"592":{"position":[[119,4]]}}}],["auth.doublesha1('pass123",{"_index":967,"t":{"592":{"position":[[235,27]]}}}],["auth.verifytoken",{"_index":969,"t":{"592":{"position":[[279,17]]}}}],["authcallback",{"_index":984,"t":{"592":{"position":[[948,13]]}}}],["authent",{"_index":341,"t":{"350":{"position":[[283,14]]},"360":{"position":[[211,14],[610,14]]},"362":{"position":[[34,14],[159,14],[256,14],[412,14]]},"592":{"position":[[962,13]]},"618":{"position":[[262,14]]}}}],["authenticate(param",{"_index":964,"t":{"592":{"position":[[169,20]]}}}],["authentication::native41",{"_index":450,"t":{"360":{"position":[[2448,24]]}}}],["authnextfactor",{"_index":461,"t":{"362":{"position":[[90,14]]}}}],["author",{"_index":893,"t":{"492":{"position":[[2144,9]]}}}],["authplugin",{"_index":381,"t":{"360":{"position":[[103,11],[928,12],[2480,11]]},"362":{"position":[[661,12]]}}}],["authswitchhandl",{"_index":424,"t":{"360":{"position":[[1318,17],[1778,18],[2508,17]]}}}],["authswitchrequest",{"_index":440,"t":{"360":{"position":[[2130,17]]}}}],["auto",{"_index":237,"t":{"336":{"position":[[709,4]]}}}],["auto_incr",{"_index":1011,"t":{"594":{"position":[[548,15]]},"596":{"position":[[993,15]]},"598":{"position":[[1030,15]]},"600":{"position":[[687,15]]},"602":{"position":[[713,15]]},"604":{"position":[[724,15]]},"606":{"position":[[750,15]]}}}],["automat",{"_index":97,"t":{"320":{"position":[[1289,13],[1496,13]]},"590":{"position":[[270,13]]}}}],["avail",{"_index":285,"t":{"342":{"position":[[237,9]]},"371":{"position":[[1080,10]]},"497":{"position":[[704,9]]},"499":{"position":[[753,9]]},"501":{"position":[[770,9]]},"509":{"position":[[758,9]]},"511":{"position":[[807,9]]},"513":{"position":[[824,9]]},"521":{"position":[[639,9]]},"523":{"position":[[688,9]]},"525":{"position":[[705,9]]},"531":{"position":[[730,9]]},"533":{"position":[[779,9]]},"535":{"position":[[796,9]]},"546":{"position":[[627,9]]},"548":{"position":[[691,9]]},"557":{"position":[[665,9]]},"559":{"position":[[729,9]]},"568":{"position":[[556,9]]},"570":{"position":[[620,9]]},"572":{"position":[[667,9]]},"579":{"position":[[647,9]]},"581":{"position":[[711,9]]},"620":{"position":[[1330,10]]}}}],["avg",{"_index":173,"t":{"328":{"position":[[221,5]]}}}],["avoid",{"_index":179,"t":{"328":{"position":[[301,5]]}}}],["await",{"_index":34,"t":{"316":{"position":[[201,5],[327,5],[551,5]]},"318":{"position":[[400,5],[546,5]]},"320":{"position":[[1223,5],[1633,5],[1697,5]]},"322":{"position":[[145,5],[272,5],[634,5],[780,5],[1255,5]]},"324":{"position":[[173,5],[445,5]]},"399":{"position":[[82,5],[155,5],[204,5],[398,5],[516,5]]},"401":{"position":[[356,5]]},"437":{"position":[[124,5]]},"439":{"position":[[128,5]]},"441":{"position":[[128,5]]},"443":{"position":[[146,5]]},"445":{"position":[[315,5],[488,5],[547,5]]},"456":{"position":[[194,5]]},"458":{"position":[[235,5]]},"460":{"position":[[239,5]]},"462":{"position":[[334,5]]},"464":{"position":[[413,5],[545,5],[604,5]]},"475":{"position":[[286,5]]},"477":{"position":[[327,5]]},"479":{"position":[[331,5]]},"481":{"position":[[426,5]]},"483":{"position":[[505,5],[654,5],[713,5]]},"492":{"position":[[126,5],[292,5],[373,5],[675,5],[930,5],[1183,5],[1364,5],[2007,7]]},"497":{"position":[[175,5]]},"499":{"position":[[170,5]]},"501":{"position":[[185,5]]},"509":{"position":[[202,5]]},"511":{"position":[[197,5]]},"513":{"position":[[212,5]]},"521":{"position":[[185,5]]},"523":{"position":[[180,5]]},"525":{"position":[[195,5]]},"531":{"position":[[188,5]]},"533":{"position":[[183,5]]},"535":{"position":[[198,5]]},"546":{"position":[[138,5]]},"548":{"position":[[148,5]]},"557":{"position":[[157,5]]},"559":{"position":[[167,5]]},"568":{"position":[[145,5]]},"570":{"position":[[155,5]]},"572":{"position":[[155,5]]},"579":{"position":[[148,5]]},"581":{"position":[[158,5]]},"594":{"position":[[392,5],[487,5],[656,5],[864,5],[1062,5]]},"596":{"position":[[731,5],[817,5],[922,5],[1101,5],[1337,5],[1454,5],[1618,5],[2083,5]]},"598":{"position":[[768,5],[854,5],[959,5],[1138,5],[1374,5],[1491,5],[1655,5],[2118,5]]},"600":{"position":[[425,5],[511,5],[616,5],[795,5],[1013,5],[1208,5]]},"602":{"position":[[451,5],[537,5],[642,5],[821,5],[1038,5],[1351,5]]},"604":{"position":[[462,5],[548,5],[653,5],[832,5],[1050,5],[1243,5]]},"606":{"position":[[488,5],[574,5],[679,5],[858,5],[1075,5],[1386,5]]},"614":{"position":[[205,5],[573,5],[930,5],[1182,5],[1525,5]]}}}],["await.j",{"_index":863,"t":{"492":{"position":[[0,8],[2062,11]]}}}],["b",{"_index":233,"t":{"336":{"position":[[622,1]]},"367":{"position":[[197,1]]}}}],["b.j",{"_index":839,"t":{"449":{"position":[[49,4]]},"468":{"position":[[37,4]]},"487":{"position":[[45,4]]}}}],["babel",{"_index":896,"t":{"492":{"position":[[2194,6]]}}}],["babelrc",{"_index":865,"t":{"492":{"position":[[15,8]]}}}],["back",{"_index":400,"t":{"360":{"position":[[659,4]]}}}],["backend",{"_index":772,"t":{"431":{"position":[[118,8],[166,8]]}}}],["backward",{"_index":1105,"t":{"620":{"position":[[169,8],[281,8]]}}}],["badg",{"_index":280,"t":{"342":{"position":[[18,6]]},"620":{"position":[[14,6]]}}}],["bar",{"_index":543,"t":{"371":{"position":[[730,6]]},"397":{"position":[[241,6],[528,6]]}}}],["base",{"_index":664,"t":{"395":{"position":[[73,5]]},"620":{"position":[[983,5]]}}}],["basic",{"_index":759,"t":{"427":{"position":[[608,5]]}}}],["befor",{"_index":327,"t":{"348":{"position":[[474,6]]},"594":{"position":[[1651,6]]}}}],["begin",{"_index":749,"t":{"423":{"position":[[551,5]]},"596":{"position":[[1518,5]]},"598":{"position":[[1555,5]]}}}],["behavior",{"_index":595,"t":{"380":{"position":[[363,8]]}}}],["below",{"_index":918,"t":{"544":{"position":[[13,5]]},"555":{"position":[[13,5]]},"566":{"position":[[13,5]]},"577":{"position":[[13,5]]}}}],["benchmark",{"_index":375,"t":{"358":{"position":[[63,10],[85,10],[115,10]]}}}],["beta",{"_index":990,"t":{"592":{"position":[[1222,7],[1239,7]]}}}],["better",{"_index":335,"t":{"350":{"position":[[168,6]]},"383":{"position":[[449,6]]},"494":{"position":[[334,6]]}}}],["between",{"_index":458,"t":{"360":{"position":[[2648,7]]},"404":{"position":[[107,7]]}}}],["bin.000007",{"_index":791,"t":{"433":{"position":[[311,12]]}}}],["binari",{"_index":345,"t":{"350":{"position":[[362,6]]},"378":{"position":[[584,6]]}}}],["bind",{"_index":368,"t":{"356":{"position":[[99,8],[173,8]]},"389":{"position":[[4,4]]}}}],["binlog",{"_index":373,"t":{"356":{"position":[[249,6]]}}}],["binlogpo",{"_index":792,"t":{"433":{"position":[[324,10]]}}}],["binlogstream",{"_index":783,"t":{"433":{"position":[[100,12]]}}}],["binlogstream.pip",{"_index":795,"t":{"433":{"position":[[381,18]]}}}],["blob",{"_index":433,"t":{"360":{"position":[[1607,4]]}}}],["block",{"_index":294,"t":{"344":{"position":[[176,6]]},"433":{"position":[[362,8]]},"614":{"position":[[137,6],[435,6],[769,6],[1154,6],[1497,6]]}}}],["bluebird",{"_index":122,"t":{"322":{"position":[[519,8],[535,8],[549,11],[595,8],[725,9]]}}}],["boolean",{"_index":588,"t":{"380":{"position":[[146,7]]},"389":{"position":[[105,7]]}}}],["both",{"_index":1093,"t":{"612":{"position":[[1417,4],[1748,4]]},"614":{"position":[[1343,4],[1682,4]]}}}],["bound",{"_index":1107,"t":{"620":{"position":[[230,5]]}}}],["branch",{"_index":205,"t":{"336":{"position":[[154,6]]}}}],["browser",{"_index":220,"t":{"336":{"position":[[399,7]]}}}],["buffer",{"_index":398,"t":{"360":{"position":[[630,8],[1667,8]]},"389":{"position":[[222,6]]}}}],["buffer.from",{"_index":805,"t":{"441":{"position":[[180,12]]},"460":{"position":[[150,12]]},"479":{"position":[[203,12]]}}}],["buffer.from('8bb6118f8fd6935ad0876a3be34a717d32708ffd",{"_index":808,"t":{"441":{"position":[[384,55]]},"460":{"position":[[429,55]]},"479":{"position":[[583,55]]}}}],["bug",{"_index":1149,"t":{"620":{"position":[[1488,4]]}}}],["build",{"_index":321,"t":{"348":{"position":[[266,5],[306,5]]}}}],["built",{"_index":186,"t":{"332":{"position":[[16,5]]}}}],["bun",{"_index":836,"t":{"447":{"position":[[119,3]]},"466":{"position":[[119,3]]},"485":{"position":[[119,3]]}}}],["byte",{"_index":591,"t":{"380":{"position":[[242,5]]}}}],["bytes/sec",{"_index":531,"t":{"371":{"position":[[240,9]]}}}],["c",{"_index":67,"t":{"318":{"position":[[635,1],[1015,1]]},"367":{"position":[[214,1]]},"401":{"position":[[83,1]]},"492":{"position":[[122,1],[1592,1]]}}}],["c.end",{"_index":698,"t":{"401":{"position":[[310,8]]},"492":{"position":[[936,8],[1824,8]]}}}],["c.execute('select",{"_index":695,"t":{"401":{"position":[[251,17]]},"492":{"position":[[484,17],[569,17],[695,17],[727,17],[1765,17]]}}}],["c.query('show",{"_index":693,"t":{"401":{"position":[[187,13]]},"492":{"position":[[298,13],[1701,13]]}}}],["c.query('som",{"_index":869,"t":{"492":{"position":[[379,13]]}}}],["ca",{"_index":814,"t":{"443":{"position":[[294,3],[575,3]]},"445":{"position":[[202,2],[214,2]]},"447":{"position":[[153,2]]},"462":{"position":[[264,3],[620,3]]},"464":{"position":[[190,2],[202,2]]},"466":{"position":[[153,2]]},"481":{"position":[[317,3],[774,3]]},"483":{"position":[[198,2],[210,2]]},"485":{"position":[[153,2]]}}}],["cach",{"_index":609,"t":{"383":{"position":[[215,6],[256,6],[322,5],[416,5],[480,5]]},"385":{"position":[[52,5]]},"387":{"position":[[36,6],[63,6],[173,5]]},"494":{"position":[[280,5]]}}}],["call",{"_index":395,"t":{"360":{"position":[[520,4],[560,4],[1549,5],[2556,6]]},"383":{"position":[[209,5]]},"423":{"position":[[88,4],[628,5],[1032,5]]}}}],["callback",{"_index":28,"t":{"316":{"position":[[116,8]]},"318":{"position":[[317,8]]},"320":{"position":[[185,8],[1147,8],[1573,8]]},"324":{"position":[[151,8],[404,8]]},"360":{"position":[[1443,9]]},"378":{"position":[[453,9]]},"385":{"position":[[598,8]]}}}],["callback'",{"_index":1086,"t":{"612":{"position":[[470,10],[822,10],[1226,10],[1561,10]]}}}],["callback(nul",{"_index":435,"t":{"360":{"position":[[1646,14]]}}}],["callback.j",{"_index":801,"t":{"437":{"position":[[51,11]]},"439":{"position":[[55,11]]},"441":{"position":[[55,11]]},"443":{"position":[[55,11]]},"445":{"position":[[242,11]]},"456":{"position":[[45,11]]},"458":{"position":[[43,11]]},"460":{"position":[[43,11]]},"462":{"position":[[43,11]]},"464":{"position":[[230,11]]},"475":{"position":[[53,11]]},"477":{"position":[[51,11]]},"479":{"position":[[51,11]]},"481":{"position":[[51,11]]},"483":{"position":[[238,11]]},"497":{"position":[[47,11]]},"499":{"position":[[42,11]]},"501":{"position":[[57,11]]},"509":{"position":[[47,11]]},"511":{"position":[[42,11]]},"513":{"position":[[57,11]]},"521":{"position":[[47,11]]},"523":{"position":[[42,11]]},"525":{"position":[[57,11]]},"531":{"position":[[47,11]]},"533":{"position":[[42,11]]},"535":{"position":[[57,11]]},"546":{"position":[[30,11]]},"548":{"position":[[40,11]]},"557":{"position":[[30,11]]},"559":{"position":[[40,11]]},"568":{"position":[[30,11]]},"570":{"position":[[40,11]]},"572":{"position":[[40,11]]},"579":{"position":[[30,11]]},"581":{"position":[[40,11]]}}}],["candid",{"_index":1128,"t":{"620":{"position":[[859,9]]}}}],["capabilityflag",{"_index":567,"t":{"378":{"position":[[91,15]]},"588":{"position":[[369,16]]},"592":{"position":[[859,16],[889,16],[919,16]]}}}],["case",{"_index":426,"t":{"360":{"position":[[1461,5]]},"371":{"position":[[352,4]]},"445":{"position":[[148,4]]},"464":{"position":[[136,4]]},"483":{"position":[[144,4]]}}}],["catalog",{"_index":986,"t":{"592":{"position":[[1139,8]]}}}],["catch",{"_index":54,"t":{"316":{"position":[[484,5],[671,5]]},"318":{"position":[[719,5]]},"320":{"position":[[1334,5]]},"324":{"position":[[592,5]]},"437":{"position":[[203,5]]},"439":{"position":[[248,5]]},"441":{"position":[[252,5]]},"443":{"position":[[347,5]]},"445":{"position":[[426,5],[591,5]]},"456":{"position":[[264,5]]},"458":{"position":[[305,5]]},"460":{"position":[[309,5]]},"462":{"position":[[404,5]]},"464":{"position":[[483,5],[642,5]]},"475":{"position":[[373,5]]},"477":{"position":[[414,5]]},"479":{"position":[[418,5]]},"481":{"position":[[513,5]]},"483":{"position":[[592,5],[758,5]]},"492":{"position":[[415,5]]},"497":{"position":[[258,5]]},"499":{"position":[[279,5]]},"501":{"position":[[296,5]]},"509":{"position":[[285,5]]},"511":{"position":[[306,5]]},"513":{"position":[[323,5]]},"521":{"position":[[266,5]]},"523":{"position":[[287,5]]},"525":{"position":[[304,5]]},"531":{"position":[[271,5]]},"533":{"position":[[292,5]]},"535":{"position":[[309,5]]},"546":{"position":[[211,5]]},"548":{"position":[[247,5]]},"557":{"position":[[230,5]]},"559":{"position":[[266,5]]},"568":{"position":[[216,5]]},"570":{"position":[[252,5]]},"572":{"position":[[271,5]]},"579":{"position":[[221,5]]},"581":{"position":[[257,5]]},"614":{"position":[[131,5],[276,5],[429,5],[603,5],[763,5],[974,5],[1148,5],[1244,5],[1491,5],[1585,5]]}}}],["catch((err",{"_index":418,"t":{"360":{"position":[[1176,12]]},"397":{"position":[[620,12]]},"492":{"position":[[1426,12]]}}}],["catch(console.log",{"_index":136,"t":{"322":{"position":[[1607,19]]}}}],["catch(funct",{"_index":889,"t":{"492":{"position":[[1880,15]]}}}],["caus",{"_index":1144,"t":{"620":{"position":[[1407,5]]}}}],["caution",{"_index":243,"t":{"336":{"position":[[816,7]]},"620":{"position":[[387,7]]}}}],["cb",{"_index":436,"t":{"360":{"position":[[1835,3]]},"371":{"position":[[754,4]]},"592":{"position":[[190,3]]}}}],["cb(err",{"_index":442,"t":{"360":{"position":[[2196,8]]}}}],["cb(null",{"_index":438,"t":{"360":{"position":[[2065,8]]},"371":{"position":[[874,8]]},"592":{"position":[[391,9],[455,8]]}}}],["cd",{"_index":209,"t":{"336":{"position":[[189,2],[643,2]]}}}],["cert",{"_index":813,"t":{"443":{"position":[[245,5],[526,5]]},"445":{"position":[[217,4]]},"447":{"position":[[26,5],[156,4]]},"462":{"position":[[215,5],[571,5]]},"464":{"position":[[205,4]]},"466":{"position":[[26,5],[156,4]]},"481":{"position":[[268,5],[725,5]]},"483":{"position":[[213,4]]},"485":{"position":[[26,5],[156,4]]}}}],["cert.pem",{"_index":810,"t":{"443":{"position":[[76,8],[283,10],[326,11],[564,10],[607,11]]},"445":{"position":[[205,8]]},"462":{"position":[[64,8],[253,10],[296,11],[609,10],[652,11]]},"464":{"position":[[193,8]]},"481":{"position":[[72,8],[306,10],[349,11],[763,10],[806,11]]},"483":{"position":[[201,8]]}}}],["certs/ca",{"_index":809,"t":{"443":{"position":[[67,8]]},"462":{"position":[[55,8]]},"481":{"position":[[63,8]]}}}],["chang",{"_index":221,"t":{"336":{"position":[[420,7]]},"340":{"position":[[39,7],[106,8],[211,8],[227,6],[303,7],[343,7],[363,6]]},"419":{"position":[[24,7]]},"421":{"position":[[24,7]]},"423":{"position":[[24,7]]},"620":{"position":[[301,7],[471,7],[747,8],[930,7]]}}}],["changedrow",{"_index":731,"t":{"419":{"position":[[148,11],[657,12]]},"421":{"position":[[554,12],[680,12]]},"423":{"position":[[868,12]]},"596":{"position":[[554,14]]},"598":{"position":[[572,14]]}}}],["changeus",{"_index":550,"t":{"371":{"position":[[963,12]]},"385":{"position":[[749,13]]}}}],["characterset",{"_index":566,"t":{"378":{"position":[[77,13]]},"588":{"position":[[352,13]]},"592":{"position":[[839,13],[1247,13]]}}}],["check",{"_index":308,"t":{"348":{"position":[[13,5],[119,5],[158,6]]},"352":{"position":[[7,5]]},"354":{"position":[[57,5]]},"412":{"position":[[374,5]]},"427":{"position":[[13,5],[372,8],[477,8]]}}}],["checkout",{"_index":232,"t":{"336":{"position":[[612,8]]}}}],["ci",{"_index":211,"t":{"336":{"position":[[240,2],[679,2]]}}}],["class",{"_index":760,"t":{"427":{"position":[[628,5]]},"594":{"position":[[1428,5],[1669,5]]}}}],["classif",{"_index":1135,"t":{"620":{"position":[[1098,15]]}}}],["classifi",{"_index":1118,"t":{"620":{"position":[[618,10],[1354,10]]}}}],["clear",{"_index":320,"t":{"348":{"position":[[256,5],[292,5]]}}}],["cli",{"_index":228,"t":{"336":{"position":[[541,3]]},"492":{"position":[[2201,5]]}}}],["client",{"_index":348,"t":{"350":{"position":[[382,6]]},"356":{"position":[[68,6],[143,7],[220,6]]},"360":{"position":[[51,6],[1577,6],[2656,6]]},"362":{"position":[[68,6]]},"365":{"position":[[171,6]]},"378":{"position":[[276,6],[383,7]]},"380":{"position":[[318,7]]},"431":{"position":[[237,6],[281,6]]}}}],["clientflag",{"_index":921,"t":{"588":{"position":[[62,11]]}}}],["clientflags.compress",{"_index":931,"t":{"588":{"position":[[397,21]]}}}],["clientplugindata(password1",{"_index":477,"t":{"362":{"position":[[789,27]]}}}],["clientplugindata(password2",{"_index":479,"t":{"362":{"position":[[929,27]]}}}],["clientplugindata(password3",{"_index":481,"t":{"362":{"position":[[1069,27]]}}}],["clone",{"_index":230,"t":{"336":{"position":[[557,5]]}}}],["close",{"_index":597,"t":{"380":{"position":[[405,5]]},"383":{"position":[[250,5]]},"385":{"position":[[72,6],[635,5]]},"387":{"position":[[187,7]]},"620":{"position":[[895,5]]}}}],["co",{"_index":689,"t":{"401":{"position":[[39,2],[353,2]]},"492":{"position":[[1548,2],[2004,2]]}}}],["co(funct",{"_index":691,"t":{"401":{"position":[[59,12]]},"492":{"position":[[1568,12]]}}}],["co.j",{"_index":864,"t":{"492":{"position":[[9,5]]}}}],["code",{"_index":293,"t":{"344":{"position":[[171,4]]},"360":{"position":[[821,4]]},"380":{"position":[[230,4]]},"427":{"position":[[24,4]]},"447":{"position":[[98,4]]},"466":{"position":[[98,4]]},"485":{"position":[[98,4]]},"592":{"position":[[425,5],[498,5],[683,5]]}}}],["column",{"_index":622,"t":{"385":{"position":[[239,6],[334,6],[480,8]]},"588":{"position":[[832,7],[955,7],[1029,9],[1066,9]]}}}],["columnlength",{"_index":993,"t":{"592":{"position":[[1265,13]]}}}],["columntyp",{"_index":995,"t":{"592":{"position":[[1284,11]]}}}],["come",{"_index":617,"t":{"385":{"position":[[37,5]]}}}],["command",{"_index":326,"t":{"348":{"position":[[466,7]]},"378":{"position":[[203,8]]},"380":{"position":[[6,7],[162,7],[222,7],[291,8]]},"492":{"position":[[842,8]]},"620":{"position":[[547,7]]}}}],["commandcod",{"_index":589,"t":{"380":{"position":[[190,13]]}}}],["commit",{"_index":328,"t":{"348":{"position":[[495,7]]}}}],["commonli",{"_index":1074,"t":{"608":{"position":[[33,8]]}}}],["compat",{"_index":295,"t":{"344":{"position":[[187,10]]},"447":{"position":[[103,10]]},"466":{"position":[[103,10]]},"485":{"position":[[103,10]]},"620":{"position":[[178,14],[290,10],[1122,13]]}}}],["compil",{"_index":254,"t":{"338":{"position":[[121,8]]},"431":{"position":[[101,9]]}}}],["complet",{"_index":227,"t":{"336":{"position":[[500,8]]},"338":{"position":[[52,8]]}}}],["complianc",{"_index":312,"t":{"348":{"position":[[49,10]]}}}],["compon",{"_index":248,"t":{"338":{"position":[[12,9],[165,11],[273,10]]},"340":{"position":[[12,9],[285,10]]},"342":{"position":[[203,10]]},"344":{"position":[[121,9],[229,10]]},"348":{"position":[[173,10]]}}}],["compress",{"_index":344,"t":{"350":{"position":[[350,11]]}}}],["concept",{"_index":756,"t":{"427":{"position":[[89,9]]}}}],["config",{"_index":361,"t":{"354":{"position":[[239,6]]},"360":{"position":[[126,6],[345,6],[1347,6]]},"362":{"position":[[354,6]]},"365":{"position":[[75,6]]},"477":{"position":[[19,7]]},"479":{"position":[[19,7]]},"481":{"position":[[19,7]]},"483":{"position":[[19,7]]},"487":{"position":[[19,7]]}}}],["confirm",{"_index":1082,"t":{"612":{"position":[[59,9]]},"614":{"position":[[59,9]]}}}],["conn",{"_index":100,"t":{"320":{"position":[[1626,4],[1885,5]]},"322":{"position":[[1435,4],[1522,4]]},"324":{"position":[[166,4],[284,4]]},"360":{"position":[[832,4],[1682,4]]},"362":{"position":[[518,4]]},"399":{"position":[[75,4]]},"408":{"position":[[128,4]]},"410":{"position":[[116,4]]},"415":{"position":[[107,4],[552,4]]},"417":{"position":[[124,4]]},"419":{"position":[[363,4]]},"421":{"position":[[214,4]]},"423":{"position":[[341,4]]},"588":{"position":[[201,6]]},"592":{"position":[[599,6]]},"594":{"position":[[1450,5]]},"596":{"position":[[724,4]]},"598":{"position":[[761,4]]},"600":{"position":[[418,4]]},"602":{"position":[[444,4]]},"604":{"position":[[455,4]]},"606":{"position":[[481,4]]}}}],["conn.clos",{"_index":980,"t":{"592":{"position":[[700,13],[1482,13]]}}}],["conn.end",{"_index":137,"t":{"322":{"position":[[1639,12]]},"399":{"position":[[210,11]]},"596":{"position":[[2089,11]]},"598":{"position":[[2124,11]]},"600":{"position":[[1214,11]]},"602":{"position":[[1357,11]]},"604":{"position":[[1249,11]]},"606":{"position":[[1392,11]]}}}],["conn.execute('select",{"_index":679,"t":{"399":{"position":[[161,20]]},"412":{"position":[[108,20]]}}}],["conn.execute>(sql",{"_index":750,"t":{"423":{"position":[[650,53]]}}}],["conn.query>('cal",{"_index":1059,"t":{"596":{"position":[[1624,45]]},"598":{"position":[[1661,45]]}}}],["conn.query('drop",{"_index":1054,"t":{"596":{"position":[[823,33],[1343,33]]},"598":{"position":[[860,33],[1380,33]]},"600":{"position":[[517,33]]},"602":{"position":[[543,33]]},"604":{"position":[[554,33]]},"606":{"position":[[580,33]]}}}],["conn.query(sql",{"_index":736,"t":{"419":{"position":[[460,32]]}}}],["conn.query(sql",{"_index":742,"t":{"421":{"position":[[349,34]]}}}],["conn.query('select",{"_index":720,"t":{"415":{"position":[[185,35]]}}}],["conn.query('show",{"_index":722,"t":{"415":{"position":[[321,33],[797,33]]}}}],["conn.query(sql",{"_index":727,"t":{"417":{"position":[[279,34]]}}}],["conn.query 搜索文档 - +