A desktop application for viewing and editing databases in WordPress installations. Supports both SQLite (WordPress Studio) and MySQL databases. Built with Electron and React.
- Features
- Screenshots
- Prerequisites
- Development Setup
- Building Executables
- Creating Releases
- Usage
- Technical Stack
- License
-
Multi-Database Support
- SQLite databases (WordPress Studio installations)
- MySQL databases (traditional WordPress installations)
- Automatic database type detection
- Choose between database types when both are available
- Visual database type indicator (SQLite/MySQL badge)
-
WordPress Integration
- Automatic detection of WordPress installations
- Finds SQLite database in wp-content/database/.ht.sqlite
- Reads MySQL credentials from wp-config.php
- Recent directories support for quick access
- Localhost-only MySQL connections for security
-
Database Viewing
- View all tables in the database
- Browse table data with pagination (50 rows per page)
- View table schema with primary key indicators
- Search/filter within table data by specific columns or all columns
-
Data Editing
- Edit existing rows with modal editor
- Delete rows (with confirmation)
- Add new rows
- Automatic data type detection
- Primary key protection
-
User Interface
- Clean, modern UI with real-time updates
- Cross-platform support (macOS, Windows, Linux)
- Responsive design
- Node.js 18.x or higher
- npm 9.x or higher
- For testing:
- A WordPress Studio installation (GitHub) for SQLite support
- Or a traditional WordPress installation with MySQL for MySQL support
- Clone the repository:
git clone https://github.com/jonathanbossenger/wp-sql.git
cd wp-sql- Install dependencies:
npm install- Start the development server:
npm run devLinux users: If you encounter a sandbox error about chrome-sandbox, you need to fix the Electron sandbox permissions:
sudo chown root:root node_modules/electron/dist/chrome-sandbox
sudo chmod 4755 node_modules/electron/dist/chrome-sandboxThis will:
- Generate application icons
- Start webpack in watch mode for the renderer process
- Launch Electron in development mode
- Enable hot reloading for React components
The project uses Electron Forge for building platform-specific executables.
npm run makeThis will create executables in the out/make directory for:
- macOS (.dmg)
- Windows (.exe)
- Linux (.deb, .rpm)
For macOS:
npm run make -- --platform=darwinFor Windows:
npm run make -- --platform=win32For Linux:
npm run make -- --platform=linuxThe repository includes a GitHub Actions workflow that automatically builds the application for all platforms when a new release is created.
- Update the version in
package.json - Commit the version change
- Create and push a new git tag:
git tag v1.0.0
git push origin v1.0.0- Create a new release on GitHub:
- Go to the repository's Releases page
- Click "Draft a new release"
- Select the tag you just created
- Add release notes
- Click "Publish release"
The GitHub Actions workflow will automatically:
- Build the application for Windows, macOS, and Linux
- Upload the following artifacts to the release:
- Windows:
.exeinstaller (Squirrel),.msiinstaller (WiX) - macOS:
.dmginstaller,.ziparchive - Linux:
.debpackage,.rpmpackage,.ziparchive
- Windows:
Users can then download and install the appropriate version for their operating system directly from the GitHub release page.
- Launch the application
- Select your WordPress installation directory
- The app will automatically detect available database types:
- SQLite: Found at wp-content/database/.ht.sqlite (WordPress Studio)
- MySQL: Credentials from wp-config.php (traditional WordPress)
- If both database types are available, choose which one to use
- Browse the list of tables and select one to view its data
Viewing Tables:
- Select a table from the list on the left
- Use pagination controls to navigate through rows (50 rows per page)
- Primary key columns are marked with (PK)
- The database type badge (SQLite/MySQL) shows which database you're viewing
Searching/Filtering:
- Select a column from the dropdown menu (or "All Columns" to search across all fields)
- Type your search query in the search box
- The table will automatically filter to show only matching rows
- The search is case-insensitive and matches partial text
Editing Data:
- Click "Edit" on any row to open the edit modal
- Modify the values (primary key fields are read-only)
- Click "Save Changes" to update the row
- Changes are immediately saved to the database
Adding Rows:
- Click the "Add Row" button
- Fill in the values for each field
- Auto-increment primary keys are automatically hidden
- Click "Save" to insert the new row
Deleting Data:
- Click "Delete" on any row
- Confirm the deletion
- The row is permanently removed from the database
Requirements:
- MySQL server must be running on localhost (127.0.0.1)
- Valid wp-config.php with database credentials
- Database credentials must be for a localhost MySQL server (remote connections are blocked for security)
Security:
- MySQL credentials are read fresh from wp-config.php on each connection
- Credentials are never cached or stored
- Only localhost connections are permitted
- All queries use parameterized statements to prevent SQL injection
Switching Database Types: To switch between SQLite and MySQL (when both are available):
- Click "Change Directory"
- Select the same directory again
- Choose the database type you want to use
- Desktop Framework: Electron
- UI Framework: React
- Styling: Tailwind CSS
- Database Access:
- better-sqlite3 - SQLite database interface
- mysql2 - MySQL database interface
- Build Tools:
- Webpack - Module bundler
- Electron Forge - Building and packaging
- Other:
- Sharp - Image processing for icons
- electron-store - Persistent storage for user preferences
For detailed implementation information about MySQL support, see MYSQL-SUPPORT.md.
npm run dev- Start the application in development modenpm run build- Build the renderer processnpm run generate-icons- Generate application iconsnpm run generate-all- Generate all iconsnpm run package- Package the application without creating installersnpm run make- Create platform-specific distributables
GPL-2.0-or-later



