brouznouf / fivem-mysql-async

MySql Async Library for FiveM
MIT License
111 stars 106 forks source link

Multirow insert? #40

Open benzon opened 6 years ago

benzon commented 6 years ago

Hi, im trying to improve abit on some of ESX Datastore and addoninventory scripts and wondering if mulitirow insert is supportet.

Example

INSERT INTO test_table (name, description ) VALUE (value1, value2), (value3, value4), (value5, value6)

The current way in these scripts are terrible if there is a lot data, we tryed adding inventory for each appartment, but just having all the appartments in the database, and the current way is a loop, and ends up using a shit ton of connections, but thats with the older v2 version.

Not sure if the new version actually manages to close the connection after each insert, so we dont end up with 100-200+ connection from loops like that.

ghost commented 6 years ago

I can look into adding a multirow insert command.

be aware that the current mysql-async can handle up to 1000-1500 requests per seconds, compared to the 350 - 450, 2.x was dying this is a big leap.

benzon commented 6 years ago

Would be nice, especially for redundant insert tasks.