<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_md_docs_2basic_2fetch" xml:lang="en-US">
<title>fetch</title>
<indexterm><primary>fetch</primary></indexterm>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md13">
<title>autotoc_md13</title>
<para>title: ArmaRAMDb - Fetch icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md14">
<title>excerpt: Handles data chunks received from the database extension when data is too large to be returned in a single callback.</title></section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md15">
<title>ramdb_db_fnc_fetch</title><section xml:id="_md_docs_2basic_2fetch_1autotoc_md16">
<title>Description</title>
<para>Handles data chunks received from the database extension when data is too large to be returned in a single callback. This function collects all chunks of data, reassembles them in the correct order, and then passes the complete data to the handler function.</para>
</section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md17">
<title>Syntax</title>
<para><literallayout><computeroutput>[_uniqueID,&#32;_function,&#32;_index,&#32;_total,&#32;_datachunk,&#32;_call,&#32;_netId]&#32;call&#32;ramdb_db_fnc_fetch
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md18">
<title>Parameters</title>
<para><informaltable frame="all">
    <tgroup cols="3" align="left" colsep="1" rowsep="1">
      <colspec colname='c1'/>
      <colspec colname='c2'/>
      <colspec colname='c3'/>
<thead>
      <row  class='markdownTableHead'>
<entry>
<para>Parameter   </para>
</entry><entry>
<para>Type   </para>
</entry><entry>
<para>Description    </para>
</entry></row>
</thead><tbody>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_uniqueID</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>Unique identifier for this data fetch operation    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para><computeroutput>_function</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>Name of the function to call after data is assembled    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_index</computeroutput>   </para>
</entry><entry>
<para>Number   </para>
</entry><entry>
<para>Current chunk index (0-based)    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para><computeroutput>_total</computeroutput>   </para>
</entry><entry>
<para>Number   </para>
</entry><entry>
<para>Total number of chunks expected    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_datachunk</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>The chunk of data being received    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para><computeroutput>_call</computeroutput>   </para>
</entry><entry>
<para>Boolean   </para>
</entry><entry>
<para>Whether to call the function directly (true) or spawn (false)    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_netId</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>(Optional) NetID of the player to whom the data belongs   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md19">
<title>Return Value</title>
<para>None. When all chunks are received, the function will:<orderedlist>
<listitem>
<para>Assemble the complete data string</para>
</listitem><listitem>
<para>Parse it as a simple array</para>
</listitem><listitem>
<para>Call the specified handler function with the parsed data</para>
</listitem></orderedlist>
</para>
</section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md20">
<title>Examples</title>
<para>This function is typically not called directly but is triggered by the extension&apos;s callback mechanism when large datasets are retrieved.</para>
</section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md21">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>The function stores received chunks in the global array <computeroutput>ramdb_db_fetch_array</computeroutput></para>
</listitem><listitem>
<para>Chunks are sorted by their index to ensure correct assembly regardless of arrival order</para>
</listitem><listitem>
<para>After successful processing, the chunks for this uniqueID are removed from the array</para>
</listitem><listitem>
<para>This function is essential for handling large datasets that exceed the callback buffer limit</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2basic_2fetch_1autotoc_md22">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_handler</computeroutput>: Receives the assembled data and routes it to the appropriate function</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_scheduler</computeroutput>: Manages the callback queue and triggers data fetching </para>
</listitem></itemizedlist>
</para>
</section>
</section>
</section>
