rfc:pdo_driver_specific_subclasses
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:pdo_driver_specific_subclasses [2023/06/13 16:11] – danack | rfc:pdo_driver_specific_subclasses [2024/02/12 14:24] (current) – derick | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2022-06-20 | * Date: 2022-06-20 | ||
* Author: Danack | * Author: Danack | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
+ | * Target: PHP 8.4 | ||
Line 45: | Line 46: | ||
<code php> | <code php> | ||
- | class PDOMySql | + | class PdoMySql |
{ | { | ||
public function getWarningCount(): | public function getWarningCount(): | ||
Line 136: | Line 137: | ||
* @cname SQLITE_DETERMINISTIC | * @cname SQLITE_DETERMINISTIC | ||
*/ | */ | ||
- | public const SQLITE_DETERMINISTIC | + | public const DETERMINISTIC |
/** | /** | ||
Line 142: | Line 143: | ||
* @cname SQLITE_ATTR_OPEN_FLAGS | * @cname SQLITE_ATTR_OPEN_FLAGS | ||
*/ | */ | ||
- | public const SQLITE_ATTR_OPEN_FLAGS | + | public const ATTR_OPEN_FLAGS |
/** | /** | ||
Line 148: | Line 149: | ||
* @cname SQLITE_OPEN_READONLY | * @cname SQLITE_OPEN_READONLY | ||
*/ | */ | ||
- | public const SQLITE_OPEN_READONLY | + | public const OPEN_READONLY |
/** | /** | ||
Line 154: | Line 155: | ||
* @cname SQLITE_OPEN_READWRITE | * @cname SQLITE_OPEN_READWRITE | ||
*/ | */ | ||
- | public const SQLITE_OPEN_READWRITE | + | public const OPEN_READWRITE |
/** | /** | ||
Line 160: | Line 161: | ||
* @cname SQLITE_OPEN_CREATE | * @cname SQLITE_OPEN_CREATE | ||
*/ | */ | ||
- | public const SQLITE_OPEN_CREATE | + | public const OPEN_CREATE |
/** | /** | ||
Line 166: | Line 167: | ||
* @cname SQLITE_ATTR_READONLY_STATEMENT | * @cname SQLITE_ATTR_READONLY_STATEMENT | ||
*/ | */ | ||
- | public const SQLITE_ATTR_READONLY_STATEMENT | + | public const ATTR_READONLY_STATEMENT |
/** | /** | ||
Line 172: | Line 173: | ||
* @cname | * @cname | ||
*/ | */ | ||
- | public const SQLITE_ATTR_EXTENDED_RESULT_CODES | + | public const ATTR_EXTENDED_RESULT_CODES |
// Registers an aggregating User Defined Function for use in SQL statements | // Registers an aggregating User Defined Function for use in SQL statements | ||
Line 203: | Line 204: | ||
int $rowid, | int $rowid, | ||
?string $dbname = " | ?string $dbname = " | ||
- | int $flags = PdoSqlite::SQLITE_OPEN_READONLY | + | int $flags = PdoSqlite::OPEN_READONLY |
): mixed /* resource|false */ {} | ): mixed /* resource|false */ {} | ||
} | } | ||
Line 209: | Line 210: | ||
- | Although there may be DB specific functionality that could be exposed for the other database types that PDO support, this RFC does not intend to expose them. | + | Although there may be DB specific functionality that could be exposed for the other database types that PDO supports, this RFC does not intend to expose them. |
==== Add a way of creating them through PDO static factory method ==== | ==== Add a way of creating them through PDO static factory method ==== | ||
Line 241: | Line 242: | ||
The code will throw an exception if the type of database being connected to isn't of the correct type for the class. | The code will throw an exception if the type of database being connected to isn't of the correct type for the class. | ||
+ | |||
+ | ==== Sqlite Extension directory ini setting ==== | ||
+ | |||
+ | The Sqlite3 extension requires users to set an ini setting to allow SQLite extensions to be loaded, presumably from a desire to keep things ' | ||
+ | |||
+ | Additionally, | ||
+ | |||
+ | <code c> | ||
+ | sqlite3_db_config(db, | ||
+ | </ | ||
+ | |||
+ | is used to temporarily enable extension loading, before loading the extension, which only enables it through the C api, whereas the Sqlite3 extension uses the code: | ||
+ | |||
+ | <code c> | ||
+ | sqlite3_enable_load_extension(sqlite_handle, | ||
+ | </ | ||
+ | |||
+ | which affects both the C api and loading extensions through SQL code. | ||
Line 263: | Line 282: | ||
These are the known current issues. | These are the known current issues. | ||
- | ==== Sqlite Extension directory ini setting ==== | ||
- | The Sqlite3 extension requires users to set an ini setting to allow SQLite extensions to be loaded, presumably from a desire to keep things ' | + | ===== Unaffected |
- | TODO - check whether an absolute path is needed. | + | Everything not PDO |
- | ==== When to deprecate old function on PDO ==== | + | ===== Frequently asked questions ===== |
- | The method | + | ==== if someone does ' |
- | * 8.3 - PDO subclassses become available | + | No. |
- | * 9.0 - calls to PDO:: | + | |
- | * 10.0 - driver specific methods and constants on PDO are removed, and that functionality can only be accessed through the driver specific class. | + | |
- | Removing the methods that magically exist or not depending on the specific driver created would save some complication in the PDO code. So although there' | + | ===== Future Scope ===== |
+ | ==== When to deprecate old function on PDO ==== | ||
- | ===== Unaffected PHP Functionality ===== | + | The method PDO:: |
- | Everything | + | Removing the methods that magically exist or not depending on the specific driver created would save some complication in the PDO code. So although there' |
+ | |||
+ | Choosing the version for them to be deprecated in can be left until the future. | ||
- | ===== Future Scope ===== | ||
==== Quoting identifiers ==== | ==== Quoting identifiers ==== | ||
Line 312: | Line 330: | ||
Accept the RFC or not. | Accept the RFC or not. | ||
- | ===== Patches and Tests ===== | + | <doodle title="PDO driver specific subclasses" |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
- | WIP code https:// | + | Voting closes at 2023-07-17T17: |
+ | ===== Patches and Tests ===== | ||
+ | |||
+ | https:// | ||
+ | https:// | ||
===== Implementation ===== | ===== Implementation ===== | ||
- | After the project is implemented, | + | |
- | - the version(s) it was merged into | + | Implemented for PHP 8.4 (https:// |
- | | + | |
- | - a link to the PHP manual entry for the feature | + | |
- | - a link to the language specification section (if any) | + | |
===== References ===== | ===== References ===== | ||
- | A proprosal | + | A proposal |
===== 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/pdo_driver_specific_subclasses.1686672687.txt.gz · Last modified: 2023/06/13 16:11 by danack