Skip to content

Commit c1dabce

Browse files
committed
Deprecate the legacy driver facade
Document WP_SQLite_Driver as deprecated in 3.0 with WP_MySQL_On_SQLite as its replacement.
1 parent 4d3b0af commit c1dabce

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎packages/mysql-on-sqlite/src/sqlite/class-wp-sqlite-driver.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*
1818
* This class temporarily preserves the legacy constructor and result API while
1919
* consumers transition to the PDO-based WP_MySQL_On_SQLite API.
20+
*
21+
* @deprecated 3.0.0 Use WP_MySQL_On_SQLite instead.
2022
*/
2123
class WP_SQLite_Driver {
2224
/**
@@ -54,8 +56,9 @@ class WP_SQLite_Driver {
5456
*
5557
* Set up an SQLite connection and the MySQL-on-SQLite driver.
5658
*
57-
* @param WP_SQLite_Connection $connection A SQLite database connection.
58-
* @param string $database The database name.
59+
* @param WP_SQLite_Connection $connection A SQLite database connection.
60+
* @param string $database The database name.
61+
* @param int $mysql_version The emulated MySQL version as an integer.
5962
*
6063
* @throws WP_SQLite_Driver_Exception When the driver initialization fails.
6164
*/

‎packages/mysql-on-sqlite/tests/WP_SQLite_Driver_Compatibility_Tests.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ function () {
3535
$this->assertTrue( $this->driver->is_sql_mode_active( 'STRICT_TRANS_TABLES' ) );
3636
}
3737

38+
public function test_is_formally_deprecated(): void {
39+
$doc_comment = ( new ReflectionClass( WP_SQLite_Driver::class ) )->getDocComment();
40+
41+
$this->assertStringContainsString( '@deprecated 3.0.0 Use WP_MySQL_On_SQLite instead.', $doc_comment );
42+
}
43+
3844
public function test_preserves_legacy_query_results(): void {
3945
$this->assertSame( 1, $this->driver->query( "INSERT INTO t (value) VALUES ('first')" ) );
4046
$this->assertSame( 1, $this->driver->get_insert_id() );

0 commit comments

Comments
 (0)