PHP5 and SQLite

Currently I’m working on SourDough Framework, my light opensource framework for web-applications written in PHP. It contains a database abstraction layer I started to work on together with Rocco Siegrist back in summer 2002. This part is already pretty mature. My upcoming applications PPhlogger3 (future version of PowerPhlogger), Pigalle (picture gallery) and Yabook (guestbook) are going to work on the following database systems: MySQL, PostgreSQL and Microsoft SQL Server 2k. I have already tested them on those systems. The DB abstraction layer should also support FrontBase, Interbase, and Sybase – but this hasn’t been tested yet.

Today I ran over SQLite. I didn’t really expect a lot of this «Embeddable SQL Database Engine», how they call it. It stores data into flat files and pretends to almost fully support SQL92.
I was interested about it and implemented another layer for SQLite in my framework. And, wow, it works! It didn’t take me more than 2 hours. Currently, YaBook already runs with SQLite as DBS. I didn’t encounter any serious problems. Well, it took me some time to realize that SQLite is typeless. Pretty funny, though.
Instead of AUTOINCREMENTs I had to use INTEGER PRIMARY KEY. Even indexes seem to work.
I haven’t done any performance testing yet, but for simple operations it should be fine. For an application like YaBook it might as well be faster than MySQL.

SQLite has been bundled with PHP5. Effectively this means that anybody, even users at share hosters with no access to their server, will be able to use SQL databases. Great!

Comments are closed