{"id":22204029,"url":"https://github.com/0xwal/0xludb-fivem","last_synced_at":"2025-08-15T23:18:21.269Z","repository":{"id":192827392,"uuid":"687490738","full_name":"0xwal/0xludb-fivem","owner":"0xwal","description":"Simple KVP database wrapper for FiveM","archived":false,"fork":false,"pushed_at":"2024-07-06T20:52:57.000Z","size":22,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-27T06:01:47.960Z","etag":null,"topics":["fivem","kvp","lua"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xwal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-05T13:13:43.000Z","updated_at":"2025-07-23T05:50:09.000Z","dependencies_parsed_at":"2024-07-06T21:44:23.176Z","dependency_job_id":null,"html_url":"https://github.com/0xwal/0xludb-fivem","commit_stats":null,"previous_names":["0xwaleed/ludb-fivem","0xwal/0xludb-fivem"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/0xwal/0xludb-fivem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xwal%2F0xludb-fivem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xwal%2F0xludb-fivem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xwal%2F0xludb-fivem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xwal%2F0xludb-fivem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xwal","download_url":"https://codeload.github.com/0xwal/0xludb-fivem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xwal%2F0xludb-fivem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644762,"owners_count":24621332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fivem","kvp","lua"],"created_at":"2024-12-02T17:15:21.503Z","updated_at":"2025-08-15T23:18:21.246Z","avatar_url":"https://github.com/0xwal.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 0xludb-fivem - Key-Value Pair Database Library\n\n0xludb-fivem is a lightweight key-value pair (KVP) database library designed for use within your scripts. It allows you to store and retrieve data using keys, and it supports retrieving data with wildcards for nesting data.\n\n## Features\n- **Efficient Data Storage:** Streamlined key-value pair management.\n- **Works Client and Server:** Streamlined key-value pair management.\n- **Local and Global Data:** Store data locally or globally.\n- **Wildcard Retrieval:** Retrieve data matching patterns.\n- **Simple Integration:** Easy module import and use.\n- **Backup and Export:** Export data to JSON for backup or analysis.\n- **Resource-Based Keys:** Ensure key uniqueness within resources.\n- **Self-Contained:** No need for external databases.\n\n\n## Public Functions and Commands\n\n### `save(key, value)`\n\nSaves a value using a key. The key can be a string or a table. Data saved with this function is accessible only within the invoking resource.\n\n### `saveGlobal(key, value)`\n\nSaves a value globally using a key. The key can be a string or a table. Globally saved data is accessible from all resources.\n\n### `retrieve(key)`\n\nRetrieves a value using a key. The key can be a string or a table. Data retrieved with this function is specific to the invoking resource.\n\n### `retrieveGlobal(key)`\n\nRetrieves a globally saved value using a key. The key can be a string or a table. Globally retrieved data is accessible from all resources.\n\n### `delete(key)`\n\nDeletes a value using a key. The key can be a string or a table. Data deleted with this function is specific to the invoking resource.\n\n### `deleteGlobal(key)`\n\nDeletes a globally saved value using a key. The key can be a string or a table. Globally deleted data is removed from all resources.\n\n### Command: `0xludb-export`\n\nExports data to a JSON file when invoked from the server console (serverId 0). This command is typically used to export data for backup or analysis.\n\n### Command: `0xludb-import`\n#### Experimental ⚠️\nImport the exported data. `0xludb-import \u003cfilename\u003e` \n\n\n\n## Logging\nYou can enable logging by executing this command in fx console.\n```\nsetr log true\n```\n\n## Usage Example\n\nYou can import the module using:\n\n#### Local\n\n```lua\n-- Import the 0xludb-fivem module\nlocal ludb = exports['0xludb-fivem']\n\n-- Save player tokens\nludb:save(\"players/license:123/tokens\", 1000)\n\n-- Save player coordinates\nludb:save(\"players/license:123/coords\", { x = 50, y = -30, z = 10 })\n\n-- Confirmation message\nprint(\"Player tokens and coordinates saved.\")\n\n\n-- Retrieve player tokens\nlocal tokens = ludb:retrieve(\"players/license:123/tokens\")\n\n-- Display retrieved tokens\nprint(\"Player Tokens:\", tokens)\n\n\n-- Retrieve all player information using wildcard (*)\nlocal player = ludb:retrieve(\"players/license:123/*\")\n\nprint(json.encode(player.tokens.value))\nprint(json.encode(player.coords.value))\n\n-- Delete tokens\nludb:delete(\"players/license:123/tokens\")\n\nlocal tokens = ludb:retrieve(\"players/license:123/tokens\")\nprint(tokens) -- nil\n```\n\n#### Globally (data accessible from all resources)\n```lua\n-- Import the 0xludb-fivem module\nlocal ludb = exports['0xludb-fivem']\n\n-- Save global player tokens\nludb:saveGlobal(\"players/license:123/tokens\", 1000)\n\n-- Save global player coordinates\nludb:saveGlobal(\"players/license:123/coords\", { x = 50, y = -30, z = 10 })\n\n-- Confirmation message\nprint(\"Global Player tokens and coordinates saved.\")\n\n-- In another resource (assuming you have access to ludb)\n\n-- Retrieve global player tokens\nlocal globalTokens = ludb:retrieveGlobal(\"players/license:123/tokens\")\n\n-- Display retrieved global tokens\nprint(\"Global Player Tokens:\", globalTokens)\n\n-- Retrieve all global player information using wildcard (*)\nlocal globalPlayer = ludb:retrieveGlobal(\"players/license:123/*\")\n\nprint(json.encode(globalPlayer.tokens.value))\nprint(json.encode(globalPlayer.coords.value))\n\n-- Delete global tokens\nludb:deleteGlobal(\"players/license:123/tokens\")\n\nlocal globalTokens = ludb:retrieveGlobal(\"players/license:123/tokens\")\nprint(globalTokens) -- nil\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xwal%2F0xludb-fivem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xwal%2F0xludb-fivem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xwal%2F0xludb-fivem/lists"}