Deploying to gh-pages from @ overextended/oxmysql@92a2fa177f 🚀

This commit is contained in:
thelindat committed 2021-12-23 10:22:44 +00:00
1 parent 9e61fd87e3
commit 586b0c5c52
13 files changed
+25 -23

No files matched your search

+1 -1
View File
@@ -402,7 +402,7 @@
<li class="md-nav__item">
<a href="/usage/transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+1 -1
View File
@@ -480,7 +480,7 @@
<li class="md-nav__item">
<a href="usage/transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+1 -1
View File
@@ -453,7 +453,7 @@
<li class="md-nav__item">
<a href="../usage/transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+1 -1
View File
@@ -1 +1 @@
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Installation \u00b6 Download the latest build of oxmysql (not the source code). Extract the contents of the archive to your resources folder. Start the resource near the top of your resources in your server.cfg . If you have a lot of streamed assets, load them first to prevent timing out the connection. Configuration \u00b6 You can change the configuration settings by using convars inside your server.cfg . Reference the following for an idea of how to set your connection options. You must include one of the following lines, adjusted for your connection and database settings. set mysql_connection_string \"mysql://root:12345@localhost/es_extended?charset=utf8mb4\" set mysql_connection_string \"user=root;database=es_extended;password=12345;charset=utf8mb4\" Certain special characters are reserved or blocked and may cause issues when used in your password. You can also add the following convars if you require extra information when testing queries. set mysql_slow_query_warning 150 set mysql_debug true For more optional settings (such as multiple statements) you can reference pool.d.ts and connection.d.ts . Benchmark \u00b6 Lua: Low: 0.2167ms | Avg: 0.28788843ms | Total: 2878.8843ms (10000 queries) JS: Low: 0.2098ms | Avg: 0.29384436ms | Total: 2938.4436ms (10000 queries) These benchmarks await the previous response rather than occuring asynchronously, and measure the total time spent executing the export. The MySQL.Sync.prepare function calls exports.oxmysql:execute_async , as used in the JS sample. Lua (5.4) \u00b6 local val = 10000 RegisterCommand ( 'luasync' , function () local queryTimesLocal = {} local result local r = MySQL . Sync . prepare ( 'SELECT identifier from users WHERE lastname = ?' , { 'Linden' }) for i = 1 , val do local time = os . nanotime () local r = MySQL . Sync . prepare ( 'SELECT identifier from users WHERE lastname = ?' , { 'Linden' }) queryTimesLocal [ # queryTimesLocal + 1 ] = ( os . nanotime () - time ) / 1000000 if i == 1 then result = r end end local queryMsLow , queryMsSum = 1000 , 0 for _ , v in pairs ( queryTimesLocal ) do queryMsSum = queryMsSum + v end for _ , v in pairs ( queryTimesLocal ) do if v < queryMsLow then queryMsLow = v end end local averageQueryTime = queryMsSum / # queryTimesLocal print ( json . encode ( result )) print ( 'Low: ' .. queryMsLow .. 'ms | Avg: ' .. averageQueryTime .. 'ms | Total: ' .. queryMsSum .. 'ms (' ..# queryTimesLocal .. ' queries)' ) end ) JavaScript \u00b6 const val = 10000 RegisterCommand ( 'jssync' , async () => { const queryTimesLocal = []; let result for ( let i = 0 ; i < val ; i ++ ) { const startTime = process . hrtime () const r = await exports . oxmysql . execute_async ( 'SELECT identifier from users WHERE lastname = ?' , [ 'Linden' ]) queryTimesLocal . push ( process . hrtime ( startTime )[ 1 ] / 1000000 ) if ( i === 0 ) result = r } const queryMsSum = queryTimesLocal . reduce (( a , b ) => a + b , 0 ) const queryMsLow = queryTimesLocal . sort (( a , b ) => a - b )[ 0 ] const averageQueryTime = queryMsSum / queryTimesLocal . length console . log ( result ) console . log ( 'Low: ' + queryMsLow + 'ms | Avg: ' + averageQueryTime + 'ms | Total: ' + queryMsSum + 'ms (' + queryTimesLocal . length + ' queries)' ) })","title":"Getting Started"},{"location":"#installation","text":"Download the latest build of oxmysql (not the source code). Extract the contents of the archive to your resources folder. Start the resource near the top of your resources in your server.cfg . If you have a lot of streamed assets, load them first to prevent timing out the connection.","title":"Installation"},{"location":"#configuration","text":"You can change the configuration settings by using convars inside your server.cfg . Reference the following for an idea of how to set your connection options. You must include one of the following lines, adjusted for your connection and database settings. set mysql_connection_string \"mysql://root:12345@localhost/es_extended?charset=utf8mb4\" set mysql_connection_string \"user=root;database=es_extended;password=12345;charset=utf8mb4\" Certain special characters are reserved or blocked and may cause issues when used in your password. You can also add the following convars if you require extra information when testing queries. set mysql_slow_query_warning 150 set mysql_debug true For more optional settings (such as multiple statements) you can reference pool.d.ts and connection.d.ts .","title":"Configuration"},{"location":"#benchmark","text":"Lua: Low: 0.2167ms | Avg: 0.28788843ms | Total: 2878.8843ms (10000 queries) JS: Low: 0.2098ms | Avg: 0.29384436ms | Total: 2938.4436ms (10000 queries) These benchmarks await the previous response rather than occuring asynchronously, and measure the total time spent executing the export. The MySQL.Sync.prepare function calls exports.oxmysql:execuLine truncated
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Installation \u00b6 Download the latest build of oxmysql (not the source code). Extract the contents of the archive to your resources folder. Start the resource near the top of your resources in your server.cfg . If you have a lot of streamed assets, load them first to prevent timing out the connection. Configuration \u00b6 You can change the configuration settings by using convars inside your server.cfg . Reference the following for an idea of how to set your connection options. You must include one of the following lines, adjusted for your connection and database settings. set mysql_connection_string \"mysql://root:12345@localhost/es_extended?charset=utf8mb4\" set mysql_connection_string \"user=root;database=es_extended;password=12345;charset=utf8mb4\" Certain special characters are reserved or blocked and may cause issues when used in your password. You can also add the following convars if you require extra information when testing queries. set mysql_slow_query_warning 150 set mysql_debug true For more optional settings (such as multiple statements) you can reference pool.d.ts and connection.d.ts . Benchmark \u00b6 Lua: Low: 0.2167ms | Avg: 0.28788843ms | Total: 2878.8843ms (10000 queries) JS: Low: 0.2098ms | Avg: 0.29384436ms | Total: 2938.4436ms (10000 queries) These benchmarks await the previous response rather than occuring asynchronously, and measure the total time spent executing the export. The MySQL.Sync.prepare function calls exports.oxmysql:execute_async , as used in the JS sample. Lua (5.4) \u00b6 local val = 10000 RegisterCommand ( 'luasync' , function () local queryTimesLocal = {} local result local r = MySQL . Sync . prepare ( 'SELECT identifier from users WHERE lastname = ?' , { 'Linden' }) for i = 1 , val do local time = os . nanotime () local r = MySQL . Sync . prepare ( 'SELECT identifier from users WHERE lastname = ?' , { 'Linden' }) queryTimesLocal [ # queryTimesLocal + 1 ] = ( os . nanotime () - time ) / 1000000 if i == 1 then result = r end end local queryMsLow , queryMsSum = 1000 , 0 for _ , v in pairs ( queryTimesLocal ) do queryMsSum = queryMsSum + v end for _ , v in pairs ( queryTimesLocal ) do if v < queryMsLow then queryMsLow = v end end local averageQueryTime = queryMsSum / # queryTimesLocal print ( json . encode ( result )) print ( 'Low: ' .. queryMsLow .. 'ms | Avg: ' .. averageQueryTime .. 'ms | Total: ' .. queryMsSum .. 'ms (' ..# queryTimesLocal .. ' queries)' ) end ) JavaScript \u00b6 const val = 10000 RegisterCommand ( 'jssync' , async () => { const queryTimesLocal = []; let result for ( let i = 0 ; i < val ; i ++ ) { const startTime = process . hrtime () const r = await exports . oxmysql . execute_async ( 'SELECT identifier from users WHERE lastname = ?' , [ 'Linden' ]) queryTimesLocal . push ( process . hrtime ( startTime )[ 1 ] / 1000000 ) if ( i === 0 ) result = r } const queryMsSum = queryTimesLocal . reduce (( a , b ) => a + b , 0 ) const queryMsLow = queryTimesLocal . sort (( a , b ) => a - b )[ 0 ] const averageQueryTime = queryMsSum / queryTimesLocal . length console . log ( result ) console . log ( 'Low: ' + queryMsLow + 'ms | Avg: ' + averageQueryTime + 'ms | Total: ' + queryMsSum + 'ms (' + queryTimesLocal . length + ' queries)' ) })","title":"Getting Started"},{"location":"#installation","text":"Download the latest build of oxmysql (not the source code). Extract the contents of the archive to your resources folder. Start the resource near the top of your resources in your server.cfg . If you have a lot of streamed assets, load them first to prevent timing out the connection.","title":"Installation"},{"location":"#configuration","text":"You can change the configuration settings by using convars inside your server.cfg . Reference the following for an idea of how to set your connection options. You must include one of the following lines, adjusted for your connection and database settings. set mysql_connection_string \"mysql://root:12345@localhost/es_extended?charset=utf8mb4\" set mysql_connection_string \"user=root;database=es_extended;password=12345;charset=utf8mb4\" Certain special characters are reserved or blocked and may cause issues when used in your password. You can also add the following convars if you require extra information when testing queries. set mysql_slow_query_warning 150 set mysql_debug true For more optional settings (such as multiple statements) you can reference pool.d.ts and connection.d.ts .","title":"Configuration"},{"location":"#benchmark","text":"Lua: Low: 0.2167ms | Avg: 0.28788843ms | Total: 2878.8843ms (10000 queries) JS: Low: 0.2098ms | Avg: 0.29384436ms | Total: 2938.4436ms (10000 queries) These benchmarks await the previous response rather than occuring asynchronously, and measure the total time spent executing the export. The MySQL.Sync.prepare function calls exports.oxmysql:execuLine truncated
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -414,7 +414,7 @@
<li class="md-nav__item">
<a href="../transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+1 -1
View File
@@ -414,7 +414,7 @@
<li class="md-nav__item">
<a href="../transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+1 -1
View File
@@ -414,7 +414,7 @@
<li class="md-nav__item">
<a href="../transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+1 -1
View File
@@ -414,7 +414,7 @@
<li class="md-nav__item">
<a href="transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+1 -1
View File
@@ -414,7 +414,7 @@
<li class="md-nav__item">
<a href="../transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
+9 -7
View File
@@ -414,7 +414,7 @@
<li class="md-nav__item">
<a href="../transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
@@ -457,10 +457,12 @@
<h1>prepare</h1>
<p>The only function that provides true <a href="https://github.com/sidorares/node-mysql2#using-prepared-statements">prepared statements</a>, granting native protection and query planning by MySQL.<br />
Prepare can be used to execute frequently called queries faster and accepts multiple sets of parameters to be used with a single query.<br />
- Date will not return the datestring commonly used in FiveM
- TINYINT 1 and BIT will not return a boolean
- You can only use <code>?</code> value placeholders, <code>??</code> column placeholders and named placeholders will throw an error </p>
Prepare can be used to execute frequently called queries faster and accepts multiple sets of parameters to be used with a single query. </p>
<ul>
<li>Date will not return the datestring commonly used in FiveM</li>
<li>TINYINT 1 and BIT will not return a boolean</li>
<li>You can only use <code>?</code> value placeholders, <code>??</code> column placeholders and named placeholders will throw an error </li>
</ul>
<p>When using SELECT, the return value will match <code>fetchAll, fetchSingle, or fetchScalar</code> depending on the number of columns and rows selected.</p>
<div class="admonition info">
<p class="admonition-title">Example</p>
@@ -586,13 +588,13 @@ Prepare can be used to execute frequently called queries faster and accepts mult
<a href="../transaction/" class="md-footer__link md-footer__link--next" aria-label="Next: Transaction" rel="next">
<a href="../transaction/" class="md-footer__link md-footer__link--next" aria-label="Next: transaction" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Next
</span>
Transaction
transaction
</div>
</div>
<div class="md-footer__button md-icon">
+4 -4
View File
@@ -17,7 +17,7 @@
<title>Transaction - OxMySQL</title>
<title>transaction - OxMySQL</title>
@@ -103,7 +103,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Transaction
transaction
</span>
</div>
@@ -420,12 +420,12 @@
<label class="md-nav__link md-nav__link--active" for="__toc">
Transaction
transaction
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
Transaction
transaction
</a>
+3 -3
View File
@@ -406,7 +406,7 @@
<li class="md-nav__item">
<a href="../transaction/" class="md-nav__link">
Transaction
transaction
</a>
</li>
@@ -511,7 +511,7 @@
<nav class="md-footer__inner md-grid" aria-label="Footer">
<a href="../transaction/" class="md-footer__link md-footer__link--prev" aria-label="Previous: Transaction" rel="prev">
<a href="../transaction/" class="md-footer__link md-footer__link--prev" aria-label="Previous: transaction" rel="prev">
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
@@ -520,7 +520,7 @@
<span class="md-footer__direction">
Previous
</span>
Transaction
transaction
</div>
</div>
</a>