GCQ (GEN Commandline Query)

GCQ command-line query. A multi-platform command-line tool for querying most major databases and producing output in a wide range of formats.

Version1.001
Released2026-02-09
PlatformWindows, macOS, Linux
AuthorGENSoftware
Licence Mixed License
  • Repeatable queries with consistent output
  • Format targets for ops, dev, and reporting pipelines
  • Designed to slot into scripts and CI jobs

Overview

GCQ runs a query against a database and writes the result in whichever format the job downstream needs. One binary, no client libraries to install, and the same behaviour on every platform, which makes it equally at home in an interactive shell, a cron job, or a CI pipeline.

Databases

MariaDB, MySQL, PostgreSQL and SQLite, selected with --db and addressed with a standard DSN.

Output Formats

table, text, ansi, md, rtf, json, csv, tsv, yaml, xml, html and pdf. The document formats make GCQ a reporting tool rather than only a query tool: a scheduled query can produce a finished PDF or HTML report and email it directly.

Usage

gcq --db mariadb \
    --dsn 'mariadb://user:pass@host:3306/database' \
    --query 'SELECT 1' \
    --out table

Queries may also be supplied with --file or on stdin, written to disk with --output, rendered through a template, or sent onward with --email-to. Connection details can be kept in a config file and selected with --profile.