ramdb/api/html/d1/d9f/md_docs_2basic_2get.html
Jacob Schmidt ee1dd91b7f
All checks were successful
Build / Build (push) Successful in 40s
feat: Add documentation for fetch function
This commit adds documentation for the `ramdb_db_fnc_fetch` function. The documentation explains the function's purpose, which is to handle data chunks received from the database extension when data is too large to be returned in a single callback. The documentation includes a title, icon, and excerpt for better readability and understanding.
2025-03-30 17:16:31 -05:00

176 lines
8.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ArmaRAMDb: get</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { init_search(); });
/* @license-end */
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">ArmaRAMDb
</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('d1/d9f/md_docs_2basic_2get.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div><div class="header">
<div class="headertitle"><div class="title">get</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h2><a class="anchor" id="autotoc_md23"></a>
autotoc_md23</h2>
<p>title: ArmaRAMDb - Get Key icon: mdi:file-text-outline </p>
<h2><a class="anchor" id="autotoc_md24"></a>
excerpt: Get the value of stored key from RAMDb.</h2>
<h1><a class="anchor" id="autotoc_md25"></a>
ramdb_db_fnc_get</h1>
<h2><a class="anchor" id="autotoc_md26"></a>
Description</h2>
<p>Retrieves the value of a stored key from the database. This function performs an asynchronous request to the database and passes the retrieved data to the specified callback function.</p>
<h2><a class="anchor" id="autotoc_md27"></a>
Syntax</h2>
<div class="fragment"><div class="line">[_key, _function, _call, _netId] call ramdb_db_fnc_get</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md28"></a>
Parameters</h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Parameter </th><th class="markdownTableHeadNone">Type </th><th class="markdownTableHeadNone">Description </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>_key</code> </td><td class="markdownTableBodyNone">String </td><td class="markdownTableBodyNone">Name of the stored key to retrieve from the database </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>_function</code> </td><td class="markdownTableBodyNone">String </td><td class="markdownTableBodyNone">Name of the function to call when data is retrieved </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>_call</code> </td><td class="markdownTableBodyNone">Boolean </td><td class="markdownTableBodyNone">Whether to call the function directly (true) or spawn (false) </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>_netId</code> </td><td class="markdownTableBodyNone">String </td><td class="markdownTableBodyNone">(Optional) NetID of the player to whom the data should be returned </td></tr>
</table>
<h2><a class="anchor" id="autotoc_md29"></a>
Return Value</h2>
<p>None. When data is retrieved, it will be passed to the specified function. The operation runs asynchronously.</p>
<h2><a class="anchor" id="autotoc_md30"></a>
Examples</h2>
<h3><a class="anchor" id="autotoc_md31"></a>
Retrieve data in singleplayer or on the server:</h3>
<div class="fragment"><div class="line">[getPlayerUID player, &quot;ramdb_db_fnc_test&quot;] call ramdb_db_fnc_get;</div>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md32"></a>
Retrieve data on the server and send to a specific client:</h3>
<div class="fragment"><div class="line">[getPlayerUID player, &quot;ramdb_db_fnc_test&quot;, false, netId player] remoteExecCall [&quot;ramdb_db_fnc_get&quot;, 2, false];</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md33"></a>
Notes</h2>
<ul>
<li>The function exit with an error if the key or function parameters are empty</li>
<li>Data is processed through the scheduler system, which manages callback responses</li>
<li>For large data that exceeds buffer limits, it will be automatically chunked and reassembled</li>
<li>The callback function must be defined to accept the retrieved data</li>
<li>The <code>_call</code> parameter determines whether the callback is executed directly or spawned in a separate thread</li>
</ul>
<h2><a class="anchor" id="autotoc_md34"></a>
Related Functions</h2>
<ul>
<li><code>ramdb_db_fnc_set</code>: Stores a value by key</li>
<li><code>ramdb_db_fnc_delete</code>: Removes a value by key</li>
<li><code>ramdb_db_fnc_scheduler</code>: Processes the callback response</li>
</ul>
<h2><a class="anchor" id="autotoc_md35"></a>
Links</h2>
<p><a class="el" href="../../d6/dff/md_docs_2basic_2delete.html">Delete Key</a> | <a class="el" href="../../d1/d9f/md_docs_2basic_2get.html">Get Key</a> | <a class="el" href="../../dc/d24/md_docs_2basic_2set.html">Set Key</a> </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>
</html>