https://github.com/fedox-die-ente/gmsv_mongo
The gmsv_mongo module enables the usage of MongoDB connections within Garry's Mod (GMod) via Rust. This opens up diverse possibilities for database interactions and management within GMod servers.
https://github.com/fedox-die-ente/gmsv_mongo
binary database dll garrysmod gmod mongodb rust
Last synced: 15 days ago
JSON representation
The gmsv_mongo module enables the usage of MongoDB connections within Garry's Mod (GMod) via Rust. This opens up diverse possibilities for database interactions and management within GMod servers.
- Host: GitHub
- URL: https://github.com/fedox-die-ente/gmsv_mongo
- Owner: Fedox-die-Ente
- License: agpl-3.0
- Created: 2024-05-24T11:37:19.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-01-26T13:43:15.000Z (3 months ago)
- Last Synced: 2025-03-23T03:08:48.032Z (about 1 month ago)
- Topics: binary, database, dll, garrysmod, gmod, mongodb, rust
- Language: Rust
- Homepage:
- Size: 95.7 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gmsv_mongo
The gmsv_mongo module enables the usage of MongoDB connections within Garry's Mod (GMod) via Rust. This opens up diverse possibilities for database interactions and management within GMod servers.
![]()
π οΈ Installation Steps:
1. Download the correct file for your server operating system. You can execute the following console command to get the correct version.
```
lua_run print(jit.os, jit.arch)
```2. Put the file in your garrysmod/lua/bin folder if it doesn't exists just create one.
3. Include the module in your code.
```
require('mongo');
```π» Built with
Technologies used in the project:
* [Rust](https://www.rust.de/startseite)
* [rglua](https://github.com/Vurv78/rglua)
* [mongodb](https://github.com/mongodb/mongo-rust-driver)
* [tokio](https://docs.rs/tokio/1.37.0/tokio/index.html)
* [serde](https://docs.rs/serde/latest/serde/)
* [dotenv](https://docs.rs/dotenv/0.15.0/dotenv/)
* [log](https://docs.rs/log/0.4.21/log/)
* [termcolor](https://docs.rs/termcolor/1.4.1/termcolor/)
* [futures](https://docs.rs/futures/0.3.30/futures/)π¨ Build project
To build the sample project in debug mode, you need to specify the target architecture for your build.
| Platform | Command | Description |
|:---------:|:-----------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------:|
| `win32` | `cargo build --target i686-pc-windows-msvc` | Windows 32-bit
Use this if your server is running Windows on the `main` branch of Garry's Mod (this is the default branch). |
| `win64` | `cargo build --target x86_64-pc-windows-msvc` | Windows 64-bit
Use this if your server is running Windows on the `x86-64` branch of Garry's Mod. |
| `linux` | `cargo build --target i686-unknown-linux-gnu` | Linux 32-bit
Use this if your server is running Linux on the `main` branch of Garry's Mod (this is the default branch). |
| `linux64` | `cargo build --target x86_64-unknown-linux-gnu` | Linux 64-bit
Use this if your server is running Linux on the `x86-64` branch of Garry's Mod. |If Rust reports it cannot find the target/toolchain, you may need to install it. By default, Rust installs the native
toolchain for your system, which is likely Windows 64-bit (`x86_64-pc-windows-msvc`).Cross-compiling Linux binaries on Windows is not recommended. For compiling Linux binaries on Windows, use WSL.
### Using the Sample in Garry's Mod
First, rename the compiled binary to `gmsv_mongo_PLATFORM.dll`, where `PLATFORM` corresponds to one of the following:
| Platform | Description |
|:---------:|:------------------------------------------------------------------------------------------------------------------------------:|
| `win32` | Windows 32-bit
Use this if your server is running Windows on the `main` branch of Garry's Mod (this is the default branch). |
| `win64` | Windows 64-bit
Use this if your server is running Windows on the `x86-64` branch of Garry's Mod. |
| `linux` | Linux 32-bit
Use this if your server is running Linux on the `main` branch of Garry's Mod (this is the default branch). |
| `linux64` | Linux 64-bit
Use this if your server is running Linux on the `x86-64` branch of Garry's Mod. |Next, move the renamed binary to `garrysmod/lua/bin/` on your server. If the `bin` folder does not exist, create it.
Finally, you can load the module from Lua with:
```lua
require("mongo")
```π§βπ» Examples
For some examples on how to use the module, check out the [examples](https://github.com/Fedox-die-Ente/gmsv_mongo/tree/master/examples) folder.
π‘οΈ License:
This project is licensed under the [AGPL-3.0](LICENSE)
πLike my work?
Leave a β on this repository :D