19 Free Terminal SQL Client for Linux, Windows and macOS

19 Free Terminal SQL Client for Linux, Windows and macOS

What is an SQL Client?

An SQL client is a software tool that allows users to connect to and interact with a database server using SQL (Structured Query Language). It provides an interface to execute SQL queries, manage database structures, and perform administrative tasks such as backups, updates, and migrations.

Benefits of Using SQL Clients

SQL clients simplify database management by providing an intuitive way to write and execute queries. They offer features like syntax highlighting, query formatting, and database schema visualization, which enhance productivity and reduce errors.

Additionally, many SQL clients support multiple databases, making it easier to manage different systems from a single interface.

Who Uses SQL Clients?

SQL clients are used by a wide range of professionals, including database administrators (DBAs), developers, data analysts, and anyone who needs to interact with databases regularly.

Whether you're building applications, analyzing data, or maintaining databases, an SQL client is an essential tool that streamlines your workflow and improves efficiency.

In the following list, you will find the best open-source free terminal-based SQL clients.

1- Harlequin

Harlequin is a free terminal-based SQL client that is written completely with Python. It also can work with DuckDB.

Features

  • Fancy user interface
  • Keyboard support
  • Supports Files and S3 Objects
  • Query editor
  • Results viewer
  • Full-screen support
  • Database browser
  • Results Export
  • Query history
  • Theme support
  • Supports SQLite, MySQL, DuckDB, PostgreSQL, Databricks, Wherebots, Cassandra, and BigQuery.
  • Supports local files

Install Harlequin

After installing Python 3.8 or above, install Harlequin using pip or pipx with:

pipx install harlequin
GitHub - tconbeer/harlequin: The SQL IDE for Your Terminal.
The SQL IDE for Your Terminal. Contribute to tconbeer/harlequin development by creating an account on GitHub.

2- usql

usql is a universal command-line interface for PostgreSQL, MySQL, Oracle Database, SQLite 3, Microsoft SQL Server, and many other databases including NoSQL and non-relational databases!

usql provides a simple way to work with SQL and NoSQL databases via a command-line inspired by PostgreSQL's psqlusql supports most of the core psql features, such as variablesbackticksbackslash commands and has additional features that psql does not, such as multiple database supportcopying between databasessyntax highlightingcontext-based completion, and terminal graphics.

Database administrators and developers that would prefer to work with a tool like psql with non-PostgreSQL databases, will find usql intuitive, easy-to-use, and a great replacement for the command-line clients/tools for other databases.

usql works on macOS, Windows and Linux. It can be also installed using Docker.

GitHub - xo/usql: Universal command-line interface for SQL databases
Universal command-line interface for SQL databases - xo/usql

3- mssql-cli

mssql-cli is an interactive command line query tool for SQL Server. This open source tool works cross-platform and proud to be a part of the dbcli community.

Features

  • Auto-completion: fewer keystrokes needed to complete complicated queries.
  • Syntax highlighting: highlights T-SQL keywords.
  • Query history: easily complete an auto-suggested query that was previously executed.
  • Configuration file support: customize the mssql-cli experience for your needs.
  • Multi-line queries: execute multiple queries at once using the multi-line edit mode.
  • Non-interactive support: execute a query without jumping into the interactive experience.
GitHub - dbcli/mssql-cli: A command-line client for SQL Server with auto-completion and syntax highlighting
A command-line client for SQL Server with auto-completion and syntax highlighting - dbcli/mssql-cli

4- dblab

dblab is a fast and lightweight interactive terminal based UI application for PostgreSQL, MySQL and SQLite3, written in Go and works on OSX, Linux and Windows machines.

Main idea behind using Go for backend development is to utilize ability of the compiler to produce zero-dependency binaries for multiple platforms.

dblab was created as an attempt to build very simple and portable application to work with local or remote PostgreSQL/ MySQL/ SQLite3/ Oracle/ SQL Server databases.

Features

  • Cross-platform support OSX/ Linux/ Windows 32/64-bit
  • Simple installation (distributed as a single binary)
  • Zero dependencies.
GitHub - danvergara/dblab: The database client every command line junkie deserves.
The database client every command line junkie deserves. - danvergara/dblab

5- mycli

A command line client for MySQL that can do auto-completion and syntax highlighting.

GitHub - dbcli/mycli: A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting. - dbcli/mycli

6- trdsql

trdsql is a CLI tool that can execute SQL queries on CSVLTSVJSONYAML and TBLN files.

This tool is similar to others such as q and textql, with a key distinction: it allows the use of PostgreSQL or MySQL syntax.

GitHub - noborus/trdsql: CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN. Can output to various formats.
CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN. Can output to various formats. - noborus/trdsql

7- pgcli

This is a free and open-source Postgres CLI with autocompletion and syntax highlighting.

GitHub - dbcli/pgcli: Postgres CLI with autocompletion and syntax highlighting
Postgres CLI with autocompletion and syntax highlighting - dbcli/pgcli

8- SQLine

Command line tool to perform SQL database queries. With sqline you can mix the power of Unix tools with the power of SQL.

GitHub - davidgasquez/sqline: 🛠️ Simple command line tool to query databases
🛠️ Simple command line tool to query databases. Contribute to davidgasquez/sqline development by creating an account on GitHub.

9- sqlcli

A command line interface (CLI) for interacting with SQLModel.

Features

  • Read data using the sqlcli select command.
  • Insert data using the sqlcli insert command.
  • Interactive console powered by typerrich, and sqlmodel.
  • Pretty terminal outputs generated by rich.
  • Multiple output formats including rich, json, and python dictionaries.
GitHub - SamEdwardes/sqlcli: A command line interface (CLI) for interacting with SQLModel.
A command line interface (CLI) for interacting with SQLModel. - SamEdwardes/sqlcli

10- easyaccess

easyaccess is an enhanced command line interpreter and Python package created to facilitate access to astronomical catalogs stored in SQL Databases.

It provides a custom interface with custom commands and was specifically designed to access data from the Dark Energy Survey Oracle database, including autocompletion of tables, columns, users and commands, simple ways to upload and download tables using csv, fits and HDF5 formats, iterators, search and description of tables among others.

It can easily be extended to another surveys or SQL databases.

The package was completely written in Python and support customized addition of commands and functionalities.

GitHub - mgckind/easyaccess: SQL command line interpreter for astronomical surveys
SQL command line interpreter for astronomical surveys - mgckind/easyaccess

11- litecli

A command-line client for SQLite databases that has auto-completion and syntax highlighting.

GitHub - dbcli/litecli: CLI for SQLite Databases with auto-completion and syntax highlighting
CLI for SQLite Databases with auto-completion and syntax highlighting - dbcli/litecli

12- lazysql

This is a free azygit inspired terminal sql client.

GitHub - Kavantix/lazysql: A lazygit like terminal sql client
A lazygit like terminal sql client. Contribute to Kavantix/lazysql development by creating an account on GitHub.

13- Remal SQL SQL-Runner

The SQL-Runner is a small command-line tool written in Java and can be used on all platforms where Java is available. The tool can be used to execute any SQL commands, especially it is suitable for executing SQL SELECTUPDATEDELETE, and CREATE commands.

You can use this tool for example to create a new database schema during the application deployment and insert initial data into databases. The tool uses a JDBC driver to connect to a specific database and relatively easy to configure.

The latest version of the tool only supports Oracle Database server, but other SQL dialects can easily be added.

GitHub - zappee/sql-runner: This is a tool with command-line-interface, executes the given SQL query and shows the result on the standard output.
This is a tool with command-line-interface, executes the given SQL query and shows the result on the standard output. - zappee/sql-runner

17- sql-cli

Universal command-line interface for SQL databases. Built on top of Knex. Supports connecting over SSH.

GitHub - dgoguerra/sql-cli: Universal command-line interface for SQL databases
Universal command-line interface for SQL databases - dgoguerra/sql-cli

18- termtable

termtable is a go based terminal database client made using bubbletea

GitHub - robertazzopardi/termtable: Terminal database client written in go
Terminal database client written in go. Contribute to robertazzopardi/termtable development by creating an account on GitHub.

19- SQL-Bless

The SQL-Bless is a command-line database client like SQL*Plus or psql.

Features

  • Emacs-like keybindings for inline editing of multiple lines of SQL.
    • The action of Enter key will only insert a line feed code.
    • Press Ctrl-J or Ctrl-Enter to execute the input.
  • Save the result of SELECT in CSV format
  • Supported RDBMS
    • SQLite3
    • Oracle
    • PostgreSQL
    • Microsoft SQL Server
    • MySQL
  • Allows editing database records directly, similar to a spreadsheet (with the EDIT command)
GitHub - hymkor/sqlbless: The Command-line Database Client
The Command-line Database Client. Contribute to hymkor/sqlbless development by creating an account on GitHub.







Open-source Apps

9,500+

Medical Apps

500+

Lists

450+

Dev. Resources

900+