oxmysql

Installation
SKILL.md

oxmysql

Server-side MySQL/MariaDB access for FiveM through the MySQL table (replacement for mysql-async and ghmattimysql).

Activation Contract

Load this skill when the user writes or edits database code in a FiveM resource: SELECT/INSERT/UPDATE/DELETE, upserts, transactions, MySQL.*, exports.oxmysql, or migrating from mysql-async.

Hard Rules

  • Server only. Add server_script '@oxmysql/lib/MySQL.lua' to fxmanifest.lua above other server scripts.
  • MySQL.Sync.* and MySQL.Async.* (mysql-async compatibility layer) are NOT available. Replace them with MySQL.query, MySQL.scalar, MySQL.single, MySQL.insert, MySQL.update, MySQL.prepare, MySQL.transaction, each with a .await variant.
  • @named placeholders are deprecated: use positional ? with an array of values. prepare accepts only ? (and ?? for column names).
  • Never concatenate user input into SQL; every value goes through a placeholder.
  • Every function takes (query, params, callback); use .await to yield instead of nesting callbacks.
  • Use transaction when several writes must succeed or fail together; it rolls back on any failure.
  • Use rawExecute only when the normalized result shape of query/prepare is insufficient.
  • Prefer MariaDB over MySQL 8 for compatibility.
Installs
20
GitHub Stars
15
First Seen
9 days ago
oxmysql — germanfndez/fiveai-skills