[RELEASE] easySql v0.91

This is a wrapper for mysql-async, thus it is a requirement for this resource to work.

Features:

Instead of passing query strings you use lua tables that correspond to the changes in your database. Everything else is done “under the hood” for you.

Usage:

  • Consult the buttom of the server.lua for examples. If requested enough or if this project grows in scope i will consider putting up a documentation.

Known Issues:

  • Requires testing.

To-do list:

  • Make aspects of the mod configurable if necessary.
  • Fix issues.
  • Create documentation if necessary

Changelog:

v0.9a

  • Initial release.

v0.91

  • Removed Sleep function for possible compatibility issues on Linux.
  • Usage no longer relies on exports. Include it in your resource.lua / fxmanifest.lua instead.
  • Added ready function due to asynchronous initialization of functions. Must be used to avoid errors on resource start (see example in the server.lua)
  • Added common.lua including a small library of other usefull functions.
4 Likes

What does this help?

This is a wrapper for mysql-async.

If you’re gonna do this, please don’t use mysql-async. It’s outdated and just bad. Much better to use mysql2 - npm

Can you elaborate?

mysql-async was last updated years ago and it’s on a very old version/branch of mysql

I’ll take a look and consider a conversion/different branch. Thanks for your feedback!

These are very different. mysql-async is a resource, whereas mysql2 is a node module which is not compatible with mysql-async by simply swapping out the module used (mysqljs).

I never said they werent different, I just said if you’re gonna make something from scratch like he did just use node mysql2. I never said swap out the module used for mysql-async (in fact rather throw that shit into the garbage and make your own mysql2 wrapper and avoid callback hell). Not everything in life is as easy as drag and drop :+1:

I more-so replied to your comment for context - most people aren’t going to know wtf mysql2 and mysqljs are, and assume you just drop it into a folder and run.

This is a wrapper for a wrapper so it’s a bit weird.

Yeah ik I meant if ur gonna make a wrapper might aswell do it for mysql2 instead of making a wrapper on top of a old mysql wrapper :smiley: