![]()
Sleet ORM
Schema-as-code for FiveM + oxmysql
Tired of managing raw SQL strings and losing track of your database types? Sleet brings the “Schema-as-code” philosophy (inspired by Drizzle ORM) directly into your FiveM Lua environment.
Define your tables once in Lua, and enjoy a type-safe, fluent query builder that makes database interactions elegant and error-free.
Key Features
- Schema as Code – Define your database tables in Lua scripts, not SQL strings.
- Full Type Inference – No more manual
---@typeannotations. With our CLI, LuaLS automatically understands your record shapes. - Fluent Query Builder – Chainable
.select(),.insert(),.update(), and.delete()methods. - Safe by Design – Uses parameterized queries (placeholders) to make SQL injection impossible.
- CLI Tooling – Comes with a Go-powered binary to generate
CREATE TABLESQL and EmmyLua types. - Lightweight – Zero runtime dependencies (only requires
oxmysql).
Define your schema:
local players = sl.table('players', {
id = sl.serial().primaryKey(),
identifier = sl.varchar(64).notNull().unique(),
money = sl.int().default(500),
is_admin = sl.boolean().default(false),
})
Query with ease:
local db = Sleet.connect()
local s = require 'server.schema'
local rows = db.select()
.from(s.players)
.where(sl.eq(s.players.id, 1))
.execute()
-- 'rows[1]' is automatically inferred as PlayersRecord!
Installation
Check out the full documentation and setup guide on GitHub:
GitHub: Sleet-ORM
| Code is accessible | Yes |
| Subscription-based | No |
| Lines (approximately) | 757+ |
| Requirements | oxmysql |
| Support | Issue |