trollebror
Developer
Hello OTLanders!
I'm wondering about exactly how efficient or inefficient is it to use this kind of database operations.
Let's say that one of these functions will get called as often as a rope.lua script would, would it be terrible bad? How would a efficient solution look like? Is there a way to store SQL-data in cache like the getPlayerStorageValue() is doing?
I'm wondering about exactly how efficient or inefficient is it to use this kind of database operations.
Lua:
function insertToSQL(accid, time, admin_id, comment)
return db.executeQuery("INSERT INTO `someDataz` ... ")
end
function getBanAccInfo(acc)
local info,qry = {},db.getResult("SELECT `someDataz` ...")
if (qry:getID() ~= -1) then
info = {qry:getDataInt("expires"), qry:getDataString("comment"), qry:getDataString("admin_id")}
end
return info
end
Let's say that one of these functions will get called as often as a rope.lua script would, would it be terrible bad? How would a efficient solution look like? Is there a way to store SQL-data in cache like the getPlayerStorageValue() is doing?