Compatibility
- Frameworks
- Not specified
- Version
- 1.0
- Game Mode
- FiveM

by aquapha-v
aq-orm is a lightweight ORM built specifically for FiveM that sits on top of oxmysql. If youβre tired of writing raw SQL strings and wrestling with typos in your queries, this library gives you a fluent, fully type-safe query builder with zero runtime overhead.
Most FiveM resources interact with the database through raw SQL strings. That works, but it means:
aq-orm solves all of that with a functional schema definition and a chainable query builder that produces parameterized SQL under the hood.
.groupBy(), etc.)
@overextended/oxmysqlpnpm add @aquapha/aq-orm
import { oxmysql } from "@overextended/oxmysql";
import { Database, Driver, table, int, varchar, boolean, eq } from "@aquapha/aq-orm";
// Define your schema
const users = table("users", {
id: int("id").primaryKey().autoIncrement(),
name: varchar("name", 255).notNull(),
active: boolean("active").default(true),
});
// Create a database instance
const db = new Database(new Driver(oxmysql));
// Type-safe queries β autocomplete and compile-time checks included
const activeUsers = await db
.select(users)
.where(eq(users.columns.active, true))
.execute();
The result type of activeUsers is automatically inferred from your schema. No manual typing required.
Define tables using plain functions β no decorators, no classes, no magic:
const players = table("players", {
id: int("id").primaryKey().autoIncrement(),
name: varchar("name", 255).notNull(),
email: varchar("email").notNull().unique(),
role: enumCol("role", ["admin", "user", "moderator"]).notNull(),
balance: decimal("balance", 10, 2).default(0),
metadata: json<{ level: number; xp: number }>("metadata"),
createdAt: timestamp("created_at").notNull(),
});
// Infer the TypeScript type directly from the schema
type Player = Infer<typeof players>;
// { id: number | null; name: string; email: string; role: "admin" | "user" | "moderator"; ... }
Supported column types: int, bigint, varchar, text, boolean, date, timestamp, datetime, json, decimal, enumCol.
// Select with joins and aggregation:
const revenue = await db
.select(orders)
.columns({
customerId: orders.columns.customerId,
totalSpent: sum(orders.columns.amount),
orderCount: count(),
})
.where(eq(orders.columns.status, "completed"))
.groupBy(orders.columns.customerId)
.having(gte(sum(orders.columns.amount), 1000))
.orderBy(sum(orders.columns.amount), "DESC")
.limit(10)
.execute();
// Upsert:
await db
.insert(players)
.values({ id: 1, name: "John", email: "john@example.com" })
.onDuplicateKeyUpdate(["name", "email"])
.execute();
// Transactions:
await db
.transaction()
.add(db.update(accounts).set({ balance: 500 }).where(eq(accounts.columns.id, 1)))
.add(db.insert(logs).values({ action: "balance_update", accountId: 1 }))
.execute();
// Raw SQL when you need it:
import { sql } from "@aquapha/aq-orm";
const userId = 1;
const query = sqlSELECT * FROM users WHERE id = ${userId};
await db.raw(query.sql, query.params);
pnpm add @aquapha/aq-ormβββββββββββββββββββββββββ¬ββββββββββ
β
βββββββββββββββββββββββββΌββββββββββ€
β Code is accessible β Yes β
βββββββββββββββββββββββββΌββββββββββ€
β Subscription-based β No β
βββββββββββββββββββββββββΌββββββββββ€
β Lines (approximately) β 2700 β
βββββββββββββββββββββββββΌββββββββββ€
β Requirements β oxmysql β
βββββββββββββββββββββββββΌββββββββββ€
β Support β GitHub issues β
βββββββββββββββββββββββββ΄ββββββββββ
Free download (ad supported)
Free downloads are supported by a brief ad page (Linkvertise) to keep this service running.
Written by the VertexMods editorial team based on the current CitizenFX artifact and the target framework β not copy-pasted from the upstream post.
resources/[standalone]/aq-orm-lightweight-type-safe-orm-for on your server. Keep the resource folder name as-is β most manifests reference it verbatim.ensure aq-orm-lightweight-type-safe-orm-for to your server.cfg.ensure aq-orm-lightweight-type-safe-orm-for in the live console to confirm it loads without red errors. If you hit a dependency error, the mod probably needs ox_lib or ox_inventory β install those first, then retry.Get More from Free Mods
Create a free account for update notifications, your mod collection, and ad-free downloads.
Premium Alternative
Get premium scripts with dedicated support, lifetime updates, and one-click installation.
Other popular free mods you might find useful for your server.
Quick answers based on the information published for aq-orm β Lightweight, Type-Safe ORM for FiveM.
Have another question? Check the mod description above for more details.
Learn more about setting up, configuring, and using this type of resource.
Discover more resources for your FiveM or GTA 5 server.
Free mods are a good starting point. When your server needs stronger support, cleaner installs, and premium systems, move into the commercial hubs below.