Problem/Motivation
Currently, the Database Browser module allows users to inspect and browse
database tables directly from the Drupal admin interface. However, there is
no functionality to export database table data or query results into commonly
used file formats.
Users currently need external tools such as phpMyAdmin, Adminer, or custom SQL
scripts to export database data for reporting, backups, debugging, analytics,
or data migration purposes.
Adding export functionality would improve usability and reduce dependency on
external database management tools.
Steps to reproduce
- Install and enable the Database Browser module
- Navigate to a database table view page
- Attempt to export table data
- Observe that no export functionality exists
- User must rely on external database tools for exporting data
Proposed resolution
Add export functionality for database tables and query results.
Proposed functionality:
- Allow exporting table data directly from the admin UI
- Support multiple export formats:
- CSV
- SQL
- Excel (XLSX)
- JSON
- Allow exporting filtered and sorted results
- Support exporting query results from the readonly SQL console
- Add download response handling
- Limit export size for performance protection
- Add permission-based access control
Potential future enhancements:
- Compressed ZIP exports
- Scheduled exports
- Email export delivery
- Streaming large exports
Remaining tasks
- Create export service
- Add export buttons/actions to table pages
- Implement CSV export generator
- Implement SQL dump generator
- Implement Excel export support
- Add JSON export support
- Add access permissions
- Add export validation and limits
- Write automated tests
- Update README documentation
User interface changes
New export actions will be added to database table pages.
UI additions may include:
- Export dropdown/button
- Format selection options
- Download confirmation
- Export progress/status messages
API changes
New export-related services may be introduced:
- Database export service
- File generation service
- Export formatter plugins
Possible future extensibility:
- Custom export format plugins
- Alter export output hooks
- Custom export handlers
Data model changes
No database schema changes are currently proposed.
Optional future enhancements:
- Export history tracking
- Saved export configurations
- Export audit logging
Issue fork database_browser-3589703
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mohnish s. yadavSummary
Adds export functionality for database tables and readonly SQL query results
in the Database Browser module.
Implemented Features
New Components
Controllers
ExportControllerfor handling export responses.Services
ExportManagerCsvExporterJsonExporterSqlExporterXlsxExporterForms
DatabaseBrowserSettingsFormConfiguration
Added module configuration for:
Security
Documentation
Updated README with:
Testing
Manually tested:
Comment #5
oshi02 commented