SQLite compatibility
SMF 2.0 is only supports officially SQLite 2.8. SQLite 3.x is backwards incompatible (or not guaranteed) with 2.x. The standard PHP driver for SQLite 3.x is the PDO driver. Which SMF 2.0 database layer does not support.
So the question is: are we going to implement SQLite 3.x support for 2.1, or just fix 2.8? My previous answer: support 3.x in any next version of SMF.
Notes: 2.x is extremely outdated. (this is an understatement) 3.x is almost certainly on the hosts supporting SQLite. Once a database is migrated to 3.x, one cannot go back. They both can be installed in parallel and work side by side on a server. SQLite has designed its 3.x so that it has different functions to create/open/work with a database, to enable that. SMF uses the SQLite 2 functions, i.e. install.php first lines: sqlite_open() http://www.php.net/manual/en/function.sqlite-open.php
(PHP 5 < 5.4.0, PECL sqlite >= 1.0.0) This function only support database of SQLite 2 or below. For SQLite 3, you must use PDO.
Ref: http://www.php.net/manual/en/sqlite.installation.php
Hummm ... no comments ... I would have thought the 2 people using sqlite would have chimed in :D ....
Yes it should be moved to 3/PDO however I don't think its worth the effort to make the change for such a seldom used feature. Also given is scant usage, testing it will take forever ... really we are still finding postgre and sqlite errors from the early days of 2.0 which is all about test coverage and real life usage.
IMO in 3.0 I would drop support for all but MySQL, this was a nice experiment but the gain vs the effort or development and support is just not worth it. If thats not possible, maybe move on to a more robust abstraction layer, or maybe you have!
The database abstraction at the time was a nice shiny new object. Everyone thought it was the coolest things since sliced bread. After seeing how little it's been used and how much trouble it's been to fix and support, I'd agree at this point to let it go the way of the wind. Would be better if we just left it abstract enough that someone else can plug into it if they so desire. Off with it's head!
Instead of dropping support for database engines, we should be supporting them through PDO.
We also need to get rid of this horrible abstraction layer and use something more standard. I don't care if it's our own or if we use a well-established code base, but the regex-based replacement stuff we have now is crazy, IMO.
That sounds great for SMF3.0 :)
but let's not drop support for it in the meantime. This looks terrible:
- SMF < 2.0: No
- SMF 2.0: Yes
- SMF 2.1 - 3.0: No
- SMF 3.0+: Yes
Support SQLite 2.x is probably completely useless.
I have finally setup a VM with (hopefully, I still don't know if it works) SQLite 3. I'll try to work on it, but don't know if I'll be able to do anything.
nend has worked lately with these drivers on SMF 2.0, and may be interested in the issue.
/cc @sicommnend
IMHO PHP's implementation of SqLite 3 isn't all that great. Also on PDO, you can use a SqLite DB but be warned, you may be using either SqLite 2 or 3 depending on how the server is set up. So with PDO your not going to be guaranteed use of the most current version of SqLite on the server.
Here is what I use for SqLite 3 as I can't use PDO because on my shared host it uses SqLite 2. http://php.net/manual/en/book.sqlite3.php
What host is it, and what version(s) of PHP does it have?
This particular Sqlite3 extension is PHP 5.3.0+ only, SMF 2.1 minimum required PHP version is 5.1.0.
PHP 5.3.6 and the host is GoDaddy.
PDO drivers mysql, sqlite, sqlite2 PDO Driver for MySQL 5.0.77 PDO Driver for SQLite 3.x 3.7.4
Strange though shows SqLite 3, might have to check it out once again, I swear it used to use SqLite 2.
Before we drop support for Postgres and SQLite 2.x we need to find out how many people are actually using them. If they're being used, we shouldn't drop support for them or it will irk those who are using them.
As I said before, it looks really bad to not support something, then support it, then drop support again.
I don't think we need to remove anything of what we have at the moment. We just need a bit of testing. For sure on postgre because I'm pretty sure it's buggy, at least the upgrade, probably the installer too...or it wat SQLite that was buggy?...or both? Don't remember any more.
To those that know more about SQLite (I'm almost completely ignorant about it): would be possible (and if so how difficult would be) to install SMF with the current SQLite 2 implementation and then switch to SQLite 3 for example with a mod?
SQLite 2 is compatible with SQLite 3 in that order. However a SQLite 3 database will not work with SQLite 2. So basically once you are upgraded there is no going back.
You know I haven't done a database upgrade though, I know there where major changes in version 3 mainly with the formatting of the file. I think in the middle though you will have to have a conversion script to upgrade or downgrade because the database file contains the version. I haven't tried yet though but I believe SQLite will emulate the version that is in the db file.
http://www.sqlite.org/version3.html
Here is a overview of changes. May be simpler to support both and give the option on install, because if this is done with a mod and the user uninstalls the mod then this may cause allot of headaches.
But basically the document is saying they are incompatible both ways. So in order to upgrade you will have to dump the database then reinsert the data in the version your upgrading or downgrading from.
So, even if we'd be able to support 3.x in SMF 2.1 we couldn't drop the support for 2.8 unless we create a converter before.
/me thinks SQLite 3.x is for SMF 3.0.
Small bump to point those interested to tinoest job: http://www.simplemachines.org/community/index.php?topic=483878.0
We can continue support for SQLite 2.8 and 3.0 both. We simply name a new database abstraction file that uses sqlite3 specifically. This is better as it allows 2.8 to be used and for 3.0 to be implanted and migrated over properly. Having us try to migrate it seems like a troublesome task.