SQLite is database software that doesn't require a server, like MySQL does. Instead, it does everything in a file. It's also simplified down a lot, so a lot of the more advanced features of MySQL are not there. Furthermore, this DLL only wraps *some* of the SQLite functions (the ones that I felt would most commonly be used), and not all of them. If you need some of the more advanced functionality, I've provided the source of the dll so you can add them in and compile it yourself, or whatever floats your boat.
Notice, all files are free to modify and redistribute as you see fit.
hat.c - the C source code, in case you're interested
hat.dll - the dll that you include with your GM game (includes the wrapper and SQLite itself, which is why it's so large. It compresses well, but sadly you can't really use a compressed dll without decompressing it first)
hat.gm6 - a game maker editable to demonstrate *SOME* of the functionality of the dll
hat.txt - documentation on *all* of the functions provided by this dll
Don't ask me why it's called "hat", I really don't know. If you don't like the name, feel free to change it to anything else. I just couldn't call it GMSQLite because that's already taken.
The file is 185 KB, and almost all of that is the dll. As mentioned above, it's so large because SQLite itself (in the dll) is quite large.
Just call me IsmAvatar. You might also put in a little note, like "SQLite dll" or something. You don't need to ask me if/how you can credit me, and I don't really care what you use this in. Once you've downloaded it, it is *your* copy and you can do with it what *you* want. If you really want to "pay me your respects", I don't accept donations, but you can either help improve this dll, or come visit me at my primary project, LateralGM (link in sig).
Question: That file is huge! Why should I use this when I could just code my own pseudo-database in GM?
Answer: That's completely up to you to decide. In many cases, it really is a better idea to just code your own using file functions or what not - and usually it's faster since you don't have to go through the dll and the SQLite interface (which needs to parse your SQL commands). However, as your data set gets larger and harder to handle, and especially as you get more data that links to other data, it becomes harder and harder to code it, that is when you would consider using sqlite. When your data set gets really large, like thousands of entries or such, you should definately consider upgrading to MySQL or another database program.
Database? Aren't those expensive?
On the contrary, MySQL, SQLite, and this dll are all FREE. Not only are they free of charge, they're also open source so you can see how they work, modify the source code, and redistribute as you see fit! However, big companies like Microsoft and Oracle like to charge lots of money (like thousands) and they don't even give you the source code, nor let you modify it, nor redistribute it (unless you pay extra for a license that allows it). On the positive side, though, when you pay that kind of money, you get great tech support, and probably a lifetime guarantee that the program won't break.
Can I mirror this?
I'm not going to stop you, but I'm also probably not going to post a link to your mirror in this post. My host is perfectly fine as it is.
Some users have contributed scripts and examples to help with this dll. Here are the posts;
GML Scripts for the DLL by ari_aaron
Example with 'less complex way' to define dlls and call the functions (includes "SQLite Database Browser") by Sindarin
A programmer friendly coding of "looking up" by ChIkEn AtE mY dOnUtS
DackR's modifications and extension - Renamed functions to better names, and provides an extension, free to modify/use, thanks to DackR (direct download link)
Edited by IsmAvatar, 31 May 2011 - 02:59 AM.