mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-03 06:28:53 +00:00
deploy: 1c620ec0e3
This commit is contained in:
1 parent
e7e57817e6
commit
cb181a149f
213 files changed
+582
-528
No files matched your search
@@ -0,0 +1 @@
|
||||
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7835],{9613:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return d}});var a=n(9496);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},s=Object.keys(e);for(a=0;a<s.length;a++)n=s[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)n=s[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},p=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,s=e.originalType,l=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=c(n),d=r,y=p["".concat(l,".").concat(d)]||p[d]||m[d]||s;return n?a.createElement(y,o(o({ref:t},u),{},{components:n})):a.createElement(y,o({ref:t},u))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var s=n.length,o=new Array(s);o[0]=p;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,o[1]=i;for(var c=2;c<s;c++)o[c]=n[c];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}p.displayName="MDXCreateElement"},6965:function(e,t,n){n.r(t),n.d(t,{assets:function(){return u},contentTitle:function(){return l},default:function(){return d},frontMatter:function(){return i},metadata:function(){return c},toc:function(){return m}});var a=n(5443),r=n(3010),s=(n(9496),n(9613)),o=["components"],i={},l="Transaction",c={unversionedId:"oxmysql/Usage/transaction",id:"oxmysql/Usage/transaction",title:"Transaction",description:"Transactions",source:"@site/docs/oxmysql/Usage/transaction.md",sourceDirName:"oxmysql/Usage",slug:"/oxmysql/Usage/transaction",permalink:"/docs/oxmysql/Usage/transaction",draft:!1,editUrl:"https://github.com/overextended/overextended.github.io/tree/main/docs/oxmysql/Usage/transaction.md",tags:[],version:"current",lastUpdatedAt:1656531847,formattedLastUpdatedAt:"6/29/2022",frontMatter:{},sidebar:"oxmysql",previous:{title:"Single",permalink:"/docs/oxmysql/Usage/single"},next:{title:"Update",permalink:"/docs/oxmysql/Usage/update"}},u={},m=[{value:"Transactions",id:"transactions",level:2},{value:"Specific Format",id:"specific-format",level:3},{value:"Usage",id:"usage",level:3},{value:"Lua",id:"lua",level:4},{value:"JavaScript",id:"javascript",level:4},{value:"Shared Format",id:"shared-format",level:3},{value:"Lua",id:"lua-1",level:4},{value:"JavaScript",id:"javascript-1",level:4},{value:"Transaction Isolation Level",id:"transaction-isolation-level",level:2}],p={toc:m};function d(e){var t=e.components,n=(0,r.Z)(e,o);return(0,s.kt)("wrapper",(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,s.kt)("h1",{id:"transaction"},"Transaction"),(0,s.kt)("h2",{id:"transactions"},"Transactions"),(0,s.kt)("p",null,"A transaction executes multiple queries and commits them only if all succeed. If one fails, none of the queries are committed. The return value is a ",(0,s.kt)("inlineCode",{parentName:"p"},"boolean"),", which is the result of the transaction."),(0,s.kt)("h3",{id:"specific-format"},"Specific Format"),(0,s.kt)("p",null,"When using the ",(0,s.kt)("inlineCode",{parentName:"p"},"Specific")," format you must pass one parameter to the oxmysql export. In this case, the ",(0,s.kt)("inlineCode",{parentName:"p"},"queries")," parameter contains your queries and the SQL variables unique to each query."),(0,s.kt)("p",null,"This is useful for transactions where the queries do not share many SQL variables."),(0,s.kt)("h3",{id:"usage"},"Usage"),(0,s.kt)("h4",{id:"lua"},"Lua"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-lua"},"local queries = {\n { query = 'INSERT INTO `test` (id) VALUES (:someid)', values = { ['someid'] = 1 } },\n { query = 'INSERT INTO `test` (id) VALUES (:someid)', values = { ['someid'] = 2 } }\n} -- NOTE, the 'values' tables can be named 'parameters' here for MySQL-Async compatibilitLine truncated
|
||||
Reference in new issue
Block a user