Docs

Installation

Swap out your old database resource for waw-sql in four steps. Your scripts and your connection string stay as they are.

Install

After you buy waw-sql it is in your Cfx.re account. Sign in at portal.cfx.re with the account you bought it with, open Assets → Granted Assets and download waw-sql. Unzip the download: inside is the waw-sql folder.

  1. Stop the server.
  2. Delete your oxmysql resource folder completely. It is usually inside a folder in brackets, such as [standalone] or [ox]; search your resources folder for oxmysql if you can't find it. Keep a copy somewhere outside resources if you want to be able to go back.
  3. Copy the waw-sql folder into your resources directory (or into one of the bracket folders in it). Keep its name waw-sql.
  4. Keep your existing mysql_connection_string convar. No other change is needed.

You don't need to ensure waw-sql yourself: anything that depends on oxmysql starts it automatically.

Starting from zero?

If you have no database yet, or don't know what goes into mysql_connection_string, read Connecting your database first.

Delete the old folder

waw-sql takes over the oxmysql name, so the old folder has to be gone, not just left out of server.cfg.

Check that it runs

Start the server. In the server console (the server's own window, or Live Console in txAdmin) you should see:

Console
[waw-sql] oxmysql compatibility enabled: ...
[waw-sql] Connected to 10.x.x-MariaDB (pool 20, 20 connections ready)

Then join the game and type /sqlmenu. Admins in the god or admin group can open it straight away. If you can't, make yourself an owner as described in Who may do what.

Why your scripts keep working

waw-sql declares itself as oxmysql, so all of these keep working without any change:

  • dependency 'oxmysql' entries
  • @oxmysql/lib/MySQL.lua lines
  • GetResourceState('oxmysql') checks
  • exports.oxmysql, mysql-async and ghmattimysql calls

Exports, the Lua library, placeholders, type conversion, transactions and error behaviour follow oxmysql 2.x. All releases from v1.0.0 to v2.14.1 were reviewed, and the same test suite of 117 cases produced identical output on oxmysql 2.12 and waw-sql inside FiveM.

What is different

  • DATETIME values at exactly midnight read through prepare or rawExecute come back as local time, the same as query returns them. oxmysql returned them shifted by the server's UTC offset.
  • The in-game /mysql screen is replaced by the /sqlmenu panel. oxmysql_debug add|remove <resource> still works.
  • Error messages are worded differently. The database's own error text is included unchanged.
  • restart waw-sql stops every resource that depends on it, the same as with oxmysql. Start them again, or restart the server.
  • Under the oxmysql name waw-sql answers every oxmysql export and its own additions (cache, queue, schema versions, the exports for other scripts), but not the panel's internal exports.

Going back

If you turned on the audit log, press Stop on each audited table first, so its triggers are removed. Then stop the server, delete the waw-sql folder and put your old oxmysql folder back.