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
SQL Support
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: SQL Support
There's no easy way to do that.
Have you considered using Lua itself to codify your data?
Have you considered using Lua itself to codify your data?
When I write def I mean function.
Re: SQL Support
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...
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...
Hermaphroditism is not a crime. -- LSB Superstar
All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: SQL Support
Actually, as my very old ticket proves, LuaSQLite is capable of using a program's native file access.
Re: SQL Support
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!
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!
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: SQL Support
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?
When I write def I mean function.
Re: SQL Support
Speed. For instance, MySQL is super fast compared to single text files. Drawbacks include the requirement of a central server, etc.
Good bye.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: SQL Support
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.
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.
When I write def I mean function.
Who is online
Users browsing this forum: No registered users and 3 guests