<?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_2save" xml:lang="en-US">
<title>save</title>
<indexterm><primary>save</primary></indexterm>
<section xml:id="_md_docs_2basic_2save_1autotoc_md53">
<title>autotoc_md53</title>
<para>title: ArmaRAMDb - Save DB icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md54">
<title>excerpt: Save DB to disc.</title></section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md55">
<title>ramdb_db_fnc_save</title><section xml:id="_md_docs_2basic_2save_1autotoc_md56">
<title>Description</title>
<para>Saves the entire database to disk storage. This function persists all data (key-value pairs, hash tables, and lists) to a file, allowing it to be retrieved later even after server restart.</para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md57">
<title>Syntax</title>
<para><literallayout><computeroutput>[_createBackup]&#32;call&#32;ramdb_db_fnc_save
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md58">
<title>Parameters</title>
<para><informaltable frame="all">
    <tgroup cols="4" align="left" colsep="1" rowsep="1">
      <colspec colname='c1'/>
      <colspec colname='c2'/>
      <colspec colname='c3'/>
      <colspec colname='c4'/>
<thead>
      <row  class='markdownTableHead'>
<entry>
<para>Parameter   </para>
</entry><entry>
<para>Type   </para>
</entry><entry>
<para>Description   </para>
</entry><entry>
<para>Default    </para>
</entry></row>
</thead><tbody>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_createBackup</computeroutput>   </para>
</entry><entry>
<para>Boolean   </para>
</entry><entry>
<para>Whether to create a backup of the current state   </para>
</entry><entry>
<para>false   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md59">
<title>Return Value</title>
<para>None. The operation runs synchronously and saves the database immediately.</para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md60">
<title>Examples</title><section xml:id="_md_docs_2basic_2save_1autotoc_md61">
<title>Save the database without creating a backup:</title>
<para><literallayout><computeroutput>[]&#32;call&#32;ramdb_db_fnc_save;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md62">
<title>Save the database and create a backup:</title>
<para><literallayout><computeroutput>[true]&#32;call&#32;ramdb_db_fnc_save;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md63">
<title>Call the save function remotely from a client:</title>
<para><literallayout><computeroutput>[]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_save&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md64">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>This function should be called periodically to ensure data persistence</para>
</listitem><listitem>
<para>The backup feature creates a timestamped copy of the database</para>
</listitem><listitem>
<para>Automatic backups can be configured in the extension&apos;s config file</para>
</listitem><listitem>
<para>Saving is a resource-intensive operation, so it shouldn&apos;t be called too frequently</para>
</listitem><listitem>
<para>Consider saving before mission end or during low-activity periods</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md65">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_load</computeroutput>: Loads the database from disk</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2basic_2save_1autotoc_md66">
<title>Links</title>
<para><link linkend="_md_docs_2basic_2save">Save DB</link> | <link linkend="_md_docs_2basic_2load">Load DB</link> </para>
</section>
</section>
</section>
