T1 // Core & Engine

coe_database

High-Velocity MariaDB Node 26 ACID Persistence

Asynchronous Connection Pooling on Node.js 24 LTS / Node 26 (libnode26) without Blocking Lua Threads

HEADLESS SERVICE (NO UI)
DEPENDS ON coe_supervisorcoe_logging
coe_database 4 exports · 0 commands

Runs without a NUI: nothing is rendered on the client and the resource stays idle until events arrive.

01 // OVERVIEW

The persistence foundation of the COE Framework runs on Node.js 24 LTS / Node 26 (libnode26) with optimized connection pooling, native prepared statements, and ACID transaction support. Unlike legacy solutions that stall under load, coe_database guarantees sub-millisecond query execution even with hundreds of concurrent requests.

On FiveM Enhanced

Executes in a 64-bit multi-threaded environment, leveraging Node.js 24 LTS / Node 26 (libnode26) to isolate database operations from the game tick and rendering pipelines.

02 // FEATURES

What the module delivers

01

Prepared Statements

Full immunity against SQL injection with cached query execution plans in MariaDB.

02

Atomic Transactions

Support for BEGIN/COMMIT/ROLLBACK with automatic rollbacks upon unexpected exceptions.

03

Zero-Touch Migrations

Automatically provisions and migrates table schemas on boot without manual SQL imports.

04

Zero Lua Thread Blocking

Non-blocking asynchronous promises keep player physics and events totally fluid.

ARCHITECTURAL LAYERS // CLEAN ARCHITECTURE

4-Layer Isolation with 0.00 ms Idle

Every COE Framework script strictly follows the principle of separation of concerns. Interact with the 3D stack below:

L4
Headless Operation (No UI)
Zero DOM · CoE UI Delegation
Headless
L3
Application & Server
Atomic locks · Rate limiting
Auth Server
L2
Platform & HAL
Core.Platform · Mock natives
Gen9 HAL
L1
Domain & ACID Database
Prepared SQL · MariaDB pool
ACID Pool
LAYER 04 // HEADLESS SERVICE

Headless Service (No Dedicated NUI)

Operates strictly within layers L1–L3 (domain, HAL, and server-authoritative application logic). Visual interactions and management flows are delegated to centralized ecosystem apps (coe_ui / coe_tablet), guaranteeing 0.00 ms idle client overhead in FiveM DX12.

Zero CEF graphic overhead: no background web pages or NUI bridges loaded
Typed public contracts (types.lua) consumed directly by external resources and UIs
Strict adherence to the Server-Authoritative model with zero direct DOM manipulation
ADMIN POWERS // OPERATION & MANAGEMENT

What this script delivers to Server Owners

Manage your city without relying on developers. Runtime parameters, auditing, and ACE-protected commands:

🔒
ACID Transactions
Executes BEGIN...COMMIT blocks ensuring full atomicity or automatic rollback.
exports.coe_database:Transaction(statements, callback)
🛡️
Zero SQL Injection
100% of parameters bound exclusively via prepared statements.
exports.coe_database:Execute(sql, parameters, callback)
📦
Automatic Migrations
Versioned and idempotent schema migrations powered by CoeMigrations on boot.
CoeMigrations.Run()
03 // EXPORTS

Public API 4

Typed contracts to call from other resources. Full types live in types.lua and in the docs reference.

exports['coe_database']:Query(sql, parameters, callback) → void

Executes a parameterized SELECT query (using positional `?` placeholders).

ParameterType
sqlstring
parametersany[]
callbackCoeDatabaseCallback
LUA
exports['coe_database']:Query(sql, parameters, callback)
exports['coe_database']:Execute(sql, parameters, callback) → void

Executes a parameterized INSERT, UPDATE, DELETE, or DDL statement.

ParameterType
sqlstring
parametersany[]
callbackCoeDatabaseCallback
LUA
exports['coe_database']:Execute(sql, parameters, callback)
exports['coe_database']:Transaction(statements, callback) → void

Executes multiple statements within an atomic database transaction (all-or-nothing rollback).

ParameterType
statements{
callbackCoeDatabaseCallback
LUA
exports['coe_database']:Transaction(statements, callback)
exports['coe_database']:IsReady() → boolean

Verifies if the database connection pool is active and ready for operations.

No parameters.

LUA
local result = exports['coe_database']:IsReady()
04 // COMMANDS

In-game commands 0

This module registers no commands: it is driven by exports and events.