ramdb/docs/basic/get.md
Jacob Schmidt 8c0e8144e5 docs: Update documentation links and function references
This commit updates the documentation to reflect the current function names and link structure. Specifically, it addresses the following:

*   Corrected internal links within the documentation to point to the correct markdown files (e.g., `hashDelete.md` instead of `hashDelete`).
*   Updated related function references to reflect the current function names and include missing functions.
*   Removed outdated function references.
*   Added `ramdb_db_fnc_scheduler` to related functions where appropriate.
*   Updated the links section to use the correct markdown file names.
2025-03-22 16:53:30 -05:00

55 lines
2.1 KiB
Markdown

---
title: ArmaRAMDb - Get Key
icon: mdi:file-text-outline
excerpt: Get the value of stored key from RAMDb.
---
# ramdb_db_fnc_get
## Description
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.
## Syntax
```sqf
[_key, _function, _call, _netId] call ramdb_db_fnc_get
```
## Parameters
| Parameter | Type | Description |
|-------------|-----------|-----------------------------------------------------------------|
| `_key` | String | Name of the stored key to retrieve from the database |
| `_function` | String | Name of the function to call when data is retrieved |
| `_call` | Boolean | Whether to call the function directly (true) or spawn (false) |
| `_netId` | String | (Optional) NetID of the player to whom the data should be returned |
## Return Value
None. When data is retrieved, it will be passed to the specified function. The operation runs asynchronously.
## Examples
### Retrieve data in singleplayer or on the server:
```sqf
[getPlayerUID player, "ramdb_db_fnc_test"] call ramdb_db_fnc_get;
```
### Retrieve data on the server and send to a specific client:
```sqf
[getPlayerUID player, "ramdb_db_fnc_test", false, netId player] remoteExecCall ["ramdb_db_fnc_get", 2, false];
```
## Notes
- The function exit with an error if the key or function parameters are empty
- Data is processed through the scheduler system, which manages callback responses
- For large data that exceeds buffer limits, it will be automatically chunked and reassembled
- The callback function must be defined to accept the retrieved data
- The `_call` parameter determines whether the callback is executed directly or spawned in a separate thread
## Related Functions
- `ramdb_db_fnc_set`: Stores a value by key
- `ramdb_db_fnc_delete`: Removes a value by key
- `ramdb_db_fnc_scheduler`: Processes the callback response
## Links
[Delete Key](delete.md) |
[Get Key](get.md) |
[Set Key](set.md)