For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

USQLite [Not yet released, pending testing]

Unreal Unreal and more Unreal
Post Reply
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

USQLite [Not yet released, pending testing]

Post by []KAOS[]Casey »

So I finally got off my ass and made an SQLite database interface for Unreal.

Currently it uses name lookups instead of ID lookups, but I could add ID lookups in case extra speed is needed because the test function as shown below is pretty.. well.. slow. It freezes my unreal for about 1/4th a second or so.

Any suggestions? I still need to test the hell out of it since I just now got it working without any sort of consistent crashing, but I haven't tested literally every single function in depth; only what you see in the test code.


Interface code is as follows(including test poop)

Code: Select all

//============================================================================
// Holy shitballs! it's a SQLite3 Class for unreal!!!!!!!!
// Do you love local databases? I crappity smackING DO, NO SQL INSTALLATION REQUIRED
// v1.0 by []KAOS[]Casey using a wrapper I had to fix called easySQLite
// crappity smack google code
//==============================================================================
class USQLiteDB extends Object
native;

var native const editconst int InternalTableList;//If you touch these I hope you like crashes. 
var native const editconst int InternalRecordList;
var native const editconst int InternalDB;
var native const editconst int InternalDBName; //yeah thats right,4 different ways to cause crashes. Don't be a dumbass.


native final function SetupDatabase(string Filename);//filename eg test.db
native final function CloseDatabase();//cleanup!


//sqlite3 syntax   : CREATE TABLE person (_ID INTEGER PRIMARY KEY, fname TEXT NOT NULL, lname TEXT NOT NULL, birthdate INTEGER)
//USQLiteDB syntax : AddTable("person","_ID INTEGER PRIMARY KEY, fname TEXT NOT NULL, lname TEXT NOT NULL, birthdate INTEGER");
native final function AddTable(String TableName, String TableDefinition);
native final function RemoveTable(String TableName);


native final function bool PushRecord(String Table);//Adds one new record.

native final function PullRecord(String Table,optional string WhereCondition);
//PullRecord("person"); would grab the all entries from the person table
//PullRecord("person","_ID >= 10 and _ID  3");

}

function PrintTestDB(USQLiteDB DB,string TableName)
{
      local int i, max;
      max = DB.GetNumRecords(TableName);
      for(i=0; i
User avatar
Smirftsch
Administrator
Posts: 9001
Joined: Wed Apr 29, 1998 10:00 pm
Location: NaPali
Contact:

Re: USQLite [Not yet released, pending testing]

Post by Smirftsch »

the possibilities a database offers are almost endless. Could make real RPG's maybe with it :)
Sometimes you have to lose a fight to win the war.
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

Re: USQLite [Not yet released, pending testing]

Post by Bleeder91[NL] »

I would give it a try. :P
Image
User avatar
DocHoliday
OldUnreal Member
Posts: 20
Joined: Fri Jun 29, 2012 5:58 am

Re: USQLite [Not yet released, pending testing]

Post by DocHoliday »

What is it used for??? Saving data like player health and stuff?
Post Reply

Return to “Unreal General Forum”