Installation
This guide provides detailed instructions for installing Sleet ORM in your FiveM server.
Prerequisites
Before installing Sleet ORM, ensure you have:
- A running FiveM server
- oxmysql resource installed and configured
- Basic knowledge of FiveM resource management
Step 1: Download Sleet
Clone the Sleet ORM repository to your resources folder:
bash
cd resources/[sleet]
git clone https://github.com/SleetCo/sleet-orm sleetYour folder structure should look like:
resources/
├── [sleet]/
│ └── sleet/ # Sleet ORM resource
├── [other resources]/Step 2: Configure server.cfg
Add Sleet to your server.cfg file. Make sure to start it after oxmysql:
cfg
# Database
ensure oxmysql
# Your resources that use Sleet
ensure your_gamemode
ensure your_scriptsStep 3: Resource Configuration
In your resource's fxmanifest.lua, add the required dependencies:
lua
fx_version 'cerulean'
game 'gta5'
-- Dependencies
dependency 'oxmysql'
dependency 'sleet'
server_scripts {
'@oxmysql/lib/MySQL.lua',
'@sleet/sleet.lua', -- Must be loaded before your scripts
'server/**/*.lua'
}Step 4: Verify Installation
Create a simple test to verify Sleet is working:
lua
-- server/test.lua
local sl = Sleet
-- Test if Sleet is loaded
if sl then
print("✓ Sleet ORM loaded successfully!")
-- Test database connection
local db = sl.connect()
if db then
print("✓ Database connection established!")
else
print("✗ Database connection failed!")
end
else
print("✗ Sleet ORM not found!")
endStep 5: CLI Tools (Optional)
For advanced features like type generation, install the CLI tools:
Via npm (Recommended)
bash
npm install -g sleet-orm-cliManual Installation
Download the appropriate binary from GitHub Releases.
Troubleshooting
Common Issues
"Sleet is not defined"
- Ensure
@sleet/sleet.luais loaded before your scripts infxmanifest.lua
"Database connection failed"
- Verify oxmysql is properly configured
- Check your database credentials in oxmysql configuration
Resource not starting
- Check server console for error messages
- Ensure all dependencies are listed in
fxmanifest.lua
Getting Help
If you encounter issues:
- Search existing GitHub issues
- Join our community discussions
Next Steps
Now that Sleet is installed:
- Learn Basic Usage
- Explore Examples
- Check out Best Practices
