\label{doc_dev_kdb-contracts_md_md_doc_dev_kdb_contracts}%
\Hypertarget{doc_dev_kdb-contracts_md_md_doc_dev_kdb_contracts}%
 The {\ttfamily \mbox{\hyperlink{group__kdb_ga844e1299a84c3fbf1d3a905c5c893ba5}{kdb\+Open()}}} function accepts a {\ttfamily Key\+Set $\ast$ contract} parameter. This parameter allows you to extend and configure the KDB within your application without permanently changing files on disk.\hypertarget{doc_dev_kdb-contracts_md_autotoc_md2303}{}\doxysection{Contract Structure}\label{doc_dev_kdb-contracts_md_autotoc_md2303}
The contract consists of Keys below {\ttfamily system\+:/elektra/contract/$<$type$>$}, where {\ttfamily $<$type$>$} is one of a set of predefined contract types. Currently, the types {\ttfamily globalkeyset} and {\ttfamily mountglobal} are supported.\hypertarget{doc_dev_kdb-contracts_md_autotoc_md2304}{}\doxysubsection{Global Key\+Set Contracts}\label{doc_dev_kdb-contracts_md_autotoc_md2304}
To insert data into the global Key\+Set during {\ttfamily kdb\+Open}, you can add keys below {\ttfamily system\+:/elektra/contract/globalkeyset}. All these keys will be renamed and copied into the global Key\+Set that is passed to all plugins.

Specifically, the subset below {\ttfamily system\+:/elektra/contract/globalkeyset} is moved to {\ttfamily system\+:/elektra} and then inserted into the global Key\+Set.\hypertarget{doc_dev_kdb-contracts_md_autotoc_md2305}{}\doxysubsection{Mounting Global Plugins}\label{doc_dev_kdb-contracts_md_autotoc_md2305}
You can also mount a global plugin with a contract. To do this, add a key {\ttfamily system\+:/elektra/contract/mountglobal/$<$plugin$>$} where {\ttfamily $<$plugin$>$} is the name of the plugin you want to mount. The keys below {\ttfamily system\+:/elektra/contract/mountglobal/$<$plugin$>$} will be moved to {\ttfamily user\+:/} and used as the config for {\ttfamily $<$plugin$>$}.\hypertarget{doc_dev_kdb-contracts_md_autotoc_md2306}{}\doxysection{Pre-\/defined Contracts}\label{doc_dev_kdb-contracts_md_autotoc_md2306}
There are a few pre-\/defined contracts that can be accessed via helper functions.\hypertarget{doc_dev_kdb-contracts_md_autotoc_md2307}{}\doxysubsection{GOpts}\label{doc_dev_kdb-contracts_md_autotoc_md2307}
To mount and configure the {\ttfamily gopts} plugin you can use {\ttfamily elektra\+GOpts\+Contract}. There is also {\ttfamily elektra\+GOpts\+Contract\+From\+Strings}, but its use is discouraged unless you really need it. It mainly exists for use from various bindings.\hypertarget{doc_dev_kdb-contracts_md_autotoc_md2308}{}\doxysubsection{I/\+O binding}\label{doc_dev_kdb-contracts_md_autotoc_md2308}
To set the I/O binding to be used in a KDB instance, use {\ttfamily elektra\+Io\+Contract}.\hypertarget{doc_dev_kdb-contracts_md_autotoc_md2309}{}\doxysubsection{Notification}\label{doc_dev_kdb-contracts_md_autotoc_md2309}
To set up notifications use the {\ttfamily elektra\+Notification\+Contract} function. It automatically sets up the {\ttfamily internalnotification} plugin.

If you also need to set up notification transport plugins, you should manually add the relevant {\ttfamily system\+:/elektra/contract/mountglobal/$<$plugin$>$} keys and the required config below. 