Kia ora,
As some of you may or may not know, I've been working on improving the
state of SQLite support in PHP on my free time in the last few years:
https://github.com/php/php-src/pulls?utf8=%E2%9C%93&q=author%3Abohwaz
The last one was adding a userland authorizer callback, which should be
quite useful to reduce security issues with SQL statements :)
I've done a past RFC on getting some of SQLite features in PDO but it
didn't get a great success:
https://wiki.php.net/rfc/implement_sqlite_openblob_in_pdo
I'm coming back on that point: the relationship between SQLite and
PDO_SQLite, as I think it is important for moving forward.
What is not shown in my pull request history is that I also worked on
some other issues on which I gave up as my time and energy ran out and
I've come a number of times on issues that were only affecting one or
the other extension.
The current state of things is that the PDO_SQLite and SQLite3
extensions do differ on some points but are also very similar on
others. But the fact is that the code is completely different and for
every issue fixed in one, we also need to fix it in the other, or they
might have different issues. This is due to the fact that there are in
fact two implementations of the SQLite API in PHP. So twice the effort.
I don't think that's the best way forward.
I think that PDO_SQLite should get the same features as the SQLite3
extension, and the SQLite3 extension should be deprecated and
eventually removed and replaced by a userland library that would wrap
around the PDO_SQLite API. This means that the BC breaking should be
reduced to just installing a new composer package.
Ditching the SQLite3 extension would reduce the development efforts and
possible bugs I think. It would also make it easier for newcomers as
only one API will be available, without having to choose between the
two without knowing that some features will be available in one but not
the other.
Does that seem like a good idea to anyone else?
And if that's the way forward, how should I proceed to port SQLite3
features to PDO_SQLite and get that accepted?
Cheers,
BohwaZ
I think that PDO_SQLite should get the same features as the SQLite3
extension, and the SQLite3 extension should be deprecated and
eventually removed and replaced by a userland library that would wrap
around the PDO_SQLite API.
Hi BohwaZ,
Having only PDO_SQLite sounds good to me. Currently, it cannot be used to
load SQLite extensions https://bugs.php.net/bug.php?id=64810, so this is
one of the reasons one may have to stick with SQLite3.
If the PDO_SQLite features come on par with those of SQLite3, I personally
see no reason not to ditch SQLite3 eventually.
— Benjamin