SQLite module 0.1a

BlitzMax Forums/BlitzMax Programming/SQLite module 0.1a

teamonkey(Posted 2005) [#1]
Hi

It's not finished yet, but I promised myself it would be out the door this weekend.

http://www.tinyminions.co.uk/teamonkey/files/sqlite_max.zip

Yes, folks, it's a proper embedded SQL database in BlitzMax. I chose SQLite over the others for the following reasons:
* It doesn't require an external database daemon to be installed, configured and running in the background (so scratch MySQL and PostgreSQL)
* It's fast and small (as opposed to embedded MySQL, which isn't)
* It supports tables on disk
* It supports tables entirely in memory (read this: http://www.filipdewaard.com/archives/21_SQLite_inmemory_databases.html)
* It supports prepared/compiled statements
* It's threaded so it can do its I/O stuff in the background
* It's easy to integrate and comes with full source
* It's got a very permitting licence
* It's very easy to use

To install, extract the zip in your mods directory. If you've got Linux or a Mac you'll need to use makemods.

Here's an example on how to use it:


Be warned that a database query is pretty slow. Prepared statements are a big performance boost, as are memory tables, but they're still "slow" as far as a realtime game is concerned so try and keep your main loop queries to a minimum.

Be also warned that this is Alpha-level code. Any or all functions may not work for you and I haven't had time to test all the functions. If you find something that doesn't work, let me know at teamonkeyATteamonkeyDOTnet.

Enjoy :)


René(Posted 2006) [#2]
Hi teamonkey,

any chance to compile your sqlite mod with BMax 1.20.
As far as I remember I was not able to compile with 1.18. So I think it won't compile on 1.20 either.

Thanks in advance.


Dreamora(Posted 2006) [#3]
No it won't work ... it uses Ptr to variables which is deprecated since 1.18


assari(Posted 2006) [#4]
Rene, I've re-compiled teamonkey's module to 1.18. You can get it here. Seems to work OK with 1.20

I've also downloaded and recompiled the new sqlite version 3.3.5. You can download it here

Not that you need it but you can check out my sqlite3 tutorial http://www.blitzmax.com/Community/posts.php?topic=59000

@Dreamora, I think Mark has re-fixed the ptr problem