How to use SQLite with Love (Using additional binaries)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How to use SQLite with Love (Using additional binaries)
Ok, well I want to use SQLite in my game to pull down information from a database, but I don't know how to go about doing it. I know I will have to make a different version for each platform (which I don't mind) but I still have no idea how to use it with LOVE. Any ideas?
Re: How to use SQLite with Love (Using additional binaries)
Is this something that can't be done with serialization? When you say pulling "down" from a database, does this mean you're pulling from a database that is online? If so I'd say make a web API for this, would work much better. I'd avoid databasing small amounts of information, whereas serialization would work better in a situation like that. Serialized objects/variables can be accessed more programmatic.
Re: How to use SQLite with Love (Using additional binaries)
I need to use a database to hold a lot of information, such as user data.tsturzl wrote:Is this something that can't be done with serialization? When you say pulling "down" from a database, does this mean you're pulling from a database that is online? If so I'd say make a web API for this, would work much better. I'd avoid databasing small amounts of information, whereas serialization would work better in a situation like that. Serialized objects/variables can be accessed more programmatic.
Re: How to use SQLite with Love (Using additional binaries)
Well, at least you have wrappers/bindings for Lua. It's a start, now you have to integrate/compile it with LOVE source (if possible).
http://lua.sqlite.org/index.cgi/doc/tip ... lite3.wiki
http://lua.sqlite.org/index.cgi/doc/tip ... lite3.wiki
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: How to use SQLite with Love (Using additional binaries)
Do you have an alternative?
I use a thread running on the server to communicate with a web api which also supplies the website.
The server periodically sends backup requests, which are responded to with account updates.
I don't think your database calls will not be noticeably quicker going directly from a bundled SQL client than they would be going to a web server.
I use a thread running on the server to communicate with a web api which also supplies the website.
The server periodically sends backup requests, which are responded to with account updates.
I don't think your database calls will not be noticeably quicker going directly from a bundled SQL client than they would be going to a web server.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: How to use SQLite with Love (Using additional binaries)
Remember that using your own libraries that are only available on certain platforms will basically make your game unplayable on those other platforms. Löve is supposed to be cross-platform. Adding libraries that only have say a Windows version will alienate Mac and Linux users. And vice versa.
Public service announcement. The more you know.
Public service announcement. The more you know.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: How to use SQLite with Love (Using additional binaries)
Do you need to make a lot of calls to the database? If not, I would just go with serialization and storing it in a flat file. You can store a ton of data like that. It won't be as fast as if you stored it in a database, but it'll be a lot easier to set up, and if you're only loading/storing data every now and then (saving/loading the game, for example), it's probably going to be fast enough.
Re: How to use SQLite with Love (Using additional binaries)
If you're storing user data for your game, then making a full on Database is way overkill. Look into serialization, its also easier to access than SQL.
When I think "a lot" of data I think of something like having several hundred/thousand/million users accessing something. In which serialization would be horrible. If you're making an online game where you have to sign in, then databasing is probably best, however, SQLite isn't your tool. You'd probably need a server to handle all the Databasing functions then, because giving your end user direct access to read and write to your database is like giving a thief the keys to your house.
You can either make a Web API to communicate with your client, or you can make a server which handles all these actions.
Really I can't see any need to store THAT much data all client-side that could not be done more effectively using serialization.
What exactly are you trying to accomplish?
When I think "a lot" of data I think of something like having several hundred/thousand/million users accessing something. In which serialization would be horrible. If you're making an online game where you have to sign in, then databasing is probably best, however, SQLite isn't your tool. You'd probably need a server to handle all the Databasing functions then, because giving your end user direct access to read and write to your database is like giving a thief the keys to your house.
You can either make a Web API to communicate with your client, or you can make a server which handles all these actions.
Really I can't see any need to store THAT much data all client-side that could not be done more effectively using serialization.
What exactly are you trying to accomplish?
Who is online
Users browsing this forum: No registered users and 14 guests