SQL Query Analyzer is a lightweight and efficient desktop utility designed to simplify the process of managing SQLite, PostgreSQL, SQL Server and MySQL/MariaDB databases.
It is a fork of SQLite Query Analyzer that talks to database servers as well as SQLite files.
It provides an intuitive interface for executing queries and direct table editing, making database operations seamless and straightforward.
- Cross platform - Runs natively on Windows, MacOS, and Linux
- Works with SQLite files and PostgreSQL, SQL Server and MySQL/MariaDB servers
- Connect dialog with a Test Connection button; recent connections are remembered (passwords never are)
- Schema-aware database tree showing
schema.tablefor providers that have schemas - Easy-to-use interface for executing SQL queries
- Fast table data editing
- Persists application state and reloads last session on startup
- Export database schema as CREATE TABLE statements
- Export data as an SQL script containing INSERT statements or as CSV files
- Zoom the query editor and database tree independently, each with its own size, using Ctrl +/- on the focused pane or Ctrl + mouse wheel over it. The query result grid, Messages pane and Table Data grid zoom together with the query editor, and answer both gestures themselves
- Desktop color theme awareness with automatic switching between dark/light themes
- Command line interface for automation and scripting
| Provider | Qt driver | Client library needed at runtime |
|---|---|---|
| SQLite | QSQLITE |
none, built into Qt |
| PostgreSQL | QPSQL |
libpq (libpq5 on Debian/Ubuntu; bundled with the Windows build, see deps/postgresql) |
| SQL Server | QODBC |
unixODBC plus the Microsoft ODBC Driver 18 for SQL Server (Windows ships the ODBC driver manager) |
| MySQL / MariaDB | QMYSQL |
libmariadb or libmysqlclient |
The official Qt binaries for Windows and macOS do not include the QMYSQL driver,
so MySQL/MariaDB support there needs a Qt build that has it.
Use File > Connect... (Ctrl+Shift+O) to open any provider. File > Open and File > New still open and create SQLite files directly.
The command line, the recent connections list and the saved session all describe a connection in a single line:
| Provider | Example |
|---|---|
| SQLite | /path/to/database.db |
| PostgreSQL | postgres://user@host:5432/database |
| SQL Server | mssql://user@host:1433/database?trust=1 |
| MySQL / MariaDB | mysql://user@host:3306/database |
SQL Server takes these extra query options: trust=1 accepts a self-signed server
certificate, integrated=1 uses Windows authentication, and driver=... names
another ODBC driver. A password is never written out. On the command line, give it
with --password, the SQLQUERY_PASSWORD environment variable, or inside the URL
(postgres://user:secret@host/db).
- Scripts are split into statements on
;, so PostgreSQL$$function bodies and a;inside a string literal are not understood yet. - A SQL Server script that uses
GOruns one batch at a time, likesqlcmd: a line holding onlyGOends a batch, andGO 5runs it five times. A batch goes to the server whole, so a procedure body keeps its semicolons, but a batch holding severalSELECTs shows only the first result. A script withoutGOis split on;. - The table data grid for PostgreSQL and SQL Server reads the whole result set on the client, so paging only happens in the view.
- Views, stored procedures and other databases on the same server are not listed in the tree.
- Shrink runs
VACUUMon SQLite and PostgreSQL andDBCC SHRINKDATABASEon SQL Server. It is disabled for MySQL.
Invoke-RestMethod https://christianhelle.com/sqlquery/install.ps1 | Invoke-Expressioncurl -fsSL https://christianhelle.com/sqlquery/install.sh | bashPre-built binaries for all platforms are available on the GitHub Releases page.
For more detailed installation instructions, visit the Documentation Website.
SQL Query Analyzer can be used as a command line tool for automating database operations without the GUI. The application supports several command line options for exporting data, executing SQL scripts, and more.
$ sqlquery --help
Usage: sqlquery [options] database
A fast and lightweight cross-platform command line and GUI tool for querying and manipulating SQLite, PostgreSQL, SQL Server and MySQL databases
Options:
-h, --help Displays help on commandline options.
--help-all Displays help, including generic Qt
options.
-v, --version Displays version information.
-p, --progress Show progress during copy
-e, --export-csv Export data to CSV.
-d, --target-directory <directory> Target directory for export.
-r, --run-sql <file> Execute SQL file.
--password <password> Password for a server connection.
Defaults to the SQLQUERY_PASSWORD
environment variable.
Arguments:
database SQLite file or connection URL to open,
e.g. postgres://user@host:5432/db,
mysql://user@host/db or
mssql://user@host/db?trust=1sqlquery /path/to/database.db
# A server connection opens the Connect dialog to ask for the password,
# unless one is given
SQLQUERY_PASSWORD=secret sqlquery postgres://postgres@localhost/shop# Export every table of a PostgreSQL database to CSV
sqlquery --export-csv -d ./out --password secret postgres://postgres@localhost:5432/shop
# Run a script against SQL Server
SQLQUERY_PASSWORD=secret sqlquery --run-sql seed.sql "mssql://sa@localhost/master?trust=1"# Export all tables to CSV files in the current directory
sqlquery --export-csv /path/to/database.db
# Export with progress indicator
sqlquery --export-csv --progress /path/to/database.db
# Export to a specific directory
sqlquery --export-csv --target-directory /path/to/export/folder /path/to/database.db# Execute a SQL script file against a database
sqlquery --run-sql /path/to/script.sql /path/to/database.db- Export to CSV: Export all database tables to individual CSV files
- Execute SQL Scripts: Run SQL scripts from files against a database
- Progress Reporting: Show progress indicators for long-running operations
- Flexible Output: Specify custom directories for exported files
Here are some screenshots of SQL Query Analyzer in action:
- Git 😄
- CMake 3.16 or later - Install from official website
- Qt 6.4.2 or later, 6.11.2 recommended - Install from official website
- Powershell Core (Optional)
git clone https://github.com/christianhelle/sqlquery.git
cd sqlqueryUse the Makefile on Linux and macOS, or the cross-platform PowerShell script on Windows:
# Linux / macOS
make# Windows
pwsh build.ps1The build output folder is under build on all platforms. On Linux, make also installs into ./linux/.
Install CMAke and Qt6 and XKB
sudo apt-get update
sudo apt-get install -y cmake qt6-base-dev libxkbcommon-devBuild project
makeInstall the Qt SQL drivers for the servers you want to reach (Ubuntu package names)
sudo apt-get install -y libqt6sql6-psql libqt6sql6-mysql libqt6sql6-odbcCreate installable packages (DEB, RPM, 7Z, ZIP, and compressed archives)
make packageInstall a sqlquery symlink to ~/.local/bin
make installInstall CMake and Qt6. It's recommended to install Qt using the official installer
brew update
brew install cmake
brew install qt@6Build project
makeBuild MacOS disk image (Optional).
There is a bug in the Homebrew distribution of Qt which causes the use of macdeployqt to fail.
make packageBuild the project (These instructions assumes that Qt root folder is C:\Qt)
cd src
cmake . -DCMAKE_PREFIX_PATH=C:/Qt/6.11.2/msvc2022_64 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="/Zc:__cplusplus /permissive-" -B build
cmake --build build --config Release
C:\Qt\6.11.2\msvc2022_64\bin\windeployqt.exe .\build\Release\SQLQueryAnalyzer.exeBuild the installer project using Inno Setup (Optional)
../deps/innosetup/ISCC.exe dist/setup.issThe unit tests use in-memory and temporary SQLite databases and need nothing else:
make testThe provider integration tests in tests/test_providers.cpp run against real
servers. A provider is skipped unless its connection URL is set:
docker compose -f tests/docker-compose.yml up -d
export SQLQUERY_TEST_PG='postgres://postgres:SqlQuery_2026@localhost:5432/postgres'
export SQLQUERY_TEST_MYSQL='mysql://root:SqlQuery_2026@127.0.0.1:3306/test'
export SQLQUERY_TEST_MSSQL='mssql://sa:SqlQuery_2026@localhost:1433/master?trust=1'
./build/tests/SQLQueryTests --gtest_filter='Servers/*'The Tests GitHub workflow runs both against PostgreSQL, MariaDB and SQL Server
service containers.
We welcome contributions to SQL Query Analyzer! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request on GitHub.

















