rfc:implement_sqlite_openblob_in_pdo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:implement_sqlite_openblob_in_pdo [2017/09/22 13:28] – external edit 127.0.0.1rfc:implement_sqlite_openblob_in_pdo [2017/11/01 19:37] bohwaz
Line 4: Line 4:
   * Date: 2017-09-19   * Date: 2017-09-19
   * Author: bohwaz   * Author: bohwaz
-  * Status: Draft+  * Status: Rejected
   * First Published at: http://wiki.php.net/rfc/implement_sqlite_openblob_in_pdo   * First Published at: http://wiki.php.net/rfc/implement_sqlite_openblob_in_pdo
  
Line 29: Line 29:
 This is following what already exists in PDO, examples: This is following what already exists in PDO, examples:
  
-  * Creating a LOB in Postgre: [[https://secure.php.net/manual/en/pdo.pgsqllobcreate.php|PDO::pgsqlLOBCreate]]+  * Creating a LOB (Large Object) in PostgreSQL: [[https://secure.php.net/manual/en/pdo.pgsqllobcreate.php|PDO::pgsqlLOBCreate]]
   * Creating a function in SQLite: [[https://secure.php.net/manual/en/pdo.sqlitecreatefunction.php|PDO::sqliteCreateFunction]]   * Creating a function in SQLite: [[https://secure.php.net/manual/en/pdo.sqlitecreatefunction.php|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.
 +
 +=== Why not just use PDO LOBs support via PDO::bindColumn and PDO::bindParam? ===
 +
 +For reference: [[http://www.php.net/manual/en/pdo.lobs.php]]
 +
 +As this was discussed on internals, the PDO LOB support is for accessing LOB using SQL queries, //openBlob// is for accessing LOBs directly. This is a very fast and efficient way of using SQLite as a blob store, which can't be done if going through SQL queries as traditional PDO::PARAM_LOB support is doing. Furthermore, //openBlob// allows to both read and write in a blob at the same time. And finally the current code handling LOBs in PDO via bindParam and bindColumn is broken, it is returning a string (with MySQL and SQLite, but not PostgreSQL) instead of a resource file pointer. I will try to spend time fixing that in the coming months.
 +
 +In conclusion this new method and the existing PDO LOB support provide different features for different needs, and both are useful.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 38: Line 48:
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
  
-Next PHP 7.x+PHP 7.3
  
 ===== RFC Impact ===== ===== RFC Impact =====
Line 75: Line 85:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
  
-This proposal requires a 50%+1 majority.+This proposal requires a 50%+1 majority. Vote closing on Oct 27, 2017.
  
 <doodle title="Implement sqliteOpenBlob in PDO?" voteType="single" closed="true"> <doodle title="Implement sqliteOpenBlob in PDO?" voteType="single" closed="true">
Line 96: Line 106:
 ===== References ===== ===== References =====
  
 +  * [[https://externals.io/message/100773|Internals RFC discussion]]
   * [[https://externals.io/message/100268|Internals original discussion]]   * [[https://externals.io/message/100268|Internals original discussion]]
  
 ===== Rejected Features ===== ===== Rejected Features =====
 Keep this updated with features that were discussed on the mail lists. Keep this updated with features that were discussed on the mail lists.
rfc/implement_sqlite_openblob_in_pdo.txt · Last modified: 2020/08/01 23:50 by carusogabriel