PHP5 is currently in beta.

One of the features when PHP5 comes out, is that it will have its own embedded database, which is really SQLite repackaged.

This will have an impact on web hosting companies, since administring multiple SQLite databases, is far easier than a single MySQL database. The database files can be stored in the user's home directory, and the user can create as many databases as they want (subject to disk space quote of course).

Moving web sites from one machine to another will be very easy, just tar/zip the entire home directory and copy it to the other machine. No export/import, no user permissions, nothing.

For applications like Drupal, the application can be configured in a way, where if the database is not found, it will create it automatically, and we are in business! Lessens the setup time required, no command line (mysqladmin/mysql) nor third party tools required (e.g. phpmyadmin)

My question is: will Drupal support SQLite as a database option in the future?

Comments

ti’s picture

To quote Dries, Drupal's goal is to "continue to aim for ANSI SQL compliance."

jherek’s picture

That wouldn't seem to be an obstacle. SQLite uses an ANSI SQL subset, so Drupal can work with SQLite and still remain ANSI SQL compliant.

Steven’s picture

Looking over the thigns that SQLite doesn't do, I spot two problems:

- No support for ALTER TABLE. This will make upgrading between Drupal versions very difficult.
- No support for SELECT COUNT(DISTINCT x) which is used in Drupal. Though the docs say you can do the same with a subquery, maybe some clever rewriting of queries could solve this.

In any case, adding new database support to Drupal is not that hard because we have a generic database layer (see database.inc). You can make a database.sqlite.inc for SQLite support, if you can get around the problems I mentioned.

lapurd’s picture

SQL features that SQLite does not implement: http://sqlite.org/omitted.html

ALTER TABLE - To change a table you have to delete it (saving its contents to a temporary table) and recreate it from scratch.

The COUNT(DISTINCT X) function - You can accomplish the same thing using a subquery, like this: SELECT count(x) FROM (SELECT DISTINCT x FROM tbl);

markc’s picture

I totally agree with your PHP5+SQLite observations and would like to pursue some code path along these lines, particularly for multi-hosting off a single codebase. Are you, or anyone, aware of any progress along these lines, or any PHP5+SQLite subprojects based on Drupal elsewhere ?

chx’s picture

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

harry slaughter’s picture

i was thinking about doing an sqlite driver, but i guess i'm too late :)

i thought that there would be great demand for such a thing among ISP users that don't have access to mysql or don't want to have to bother with it.

why did this effort not result in 'drupal now supports sqlite'?

--
Living in fear of patch hell?
Want a stable development environment?
Support Dev Releases: http://drupal.org/node/30903
Support Code cleanup too: http://drupal.org/node/28540

--
Devbee - http://devbee.net/