πŸ’¦ FULL SET: Vrana/adminer/issues/ - Uncensored 2025

Skip to content

Enable SQL format export in SQL Command editor#1092

Closed

Enable SQL format export in SQL Command editor#1092
srjheam wants to merge 2 commits intovrana:masterfrom
srjheam:srjheam/save-query-btn

Conversation

@srjheam
  • Title.

Personally I think it would be productive to integrate adminer and local sql scripts execution.

This may appear out of nowhere, but I am available to fulfill any request in order to it be approved.

Thanks!!

@srjheam

Also, I created a .devcontainer in another branch to help environment setup and development for everyone; please see the sample branch https://github.com/srjheam/adminer/tree/srjheam/save-query-w-devcontainer .

@rlaiola

In order to test this PR:

System: SQLite
Server: localhost
Username: root
Password: YOUR_PASSWORD_HERE
Database: /workspaces/adminer/my_database.db
  • The proposed changes can be seen when you access the SQL Command page and run a query/statement;
Screenshot 2025-05-21 at 13 40 14
  • Result file (format = SQL, name convention = 'sql-cmd_YmdHis.sql', e.g. sql-cmd_20250521165519.sql
Screenshot 2025-05-21 at 13 55 30
  • Close the window to stop the container;

---------

Co-authored-by: Jheam Storch Ross <58143641+srjheam@users.noreply.github.com>
@srjheam

I've included some changes from @rlaiola .

If the commit messages do not follow the project convention, please do not hesitate to squash merge this PR, or contact me in order to restructure the git tree.

Also, as I discussed with @rlaiola on srjheam#2 (comment) , my devcontainers branch is just a sample and I would be more than happy to contribute with adminer in another PR with devcontainer environment setup.

@srjheam srjheam changed the title Add "Save query" button to SQL Command editor Enable SQL format export in SQL Command editor May 21, 2025
@rlaiola

@srjheam well done!

I think that another PR with just the dev container has the potential to streamline the development process.

Cheers.

@vrana

I'm not interested in this feature as I see it confusing. I would expect the SQL export to give me SQL commands to recreate the data in another database, not just save the current commands to a file (which could be done be a simple copy/paste).

You can create a separate pull-request for .devcontainer although MySQL/MariaDB is the primary database for Adminer, not SQLite.

@vrana vrana closed this May 27, 2025
@rlaiola

I'm not interested in this feature as I see it confusing. I would expect the SQL export to give me SQL commands to recreate the data in another database, not just save the current commands to a file (which could be done be a simple copy/paste).

Hi @vrana,

avoid the "copy & paste to save the query in a file" is exactly the goal of this PR. Let me give you some context: in my database courses students use Adminer to run their queries and then save/export the queries (NOT the inserts) to send for correction.

Important to say that queries are independent of the instance of the database. If not mistaken, the main goal of the "SQL command" page is to run queries (and why not saving them for use later on?). If one wants to export the database there is already an specific link for that (Export on the left side).

Cheers

@srjheam

You can create a separate pull-request for .devcontainer although MySQL/MariaDB is the primary database for Adminer, not SQLite.

Ok! Expect me doing so in the next few days.

The .devcontainer is agnostic to any databases and SQLite was just part of the sample I wanted to easily spin up for @rlaiola .

I'll create a new PR and make sure to support MySQL/PostgreSQL.

@srjheam

I'm not interested in this feature as I see it confusing. I would expect the SQL export to give me SQL commands to recreate the data in another database, not just save the current commands to a file (which could be done be a simple copy/paste).

In order to avoid the copy/paste/echo/touch flow to export the query, do you think it would be useful for the project to move this proposed feature from the export button to a new actual button in the interface with "Save query" label?

@rlaiola

I'm not interested in this feature as I see it confusing. I would expect the SQL export to give me SQL commands to recreate the data in another database, not just save the current commands to a file (which could be done be a simple copy/paste).

In order to avoid the copy/paste/echo/touch flow to export the query, do you think it would be useful for the project to move this proposed feature from the export button to a new actual button in the interface with "Save query" label?

@srjheam perhaps, moving this feature under the 'History' link (below the textarea input and sideways to the 'Edit' link) could be an interesting alternative. This way I guess it becomes "less" confusing ('Edit' means edit the statement in the textarea, and 'Save' would indicate that the past statement that would actually be saved).

@rlaiola

You can create a separate pull-request for .devcontainer although MySQL/MariaDB is the primary database for Adminer, not SQLite.

Ok! Expect me doing so in the next few days.

The .devcontainer is agnostic to any databases and SQLite was just part of the sample I wanted to easily spin up for @rlaiola .

I'll create a new PR and make sure to support MySQL/PostgreSQL.

@srjheam an alternative is to refer to a docker-compose file in the devcontainer (an Adminer container and a MySQL one). Here is an example that could help.

https://github.com/rtmonteiro/boca-playwright/tree/main/.devcontainer

@rlaiola

@vrana what do you think of the save feature as in the image?

Screenshot 2025-05-29 at 17 31 01

vrana added a commit that referenced this pull request Jun 18, 2025
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