Should I replace mysql-async with your fivem-mysql library?
Right now I don’t recommend to change those resources with each other, mysql-async is a stable MySQL library. Where fivem-mysql is a new library that may contain some bugs. Your free to try this resource out, but remember: It may contain bugs. You can report issues on GitHub: Report Issue.
When I think the resource is stable enough to be used on live servers, this notification will be removed and a post will be posted with a notification like: Ready for live servers
I love to use MySQL 8, when I was using mysql-async I got those messages:
[mysql-async] [WARNING] It is recommended to run MySQL 5 or MariaDB with mysql-async. You may experience performance issues under load by using MySQL 8.
mysql-async is a really good resource to use and don’t say people have to change, especially not in there live versions right now because this resource may be unstable right now.
I decided to make an FiveM resource that uses a different library to connect with the database. I had performance improvements compared to the mysql-async library.
mysql-async has right now more features and a custom NUI for debugging performance. fivem-mysql is right now a basic resource to communicate with your MySQL database.
I developed this resource for a MySQL 8 server and had a huge performance boost compared to the mysql-async library.
mysql-async
Performance test: `mysql-async`
Executing: 'SELECT * FROM `players`'
Query took: 0.073255ms to execute
Executing: 'SELECT * FROM `players` WHERE `name` = @name'
Query took: 0.091911ms to execute
Executing: 'INSERT INTO `players` (`identifier`, `name`, `group`, `job`, `grade`, `job2`, `grade2`) VALUES (@identifier, @name, @group, @job, @grade, @job2, @grade2)'
Query took: 0.101101ms to execute
Executing: 'DELETE FROM `players` WHERE `identifier` = @identifier'
Query took: 0.100100ms to execute
fivem-mysql
Performance test: `fivem-mysql`
Executing: 'SELECT * FROM `players`'
Query took: 0.029029ms to execute
Executing: 'SELECT * FROM `players` WHERE `name` = @name'
Query took: 0.051052ms to execute
Executing: 'INSERT INTO `players` (`identifier`, `name`, `group`, `job`, `grade`, `job2`, `grade2`) VALUES (@identifier, @name, @group, @job, @grade, @job2, @grade2)'
Query took: 0.061952ms to execute
Executing: 'DELETE FROM `players` WHERE `identifier` = @identifier'
Query took: 0.042152ms to execute
I did my benchmark on the same SQL version 8.0, it isn’t that one was running on 5.4 or so. fivem-mysql is faster compared to mysql-async when using MySQL 8.0
can i make it use a different database (like for a certain script it will only use the database and the server the mysqlasync one)
an example instead of using: