For a terminal based client for SQL databases, the first results are xo/usql, dbcli/pgcli (pgcli is a dedicated interactive SQL shell for PostgreSQL with real-time autocompletion and syntax highlighting, making it a command-line database query tool, though its lack of cross-database support means it covers only one database system) and achristmascarl/rainfrog. julianhyde/sqlline and duckdb/duckdb round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
Command line interface tools for querying, managing, and interacting with relational databases directly from your terminal.
usql is a universal SQL command-line interface used to connect to and manage multiple SQL and NoSQL databases through a single unified tool. It provides a standardized interface for executing queries across various data stores and serves as a multi-database query tool and schema inspector. The tool distinguishes itself by enabling cross-database data migration, allowing users to pipe result sets from one active database connection directly into another. It also features terminal-based data visualization, which renders query results as graphical charts, graphs, and images directly within the t
usql is a universal command-line SQL interface that lets you interactively or programmatically execute queries across many SQL and NoSQL databases, directly meeting this search for a terminal-based query tool with its built-in interactive shell, auto‑completion, output formatting, and connection‑profile storage.
pgcli is an interactive command-line interface and database management tool for PostgreSQL. It functions as an interactive SQL shell and query editor that allows users to inspect schemas, manage connections, and run queries against PostgreSQL data sources. The tool is distinguished by its real-time, schema-aware autocompletion for keywords, tables, and columns, as well as dynamic SQL syntax highlighting. It provides safety mechanisms through transaction-aware guardrails that warn against or block destructive statements when no active transaction is detected. Broad capabilities include secure
pgcli is a dedicated interactive SQL shell for PostgreSQL with real-time autocompletion and syntax highlighting, making it a command-line database query tool, though its lack of cross-database support means it covers only one database system.
Rainfrog is a terminal-based database client that connects to multiple database engines, combining schema browsing, interactive SQL query execution, and inline data editing into a single terminal interface. It provides a tree navigator for exploring tables, columns, and indexes, and an inline cell editor that automatically constructs and executes the necessary UPDATE statements when a cell value is changed. The application also supports modal Vim-style keyboard shortcuts for cursor movement and editing, making it usable entirely from the keyboard. Query results are fetched in chunks and pagin
Rainfrog is a terminal-based database client that lets you interactively run SQL queries against multiple engines (PostgreSQL, MySQL, SQLite) with a keyboard-driven interface, making it a solid fit for a command-line query tool—though it focuses on interactive use rather than pipe or non-interactive batch execution.
Shell for issuing SQL to relational databases via JDBC
sqlline is a JDBC-based command-line SQL shell that lets you interactively or non-interactively query any relational database from the terminal, with features like auto-completion, output formatting, and connection management — a direct fit for this search.
DuckDB is an in-process analytical database engine designed to run directly within an application process. As a zero-dependency, embedded system, it provides enterprise-grade SQL data processing capabilities without the overhead of managing a dedicated database server. It is built to handle complex analytical and aggregation tasks by storing and retrieving information in columns, allowing for high-performance relational data manipulation. The engine distinguishes itself through a columnar vectorized execution model that maximizes CPU cache efficiency during query operations. It employs adapti
DuckDB's command-line interface lets you run SQL queries interactively or in batch from the terminal, with syntax highlighting and output formatting, but it is limited to its own embedded database engine rather than offering cross‑database connections.
mycli is a MySQL command line client, database administration tool, and SQL query editor. It functions as a terminal interface for executing queries and managing MySQL connections, incorporating an integrated assistant that uses large language models to generate and analyze SQL statements based on the current database schema. The tool provides specialized query authoring capabilities, including context-sensitive syntax suggestions, fuzzy-matching identifier completion for tables and columns, and the ability to handover query buffers to external system text editors. It distinguishes its connec
Mycli is a command-line MySQL client with autocompletion, syntax highlighting, and interactive querying, making it a precise fit for a terminal-based database query tool, though its MySQL-only focus means it does not cover the cross-database support you mentioned.
CLI for SQLite Databases with auto-completion and syntax highlighting
Litecli is a command-line SQLite query tool with auto-completion and syntax highlighting, fitting the need for a terminal-based database client, though it only supports SQLite rather than multiple databases.
A command-line client for SQL Server with auto-completion and syntax highlighting
This is a command-line client for SQL Server with auto-completion and syntax highlighting, ideal for interactive queries from the terminal, but it lacks cross-database support beyond SQL Server.
Prisma is a type-safe database object-relational mapper that uses a declarative schema to map data models to relational and document databases. It provides a unified toolkit for data access, combining a database driver with tools for schema management and record manipulation. The project features a multi-database driver that standardizes interactions across PostgreSQL, MySQL, and MongoDB. It includes a system for tracking and applying structural schema migrations across different environments and a graphical user interface for browsing and editing database records. The system ensures data in
Prisma is a type-safe ORM and database toolkit with a CLI and a graphical browser, but its core purpose is object-relational mapping and client generation rather than providing an interactive command-line query shell with auto-completion and pipe execution, making it a neighbouring tool rather than the dedicated query interface you want.
MyBatis-Flex is an object-relational mapping framework for Java that extends MyBatis with a fluent API and automated CRUD operations. It provides a data access suite featuring an automatic CRUD data mapper, a type-safe SQL query builder, and a row-based query engine for manipulating records without predefined entity classes. The framework includes a multi-dialect SQL translator that converts generated syntax across different database engines, such as MySQL, PostgreSQL, and Oracle. It further distinguishes itself by offering annotation-free entity mapping using runtime reflection and naming co
This is a Java ORM framework that provides programmatic SQL query builders and entity mapping, not a command-line tool for interactively or non-interactively executing database queries from the terminal.
Medoo is a lightweight PHP database abstraction layer and SQL query builder. It serves as a minimal database wrapper that provides a unified API to execute queries across multiple SQL engines, translating PHP method calls into specific database dialects. The project enables multi-dialect SQL interfacing, allowing a single codebase to interact with various backends including MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, Oracle, and Sybase. It uses prepared statement parameterization to prevent injection attacks while maintaining a programmatic approach to constructing complex SQL statements. The
Medoo is a PHP database abstraction library and query builder, not a command-line tool — it provides a programmatic API for SQL queries within code, lacking the interactive shell, auto-completion, and terminal execution this search asks for.
SQLDelight is a Kotlin database library that validates SQL schema, statements, and migrations at compile time, generating type-safe Kotlin query functions from labeled SQL files. It treats SQL as the source of truth for database definitions, catching schema errors during the build process before they reach production. The library supports multiple database dialects including SQLite, MySQL, PostgreSQL, HSQL, and H2, and generates platform-specific code for Android, iOS, JVM, and JavaScript targets. It provides a platform-specific driver abstraction that handles database connectivity difference
SQLDelight is a Kotlin library that validates SQL at compile time and generates type-safe query functions — it is not a command-line tool for interactively or programmatically executing database queries from the terminal.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| xo/usql | 10K | Go | MIT | |
| dbcli/pgcli | 13.2K | Python | BSD-3-Clause | |
| achristmascarl/rainfrog |
| 4.9K |
| Rust |
| mit |
| julianhyde/sqlline | 656 | Java | BSD-3-Clause |
| duckdb/duckdb | 38.8K | C++ | MIT |
| dbcli/mycli | 11.9K | Python | BSD-3-Clause |
| dbcli/litecli | 3.3K | Python | BSD-3-Clause |
| dbcli/mssql-cli | 1.4K | Python | BSD-3-Clause |
| prismagraphql/prisma | 16.4K | Scala | Apache-2.0 |
| mybatis-flex/mybatis-flex | 2.6K | Java | apache-2.0 |