![]() |
SQLite
SQLite is a serverside only update that should have been added months ago, why don't we have it?
Though I've just about lost all interest in scripting due to lack of updates. |
SQLite would be a great help when it comes to data storage. It's more efficient than flat-file storage, and doesn't have all the problems that flat-file systems run in to (and isn't a pain to script!).
There are tutorials for SQLite integration with Torque on the GarageGames resources web site. I would definitely prefer this being priority number one more than anything else. |
Fun facts about the mud account files on Valikorlia:
Total count: 9,149 Total file contents size: 6.27 MB Total file size including metadata (on Vista): 36.1 MB And I compressed them into a 180 kB 7-Zip archive. Would love to be using a database instead. |
Ok added SQLite support, when using the requestsql-commands then the default database is now a sqlite database
PHP Code:
To build the query string use string.escape() to avoid SQL injection. The full list of supported SQL statements is available at http://www.sqlite.org/lang.html |
Quote:
|
Quote:
I can't wait to try it out. |
Quote:
So where is the database file stored? I would like to be able to back that up easily. Also: what is the boolean value for, what are the parameters for requestsql2(), and what are the details on the object that the two functions return. |
PHP Code:
|
Quote:
|
Quote:
Edit: After looking up SQLite documentation, I have a few more suggestions. I suggest instead of having the global requestsql() functions that instead there be an sqlopen(str filename) function that returns an sql database object that can be used to execute sql queries and such. This is so there can be multiple databases opened simultaneously. PHP Code:
Along with this, I noticed that before I have been unable to load files from disk during the onInitialized() in the Control-NPC, I'd like that fixed so there is no problem opening databases the instant the server starts. |
The requestsql2() command lets you specify which configured database you are using. That way you can easily switch between sqlite or mysql. The database configuration is right now not accessible by server staff though.
requestsql() for sqlite databases is right now synchronous, but it can be possible later to also do it asynchronous like for mysql. In the example I have already shown how to wait for the command to complete: PHP Code:
Update: the new npcserver is now installed on the private/hosted playerworld computers, restart it to try. |
Quote:
I'm also not going to be using SQL unless I can back the whole database up at least twice a day. |
Pardon my ignorance, but what is the advantage of using a database (SQLite) to store information as opposed to text files or database NPCs?
|
Quote:
|
Quote:
Also you can access information independent from if the player is online or not, so it could be used on servers that currently store special additional attributes in files. |
All times are GMT +2. The time now is 11:59 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.