Skip to content

Update SQLite Database Integration to v3.0.0-rc.1 - #3172

Merged
wojtekn merged 3 commits into
trunkfrom
update-sqlite-database-integration-v3.0.0
Apr 23, 2026
Merged

Update SQLite Database Integration to v3.0.0-rc.1#3172
wojtekn merged 3 commits into
trunkfrom
update-sqlite-database-integration-v3.0.0

Conversation

@wojtekn

@wojtekn wojtekn commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude Code identified and applied all changes.

Proposed Changes

  • Bump SQLITE_DATABASE_INTEGRATION_VERSION from v2.2.23 to v3.0.0-rc.1
  • Remove WP_SQLITE_AST_DRIVER: true from defaultConstants in wordpress-server-child.ts
  • Remove php.defineConstant('WP_SQLITE_AST_DRIVER', true) from run-wp-cli-command.ts
  • Define DB_NAME: 'wordpress' at runtime in both wordpress-server-child.ts and run-wp-cli-command.ts

The WP_SQLITE_AST_DRIVER constant was a feature flag enabling the new AST-based driver in earlier versions. Starting with v3.0.0, the old driver has been removed and the flag is no longer needed.

SQLite v3.0.0 also removed the fallback for a missing DB_NAME — it now requires a non-empty value at runtime or it bails with "Error establishing a database connection". Studio strips the default MySQL constants (including DB_NAME) from wp-config.php after site creation, which previously worked because v2 had a 'database_name_here' fallback. We fix this by explicitly defining DB_NAME: 'wordpress' as a runtime constant (the same value Playground's ensureWpConfig would set), so sites where DB_NAME was stripped still work correctly.

Testing Instructions

  • Create a new local site and verify it starts correctly on first launch (no "Error establishing a database connection")
  • Restart an existing site and verify it still works
  • Run a WP-CLI command (e.g. wp option get siteurl) and confirm it works

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@wojtekn wojtekn self-assigned this Apr 21, 2026
@wpmobilebot

wpmobilebot commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 81e21a4 vs trunk

app-size

Metric trunk 81e21a4 Diff Change
App Size (Mac) 1482.75 MB 1492.66 MB +9.91 MB 🔴 0.7%

site-editor

Metric trunk 81e21a4 Diff Change
load 1924 ms 1847 ms 77 ms 🟢 -4.0%

site-startup

Metric trunk 81e21a4 Diff Change
siteCreation 8100 ms 10139 ms +2039 ms 🔴 25.2%
siteStartup 4948 ms 5932 ms +984 ms 🔴 19.9%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@wojtekn
wojtekn requested a review from a team April 22, 2026 12:06

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Existing sites were updated. New version doesn't have a version.php but the new version can be found in readme.txt
I tried starting existing sites, creating new ones, creating preview sites and authenticating and pushing a new site. Everything worked smoothly.

Screenshot 2026-04-23 at 14 01 08
@wojtekn

wojtekn commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @sejas !

The version.php which defines the constant is still there, in wp-includes/database/ and it defines the correct version. When I dump SQLITE_DRIVER_VERSION constant in wp-config.php, I see:

string(10) "3.0.0-rc.1"

But it uncovers another issue - when Studio copies the SQLite plugin to the site directory, it doesn't remove the existing files, so after each update, the directory contains not only new files, but old ones, too.

@wojtekn

wojtekn commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

@sejas I fixed the mentioned issue: 81e21a4

@wojtekn
wojtekn merged commit e56ee04 into trunk Apr 23, 2026
10 checks passed
@wojtekn
wojtekn deleted the update-sqlite-database-integration-v3.0.0 branch April 23, 2026 14:02

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing it! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants