Added Copy Structure Buttons to DB page and Table Structure Page.#20277
Added Copy Structure Buttons to DB page and Table Structure Page.#20277imlolman wants to merge 10 commits into
Conversation
Signed-off-by: Satyam <satyam.gupta756@gmail.com>
Signed-off-by: Satyam <satyam.gupta756@gmail.com>
Signed-off-by: Satyam <satyam.gupta756@gmail.com>
Signed-off-by: Satyam <satyam.gupta756@gmail.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 60 |
| Duplication | 4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes. Give us feedback
|
Hi @imlolman I think this feature, thank you Could you write tests for the two controllers please ? |
Signed-off-by: Satyam <satyam.gupta756@gmail.com>
I've added tests and fixed the test error aswell. |
|
Hey 👋, @williamdes Workflows pending approval, can you please approve. |
Stop relying on Current::$database for copy-structure SQL; use validated DatabaseName. Remove redundant selectDb from table copy controller and align unit tests with response handling and DBI expectations. Signed-off-by: Satyam <satyam.gupta756@gmail.com>
Remove redundant Response assertions; narrow JSON values with PHPUnit assertions instead of casting mixed to string. Signed-off-by: Satyam <satyam.gupta756@gmail.com>
Record PossiblyUnusedReturnValue for Response on both copy-structure controllers, consistent with other InvocableController routes. Signed-off-by: Satyam <satyam.gupta756@gmail.com>
|
Hey @williamdes lets merge this. Just curious, anything pending from my side? |
Hi |
Problem
Getting a database or table definition for AI, review, docs or other tools meant using Export or Show create for many objects. That’s slow and easy to get wrong when you only need readable DDL (including FKs), not data.
Why / approach
Add two one-click actions that call
SHOW CREATE TABLE/SHOW CREATE VIEWon the server and copy the result to the clipboard, same information as “show create”, fewer steps.This also makes it easy to share database structure with AI tools (for code generation, review, or debugging) without exposing any actual data, since only DDL is copied.
What’s in the PR
POSTroutes, Twig buttons, TS handlers (clipboard API + fallback), routing test + service wiring.Screenshots
Fixes #