Raised This Month: $12 Target: $400
 3% 

[INC] SQLVault


Post New Thread Reply   
 
Thread Tools Display Modes
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-09-2011 , 14:34   Re: [INC] SQLVault
Reply With Quote #41

Quick question: Does this save with MySQL for remote databases, and then SQLite for local databases?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-09-2011 , 15:51   Re: [INC] SQLVault
Reply With Quote #42

You use sqlv_open/sqlv_open_default to open remote databases and sqlv_open_local to open the sqlite local database.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-14-2012 , 12:22   Re: [INC] SQLVault
Reply With Quote #43

Updated to v0.0.3:

- Added sorting and selection clauses for the read functions.
- Removed unnecessary fakemeta include from the extension.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 03-15-2012 , 18:19   Re: [INC] SQLVault
Reply With Quote #44

Thanks for the update. This makes using MySQL and SQL Lite incredibly easy!
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 03-16-2012 , 04:14   Re: [INC] SQLVault
Reply With Quote #45

Is it better to use sqlvault rather than nvault?
EpicMonkey is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-16-2012 , 09:39   Re: [INC] SQLVault
Reply With Quote #46

Quote:
Originally Posted by EpicMonkey View Post
Is it better to use sqlvault rather than nvault?
Only in situations where SQLVault would be more efficient or have a better purpose.

For example, the new sorting functionality that I just added would be more efficient for creating a ranking system with a top than if you would make it in NVault.
If you need data stored across multiple servers but you don't understand SQL, then this would work as well.

The extension also provides features that NVault doesn't have (paired keys).
So for example instead of having formatted key strings in NVault, you could have a pair of keys like "STEAM_0:1:23456" "points", and another of "STEAM_0:1:23456" "speed_level".
This would allow making the save/load a lot easier to write so you wouldn't even have to parse the string from NVault.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 03-17-2012 , 15:14   Re: [INC] SQLVault
Reply With Quote #47

I'm using the extended version of this vault include.
What would be the best way to find out whether a specific 2nd key value already exists.

To clerify:
sqlv_set_num_ex(g_Handler, szName , "online", iData)
sqlv_set_num_ex(g_Handler, szName , "id", iSomeID)

How can I determine if iSomeID already exists somewhere in the vault as the second key ("id"), no matter what the first key is (in this case szName) ?

I hope it's possible without irritating through the whole vault.


edit: I think I found a solution by looking at the example plugin.

Code:
new Output[3][SQLVaultEntryEx] // I actually only need to know if there is at least one entry matching the query (below) new iTotalEntries = sqlv_read_set_ex(g_Handler, Output, sizeof(Output), 0, "`id /* second key */` = iSomeID", "`id` DESC" /* DESC doesn't really matter */)

Would iTotalEntries contain the count of found entries ? Does it work like that ?

Last edited by t3hNox; 03-17-2012 at 16:14. Reason: edit.
t3hNox is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-17-2012 , 16:54   Re: [INC] SQLVault
Reply With Quote #48

Code:
new where[32]; formatex(where, charsmax(where), "`key2` = 'id' AND `value` = %d", iSomeID); new output[3][SQLVaultEntryEx]; new found = sqlv_read_set_ex(gVault, output, sizeof(output), 0, where, "`value` DESC");

Yes, the return value is the number of results found.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 03-17-2012 at 16:54.
Exolent[jNr] is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 03-17-2012 , 17:21   Re: [INC] SQLVault
Reply With Quote #49

Thank you.
t3hNox is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-05-2012 , 12:48   Re: [INC] SQLVault
Reply With Quote #50

another question , you see in nvault sometimes data saved gets reset , would it be the same case if i used SQLvault?
EpicMonkey is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode