The “SQLite” driver of PDO is missing some features provided by the “SQLite3” extension, namely “openBlob” which allows to access a stored blob as a stream/file pointer.

As discussed on internals the SQLite driver of PDO is missing some features that are present in the SQLite3 extension.

One of those features has already been proposed and merged: Add support for SQLite open flags.

A second one has been proposed and is awaiting merging: Implement sqlite_stmt_readonly in PDO

But we are still missing this feature: SQLite3::openBlob: opening blobs for reading and writing as streams.

This would be implemented following the current practice of adding a driver-specific method:

PDO::sqliteOpenBlob(string $table , string $column , int $rowid [, string $dbname = “main” [, int $flags = PDO::SQLITE_OPEN_READONLY ]] )

This would return a resource file pointer. This would match exactly the behaviour of SQLite3::openBlob.

This is following what already exists in PDO, examples:

Creating a LOB (Large Object) in PostgreSQL: PDO::pgsqlLOBCreate

Creating a function in SQLite: PDO::sqliteCreateFunction

These driver-specific methods are only defined when instantiating PDO with the right driver, trying to call them with another driver results in an error due to calling an undefined method.