• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Some expert in MySQL!!!

Sarah Wesker

ƐƖєgαηт Sуηтαx ❤
Staff member
TFS Developer
Support Team
Joined
Mar 16, 2017
Messages
1,419
Solutions
155
Reaction score
1,976
Location
London
GitHub
MillhioreBT
Twitch
millhiorebt
what difference there is between these 2 functions.
Code:
      luaDatabaseExecute
Code:
      luaDatabaseAsyncExecute
The one who does not know anything about this that better not write anything.
a little doubt;)

(db.query) return boolean value
(AsyncExecute) return ???
 
then you should not use (Asyn)
Example:
Code:
local result_ptr = db.asyncQuery("UPDATE `xtable` SET `time` = " .. time .. " WHERE `id` = 1;")
if not result_ptr then
return false
end
What is the best ?
Code:
local result_ptr = db.query("UPDATE `xtable` SET `time` = " .. time .. " WHERE `id` = 1;")
if not result_ptr then
return false
end
 
Async doesn't block the main thread, so for UPDATE or INSERT queries, I would recommend it.

For "SELECT" queries you should be using anyways a normal variant, as you need to have the result immediately, not in the background (async).

This is just my opinion.
 
Async doesn't block the main thread, so for UPDATE or INSERT queries, I would recommend it.

For "SELECT" queries you should be using anyways a normal variant, as you need to have the result immediately, not in the background (async).

This is just my opinion.
Thank you very much, my friend ;)
 
Back
Top