Page 1 of 3

SQL Support

Posted: Tue May 11, 2010 7:25 am
by Richyg
Hi,

I've recently begun using LOVE to create an ambitious project I've had in mind for a while.

However, I need a database and I found with past ventures that SQL makes for a nice and easy database as it can be quickly called/written to. However, I've been struggling to implement SQL into Love and was wondering if anyone knew of a suitable way of doing so? If not, is there another database system that someone can suggest?

Thanks

Re: SQL Support

Posted: Tue May 11, 2010 7:36 am
by kikito
There's no easy way to do that.

Have you considered using Lua itself to codify your data?

Re: SQL Support

Posted: Mon May 17, 2010 10:46 pm
by Maggots
...XML? ^^

Re: SQL Support

Posted: Mon May 17, 2010 10:52 pm
by iza

Re: SQL Support

Posted: Tue May 18, 2010 3:42 am
by pygy
LÖVE only supports IO through PhysFS. The trouble is that SQLite is not compatible it...
The same goes for other DB systems.

As already suggested, you can use Lua as a document database. Think JSON, with a Lua Syntax... Actually, SOL, the ancestor of Lua, was a data description language, XML and JSON came in much later...

Re: SQL Support

Posted: Tue May 18, 2010 5:52 am
by bartbes
Actually, as my very old ticket proves, LuaSQLite is capable of using a program's native file access.

Re: SQL Support

Posted: Wed May 19, 2010 7:55 pm
by Richyg
Sorry for not getting back here sooner but I have had serious problems accessing the Love website in general, randomly my browsers can't find it :S

anyway,

I've been trying to implement LuaSQL but to no avail, it loads the SQL module via the Love directory but errors
"The specified procedure could not be found[]"

SQL would be the ideal answer to my plans as I have knowledge of SQL and have used it in good detail before to do a similar thing with Python.

Therefore, I've been looking to LUA to code the data but i'm still learning and its just garbage right now.

I think i almost got it to load accidently once but not sure what I did and then undid it when trying to fix it :(

If anyone has any more information on a ideal system for databases then I'm happy to hear it! :D

Re: SQL Support

Posted: Wed May 19, 2010 10:02 pm
by kikito
I'd like to know more about your idea. You don't need to tell it to me vervatim: I just want to know how SQL fits on it. Why using a database (instead of, say, a lua table) is so important?

Re: SQL Support

Posted: Thu May 20, 2010 6:42 am
by Luiji
Speed. For instance, MySQL is super fast compared to single text files. Drawbacks include the requirement of a central server, etc.

Re: SQL Support

Posted: Thu May 20, 2010 7:44 am
by kikito
Hm.

Unless you have lots and lots of info to save (50000 records or more) a plain lua file is just going to be faster and simpler.

You see, when you parse the lua file, the file is already in memory. It is a direct access to memory. That is an order of magnitude or two faster than going to a database, which often requires disk access (unless you have so few records that they are all cached. But in that case, a lua text file would be simpler to implement).

If you had 1000000 objects to manage, then the issue isn't speed any more; it is memory. You can't hold 1000000 easily on memory. So disk access, even being slower, is the only way to do it without crashing the game.