Skip to content

Commit 8f62983

Browse files
committed
Remove legacy SQLite driver wrapper
Migrate the WordPress integration, MySQL proxy, tools, and tests to the PDO-style driver constructor and statement API.
1 parent 11c2143 commit 8f62983

14 files changed

Lines changed: 402 additions & 623 deletions

‎packages/mysql-on-sqlite/src/load.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
}
3636
require_once __DIR__ . '/sqlite/class-wp-sqlite-connection.php';
3737
require_once __DIR__ . '/sqlite/class-wp-sqlite-configurator.php';
38-
require_once __DIR__ . '/sqlite/class-wp-sqlite-driver.php';
3938
require_once __DIR__ . '/sqlite/class-wp-sqlite-driver-exception.php';
4039
require_once __DIR__ . '/sqlite/class-wp-sqlite-information-schema-builder.php';
4140
require_once __DIR__ . '/sqlite/class-wp-sqlite-information-schema-exception.php';

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4211,7 +4211,7 @@ private function translate_query_expression( WP_Parser_Node $node ): string {
42114211
* When the ORDER BY clause is present, we need to disambiguate the item
42124212
* list and make sure they don't cause an "ambiguous column name" error.
42134213
*
4214-
* @see WP_SQLite_Driver::disambiguate_item()
4214+
* @see WP_PDO_MySQL_On_SQLite::disambiguate_item()
42154215
*/
42164216
$disambiguated_order_list = array();
42174217
$order_clause = $node->get_first_child_node( 'orderClause' );
@@ -4279,7 +4279,7 @@ private function translate_query_specification( WP_Parser_Node $node ): string {
42794279
* When the GROUP BY or HAVING clause is present, we need to disambiguate
42804280
* the items to ensure they don't cause an "ambiguous column name" error.
42814281
*
4282-
* @see WP_SQLite_Driver::disambiguate_item()
4282+
* @see WP_PDO_MySQL_On_SQLite::disambiguate_item()
42834283
*/
42844284
$group_by_clause = null;
42854285
$having_clause = null;
@@ -5788,7 +5788,7 @@ private function unnest_parenthesized_expression( WP_Parser_Node $node ): WP_Par
57885788
* consider column references in forms like "db.table.column".
57895789
*
57905790
* @param array $disambiguation_map The SELECT item disambiguation map (column name => array of select items).
5791-
* @see WP_SQLite_Driver::create_select_item_disambiguation_map()
5791+
* @see WP_PDO_MySQL_On_SQLite::create_select_item_disambiguation_map()
57925792
* @param WP_Parser_Node $expr The expression AST node or subnode.
57935793
* @return string|null The disambiguated and translated expression;
57945794
* null when the expression cannot be disambiguated.
@@ -5827,7 +5827,7 @@ private function disambiguate_item( array $disambiguation_map, WP_Parser_Node $e
58275827
* Create a SELECT item disambiguation map from a SELECT item list for use
58285828
* with the ORDER BY, GROUP BY, and HAVING clause disambiguation algorithm.
58295829
*
5830-
* @see WP_SQLite_Driver::disambiguate_item()
5830+
* @see WP_PDO_MySQL_On_SQLite::disambiguate_item()
58315831
*
58325832
* @param WP_Parser_Node $select_item_list The "selectItemList" AST node.
58335833
* @return array The SELECT item disambiguation map (column name => array of select items).

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

Lines changed: 0 additions & 280 deletions
This file was deleted.

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,13 @@ public function testExplicitJournalModeSurfacesFailureWhenWalIsUnavailable(): vo
179179
}
180180

181181
public function testDriverKeepsConfiguredJournalMode(): void {
182-
$connection = new WP_SQLite_Connection(
183-
array(
184-
'path' => $this->db_path,
185-
'journal_mode' => 'DELETE',
186-
)
182+
$driver = new WP_PDO_MySQL_On_SQLite(
183+
sprintf( 'mysql-on-sqlite:path=%s;dbname=wp', $this->db_path ),
184+
null,
185+
null,
186+
array( 'journal_mode' => 'DELETE' )
187187
);
188188

189-
$driver = new WP_SQLite_Driver( $connection, 'wp' );
190-
191189
$this->assertSame( 'delete', $this->get_journal_mode( $driver->get_connection() ) );
192190
}
193191

0 commit comments

Comments
 (0)