[Include] PVar database - The easiest way for a user database - SQLITE, MYSQL
#21

Quote:
Originally Posted by Gammix
View Post
What i meant was sort of similar to this logic.
Example:
Code:
SavePVar(playerid, "Test");
// The execute interval has started

// New variables added (query isn't executed)
SavePVar(playerid, "Test2");
SavePVar(playerid, "Test3");
SavePVar(playerid, "Test4");

// After 'X' seconds (say 2 secs), the query is executed and result is free!
(similar with loading functions)
The problem with this is things can go wrong, like what if that player disconnected within those 2 seconds? Or what if the server crashed? Or anything else that causes interruptions.

Giving the users the ability to run transactions would solve this.

Code:
//Single Query
SavePVar(playerid, "Test0");

//Multiple Queries
StartPVarQuery(); // Macro for db_query("BEGIN")
SavePVar(playerid, "Test");
SavePVar(playerid, "Test2");
SavePVar(playerid, "Test3");
SavePVar(playerid, "Test4");
EndPVarQuery(); // Macro for db_query("COMMIT")
Also, transactions are super quick, so this would speed up a lot of things. Transactions can run extreme amounts of queries in a single swoop in a very small amount of time.
Reply


Messages In This Thread
Vars.inc - Save/load in memory variables! - by Gammix - 29.09.2015, 04:25
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Sew_Sumi - 29.09.2015, 04:29
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gigi-The-Beast - 29.09.2015, 10:36
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Pottus - 29.09.2015, 10:51
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Crayder - 29.09.2015, 11:01
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Sew_Sumi - 29.09.2015, 23:21
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gigi-The-Beast - 08.10.2015, 07:52
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 08.10.2015, 09:26
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Chaprnks - 24.01.2016, 15:04
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 01.03.2016, 04:56
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Uberanwar - 01.03.2016, 07:11
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Amunra - 01.03.2016, 07:23
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 01.03.2016, 13:09
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Uberanwar - 01.03.2016, 13:17
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 01.03.2016, 13:19
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 22.03.2016, 21:45
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by SickAttack - 22.03.2016, 22:03
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 22.03.2016, 22:58
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Crayder - 23.03.2016, 17:09
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 25.03.2016, 15:00
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Crayder - 25.03.2016, 17:49
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by Gammix - 25.03.2016, 18:46
Re: PVar database - The easiest way for a user database - SQLITE, MYSQL - by MrFantasy - 28.05.2017, 03:13

Forum Jump:


Users browsing this thread: 1 Guest(s)