Skip to content

Conversation

@JanJakes
Copy link
Member

@JanJakes JanJakes commented Nov 21, 2025

Motivation for the change, related issues

Ships a Database panel with Adminer & phpMyAdmin:

Screen.Recording.2025-11-26.at.11.34.00.mov

Implementation details

  • The database management tools are downloaded and set up lazily, only when the relevant button is used. Internally, it's implemented via Blueprint steps.
  • Both Adminer and phpMyAdmin require some custom PHP wiring to the MySQL-on-SQLite driver.
  • Not all features are supported yet; e.g., multi-queries.
  • In phpMyAdmin, the row-editing controls are not displayed yet. This is because we compile SQLite without the SQLITE_ENABLE_COLUMN_METADATA flag, and phpMyAdmin cannot determine which columns are unique. To be fixed in a separate PR.

Testing Instructions (or ideally a Blueprint)

  1. Checkout this branch.
  2. Run npx nx dev playground-website.
  3. Go to http://127.0.0.1:5400/website-server/ and see it in action.

@JanJakes JanJakes force-pushed the adminer branch 2 times, most recently from ad80c72 to be73ee4 Compare November 26, 2025 10:33
@JanJakes JanJakes changed the title WIP Adminer & phpMyAdmin [Website] Database panel with Adminer & phpMyAdmin Nov 26, 2025
@JanJakes JanJakes marked this pull request as ready for review November 26, 2025 10:41
@JanJakes JanJakes requested a review from a team November 26, 2025 12:26
@adamziel
Copy link
Collaborator

Adminer errors for me:

CleanShot 2025-11-26 at 19 17 11@2x

PHPMyAdmin works pretty well, though! There are some rough edges around row-level edit/delete/etc. icons or supporting EXPLAIN queries and such, but it's very workable overall.

@JanJakes
Copy link
Member Author

Adminer errors for me

@adamziel Strange. Looks like the Adminer installation step worked, but somehow the extensions were not installed or applied. Can you replicate it reliably and also in an incognito window? I wonder why for me and in the tests it works.

@JanJakes
Copy link
Member Author

@adamziel Oh, I can actually replicate it. It happens when I open phpMyAdmin first and then Adminer. Checking 👀

@JanJakes JanJakes force-pushed the adminer branch 3 times, most recently from 0fecef8 to 2f258c0 Compare November 27, 2025 14:54
@JanJakes
Copy link
Member Author

@adamziel The Adminer problem should be fixed now. Also rebased on trunk.

@JanJakes JanJakes requested a review from adamziel November 27, 2025 16:03
@adamziel
Copy link
Collaborator

@JanJakes In PhpMyAdmin, the edit button is there, but leads to the following error on my end

CleanShot 2025-11-28 at 14 50 36@2x

@adamziel
Copy link
Collaborator

adamziel commented Nov 28, 2025

Also, this query returns 0 rows and seems like a success when it should fail (I have records with both ID 51 and 1 and I'm trying to trigger a primary key collision):

CleanShot 2025-11-28 at 14 53 37@2x

That's not a typical user flow, though, and not a blocker here.

@adamziel
Copy link
Collaborator

Executing SHOW TABLES in Adminer yielded a fatal error:

Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /wordpress/adminer/adminer-mysql-on-sqlite-driver.php:197 Stack trace: #0 /wordpress/adminer/adminer.php(701): Adminer\Result->fetch_field() #1 /wordpress/adminer/adminer.php(813): Adminer\print_select_result(Object(Adminer\Result), Object(Adminer\Db), Array, '') #2 /wordpress/adminer/index.php(37): require_once('/wordpress/admi...') #3 {main} thrown in /wordpress/adminer/adminer-mysql-on-sqlite-driver.php on line 197

@adamziel
Copy link
Collaborator

adamziel commented Nov 28, 2025

I think we're good to merge this if the UI says it's an "early access" experimental feature. I'll see if I can make the change.

@JanJakes
Copy link
Member Author

@JanJakes In PhpMyAdmin, the edit button is there, but leads to the following error on my end

@adamziel I just noticed that myself today, checking what the problem is.

Also, this query returns 0 rows and seems like a success when it should fail (I have records with both ID 51 and 1 and I'm trying to trigger a primary key collision):

Maybe I'm ignoring errors "too much". Both Adminer and phpMyAdmin run some statements that we don't support, and they work fine if we return an empty resultset in those cases. Maybe it can silence too many errors, and I should probably explicitly list only the failures we want to ignore 🤔

Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /wordpress/adminer/adminer-mysql-on-sqlite-driver.php:197 Stack trace: #0 /wordpress/adminer/adminer.php(701): Adminer\Result->fetch_field() #1 /wordpress/adminer/adminer.php(813): Adminer\print_select_result(Object(Adminer\Result), Object(Adminer\Db), Array, '') #2 /wordpress/adminer/index.php(37): require_once('/wordpress/admi...') #3 {main} thrown in /wordpress/adminer/adminer-mysql-on-sqlite-driver.php on line 197

Oh, this looks like a regression I introduced with the last refactor. I can fix that quickly, I think.

I think we're good to merge this if the UI says it's an "early access" experimental feature. I'll see if I can make the change.

Are you looking at this one, or should I add it as well?

@adamziel
Copy link
Collaborator

@JanJakes I've added a notice to the UI, I'm poking around a few visual elements and after that I think we can merge.

@JanJakes
Copy link
Member Author

@adamziel Thanks! I also have a fix for the Fatal error: Uncaught Error: Cannot use object of type stdClass as array. I just DM you also on Slack to sort this PR out.

@adamziel
Copy link
Collaborator

Docs failure seems like a flaky test unrelated to this PR, let's address it separately.

@adamziel adamziel merged commit 54138fb into trunk Nov 28, 2025
28 of 29 checks passed
@adamziel adamziel deleted the adminer branch November 28, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants