Skip to content

christianhelle/sqlitequery

Repository files navigation

Linux MacOS Windows

Quality Gate Status Bugs Reliability Rating Security Rating Maintainability Rating Vulnerabilities

SQLite Query Analyzer

SQLite Query Analyzer is a lightweight and efficient desktop utility designed to simplify the process of managing SQLite databases.

It provides an intuitive interface for executing queries and direct table editing, making database operations seamless and straightforward.

Features

  • Cross platform - Runs natively on Windows, MacOS, and Linux
  • 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
  • Desktop color theme awareness with automatic switching between dark/light themes
  • Command line interface for automation and scripting

CLI Usage

SQLite 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.

Help Text

$ sqlitequery --help
Usage: sqlitequery [options] database
A fast and lightweight cross-platform command line and GUI tool for querying and manipulating SQLite 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  Target directory for export.
  -r, --run-sql           Execute SQL file.

Arguments:
  database                Database file to open.

Usage Examples

Opening a database in GUI mode

sqlitequery /path/to/database.db

Exporting data to CSV files

# Export all tables to CSV files in the current directory
sqlitequery --export-csv /path/to/database.db

# Export with progress indicator
sqlitequery --export-csv --progress /path/to/database.db

# Export to a specific directory
sqlitequery --export-csv --target-directory /path/to/export/folder /path/to/database.db

Executing SQL scripts

# Execute a SQL script file against a database
sqlitequery --run-sql /path/to/script.sql /path/to/database.db

CLI Features

  • 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

Screenshots

Here are some screenshots of SQLite Query Analyzer in action:

Windows

Insert query Select query Table data editing Dark Mode Insert query Dark Mode Select query Dark Mode Table data editing

MacOS

Insert query Select query Table data editing Dark Mode Insert query Dark Mode Select query Dark Mode Table data editing

Linux (Ubuntu)

Insert query Select query Table data editing Dark Mode Insert query Dark Mode Select query Dark Mode Table data editing

Building

Prerequisites

Clone the repository

git clone https://github.com/christianhelle/sqlitequery.git
cd sqlitequery

Build the project using cross platform powershell script

cd src/project
pwsh build.ps1

The build output folder is under src/project/build for MacOS and Linux, and src/project/build/Release for Windows

Building on Linux

Install CMAke and Qt6 and XKB

sudo apt-get update
sudo apt-get install -y cmake qt6-base-dev libxkbcommon-dev

Build project

cd src/project
cmake .
cmake --build . --config Release

Building on MacOS

Install CMake and Qt6. It's recommended to install Qt using the official installer

brew update
brew install cmake
brew install qt@6

Build project

cd src/project
cmake .
cmake --build . --config Release

Build MacOS disk image (Optional).

There is a bug in the Homebrew distribution of Qt which causes the use of macdeployqt to fail.

macdeployqt SQLiteQueryAnalyzer.app -dmg

Building on Windows

Build the project (These instructions assumes that Qt root folder is C:\Qt)

cd src
cmake . -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="/Zc:__cplusplus /permissive-" -B build
cmake --build build --config Release
C:\Qt\6.9.0\msvc2022_64\bin\windeployqt.exe .\build\Release\SQLiteQueryAnalyzer.exe

Build the installer project using Inno Setup (Optional)

../deps/innosetup/ISCC.exe setup.iss

Contributing

We welcome contributions to SQLite Query Analyzer! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request on GitHub.

About

A fast and lightweight cross-platform GUI tool for querying and manipulating SQLite databases

Resources

License

Stars

Watchers

Forks

Contributors