diff --git a/docs/basic/index.md b/docs/basic/index.md new file mode 100644 index 0000000..5d3ea36 --- /dev/null +++ b/docs/basic/index.md @@ -0,0 +1,34 @@ +# Basic Data Operations + +This section contains documentation for the basic data operations of ArmaRAMDb that allow for simple key-value storage and retrieval. + +## Available Functions + +- [delete](delete.md) - Delete a value from the database +- [fetch](fetch.md) - Fetch a value from the database +- [get](get.md) - Get a value from the database +- [load](load.md) - Load the database from disk +- [save](save.md) - Save the database to disk +- [set](set.md) - Set a value in the database + +## Example Usage + +```sqf +// Set a value +["myKey", [myValue]] call ramdb_db_fnc_set; + +// Get a value +["myKey", "myFunction"] call ramdb_db_fnc_get; + +// Delete a key +["myKey"] call ramdb_db_fnc_delete; + +// Save database to disk +[] call ramdb_db_fnc_save; +``` + +## Related Categories + +- [Core Functions](../core/index.md) +- [Hash Operations](../hash/index.md) +- [List Operations](../list/index.md) \ No newline at end of file diff --git a/docs/core/index.md b/docs/core/index.md new file mode 100644 index 0000000..f818be3 --- /dev/null +++ b/docs/core/index.md @@ -0,0 +1,29 @@ +# Core Functions + +This section contains documentation for the core functions of ArmaRAMDb that handle initialization, process management, and scheduling. + +## Available Functions + +- [addTask](addTask.md) - Add a task to the scheduler +- [handler](handler.md) - Handle callbacks from the extension +- [init](init.md) - Initialize the database system +- [printAddonName](printAddonName.md) - Print the addon name +- [processQueue](processQueue.md) - Process queued database operations +- [scheduler](scheduler.md) - Schedule database operations +- [test](test.md) - Test the database connection + +## Example Usage + +```sqf +// Initialize the database +[] call ramdb_db_fnc_init; + +// Test the database connection +[] call ramdb_db_fnc_test; +``` + +## Related Categories + +- [Basic Data Operations](../basic/index.md) +- [Hash Operations](../hash/index.md) +- [List Operations](../list/index.md) \ No newline at end of file diff --git a/docs/hash/index.md b/docs/hash/index.md new file mode 100644 index 0000000..90d9795 --- /dev/null +++ b/docs/hash/index.md @@ -0,0 +1,49 @@ +# Hash Operations + +This section contains documentation for the hash operations of ArmaRAMDb that allow for working with hash tables (key-value pairs within a namespace). + +## Available Functions + +- [hashDelete](hashDelete.md) - Delete a hash +- [hashDeleteId](hashDeleteId.md) - Delete a hash for a specific ID +- [hashGet](hashGet.md) - Get a field from a hash +- [hashGetAll](hashGetAll.md) - Get all fields from a hash +- [hashGetAllId](hashGetAllId.md) - Get all fields from a hash for a specific ID +- [hashGetId](hashGetId.md) - Get a field from a hash for a specific ID +- [hashRemove](hashRemove.md) - Remove a field from a hash +- [hashRemoveId](hashRemoveId.md) - Remove a field from a hash for a specific ID +- [hashSet](hashSet.md) - Set a field in a hash +- [hashSetBulk](hashSetBulk.md) - Set multiple fields in a hash in one operation +- [hashSetId](hashSetId.md) - Set a field in a hash for a specific ID +- [hashSetIdBulk](hashSetIdBulk.md) - Set multiple fields in a hash for a specific ID in one operation + +## Example Usage + +```sqf +// Context mode examples +["myField", [myValue]] call ramdb_db_fnc_hashSet; +["myField", "myFunction"] call ramdb_db_fnc_hashGet; +["myFunction"] call ramdb_db_fnc_hashGetAll; +["myField"] call ramdb_db_fnc_hashRemove; +[] call ramdb_db_fnc_hashDelete; + +// Set multiple hash fields in one operation +[[ + "loadout", [getUnitLoadout player], + "position", [getPosASL player], + "direction", [getDir player] +]] call ramdb_db_fnc_hashSetBulk; + +// ID-specific examples +["myHash", "myField", [myValue]] call ramdb_db_fnc_hashSetId; +["myHash", "myField", "myFunction"] call ramdb_db_fnc_hashGetId; +["myHash"] call ramdb_db_fnc_hashGetAllId; +["myHash", "myField"] call ramdb_db_fnc_hashRemoveId; +["myHash"] call ramdb_db_fnc_hashDeleteId; +``` + +## Related Categories + +- [Core Functions](../core/index.md) +- [Basic Data Operations](../basic/index.md) +- [List Operations](../list/index.md) \ No newline at end of file diff --git a/docs/list/index.md b/docs/list/index.md new file mode 100644 index 0000000..01b55b4 --- /dev/null +++ b/docs/list/index.md @@ -0,0 +1,40 @@ +# List Operations + +This section contains documentation for the list operations of ArmaRAMDb that allow for working with ordered collections of items. + +## Available Functions + +- [listAdd](listAdd.md) - Add an item to a list +- [listDelete](listDelete.md) - Delete a list +- [listGet](listGet.md) - Get items from a list +- [listLoad](listLoad.md) - Load a list from the database +- [listRemove](listRemove.md) - Remove an item from a list +- [listSet](listSet.md) - Set an item in a list + +## Example Usage + +```sqf +// Add an item to a list +["myList", ["myItem"]] call ramdb_db_fnc_listAdd; + +// Set an item at a specific index +["myList", 0, [myNewValue]] call ramdb_db_fnc_listSet; + +// Get an item at a specific index +["myList", 0, "myFunction"] call ramdb_db_fnc_listGet; + +// Load all items from a list +["myList", "myFunction"] call ramdb_db_fnc_listLoad; + +// Remove an item at a specific index +["myList", 0] call ramdb_db_fnc_listRemove; + +// Delete the entire list +["myList"] call ramdb_db_fnc_listDelete; +``` + +## Related Categories + +- [Core Functions](../core/index.md) +- [Basic Data Operations](../basic/index.md) +- [Hash Operations](../hash/index.md) \ No newline at end of file