diff --git a/src/constants.ts b/src/constants.ts index b992ec6104..62fd9e3091 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -67,9 +67,9 @@ export const WP_CLI_IMPORT_EXPORT_RESPONSE_TIMEOUT = WP_CLI_IMPORT_EXPORT_RESPONSE_TIMEOUT_IN_HRS * 60 * 60 * 1000; // 6hr // SQLite -export const SQLITE_DATABASE_INTEGRATION_VERSION = 'v2.1.17-alpha.1'; +export const SQLITE_DATABASE_INTEGRATION_VERSION = 'v2.2.3'; -export const SQLITE_DATABASE_INTEGRATION_RELEASE_URL = `https://github.com/Automattic/sqlite-database-integration/archive/refs/tags/${ SQLITE_DATABASE_INTEGRATION_VERSION }.zip`; +export const SQLITE_DATABASE_INTEGRATION_RELEASE_URL = `https://github.com/WordPress/sqlite-database-integration/archive/refs/tags/${ SQLITE_DATABASE_INTEGRATION_VERSION }.zip`; // IPC handlers that don't return anything (i.e. that are called with `ipcRenderer.send`) export const IPC_VOID_HANDLERS = < const >[ diff --git a/src/lib/import-export/export/export-database.ts b/src/lib/import-export/export/export-database.ts index 13b5a3ce8e..486074b26d 100644 --- a/src/lib/import-export/export/export-database.ts +++ b/src/lib/import-export/export/export-database.ts @@ -18,7 +18,7 @@ export async function exportDatabaseToFile( // Execute the command to export directly to the temp file const { stderr, exitCode } = await server.executeWpCliCommand( - `sqlite export ${ tempFileName } --require=/tmp/sqlite-command/command.php`, + `sqlite export ${ tempFileName } --require=/tmp/sqlite-command/command.php --enable-ast-driver`, { skipPluginsAndThemes: true, } @@ -50,7 +50,7 @@ export async function exportDatabaseToMultipleFiles( } const tablesResult = await server.executeWpCliCommand( - `sqlite tables --format=json --require=/tmp/sqlite-command/command.php`, + `sqlite tables --format=json --require=/tmp/sqlite-command/command.php --enable-ast-driver`, { skipPluginsAndThemes: true, } @@ -85,7 +85,7 @@ export async function exportDatabaseToMultipleFiles( // Execute the command to export directly to a temporary file in the project directory const { stderr, exitCode } = await server.executeWpCliCommand( - `sqlite export ${ fileName } --tables=${ table } --require=/tmp/sqlite-command/command.php`, + `sqlite export ${ fileName } --tables=${ table } --require=/tmp/sqlite-command/command.php --enable-ast-driver`, { skipPluginsAndThemes: true, } diff --git a/src/lib/import-export/import/importers/importer.ts b/src/lib/import-export/import/importers/importer.ts index 4498d6f203..55a9be0b08 100644 --- a/src/lib/import-export/import/importers/importer.ts +++ b/src/lib/import-export/import/importers/importer.ts @@ -59,7 +59,7 @@ abstract class BaseImporter extends EventEmitter implements Importer { await move( sqlFile, tmpPath ); await this.prepareSqlFile( tmpPath ); const { stderr, exitCode } = await server.executeWpCliCommand( - `sqlite import ${ sqlTempFile } --require=/tmp/sqlite-command/command.php`, + `sqlite import ${ sqlTempFile } --require=/tmp/sqlite-command/command.php --enable-ast-driver`, // SQLite plugin requires PHP 8+ { targetPhpVersion: DEFAULT_PHP_VERSION, skipPluginsAndThemes: true } ); diff --git a/src/lib/import-export/tests/export/exporters/sql-exporter.test.ts b/src/lib/import-export/tests/export/exporters/sql-exporter.test.ts index 803a715874..c416c7b795 100644 --- a/src/lib/import-export/tests/export/exporters/sql-exporter.test.ts +++ b/src/lib/import-export/tests/export/exporters/sql-exporter.test.ts @@ -62,7 +62,7 @@ platformTestSuite( 'SqlExporter', ( { normalize } ) => { const siteServer = SiteServer.get( '123' ); expect( siteServer?.executeWpCliCommand ).toHaveBeenCalledWith( - 'sqlite export studio-backup-db-export-2024-08-01-12-00-00.sql --require=/tmp/sqlite-command/command.php', + 'sqlite export studio-backup-db-export-2024-08-01-12-00-00.sql --require=/tmp/sqlite-command/command.php --enable-ast-driver', { skipPluginsAndThemes: true } ); } ); diff --git a/src/lib/import-export/tests/import/importer/jetpack-importer.test.ts b/src/lib/import-export/tests/import/importer/jetpack-importer.test.ts index ea6ee931af..137d94dce1 100644 --- a/src/lib/import-export/tests/import/importer/jetpack-importer.test.ts +++ b/src/lib/import-export/tests/import/importer/jetpack-importer.test.ts @@ -84,7 +84,7 @@ platformTestSuite( 'JetpackImporter', ( { normalize } ) => { const siteServer = SiteServer.get( mockStudioSiteId ); const expectedCommand = - 'sqlite import studio-backup-sql-2024-08-01-12-00-00.sql --require=/tmp/sqlite-command/command.php'; + 'sqlite import studio-backup-sql-2024-08-01-12-00-00.sql --require=/tmp/sqlite-command/command.php --enable-ast-driver'; expect( siteServer?.executeWpCliCommand ).toHaveBeenNthCalledWith( 1, expectedCommand, { targetPhpVersion: '8.3', skipPluginsAndThemes: true, diff --git a/vendor/wp-now/src/wp-now.ts b/vendor/wp-now/src/wp-now.ts index 4f93c3c47e..802b6658a4 100644 --- a/vendor/wp-now/src/wp-now.ts +++ b/vendor/wp-now/src/wp-now.ts @@ -380,7 +380,9 @@ async function initWordPress( php: PHP, wordPressVersion: string, vfsDocumentRoo initializeDefaultDatabase = true; } - const wpConfigConsts = {}; + const wpConfigConsts = { + WP_SQLITE_AST_DRIVER: true, + }; if ( wordPressVersion !== 'user-provided' ) { wpConfigConsts[ 'WP_AUTO_UPDATE_CORE' ] = wordPressVersion === 'latest';