Features
BroadSQL is a command-line workbench for people who manage data across several servers, vendors and environments. It keeps the part of the job that repeats in commands you can run again, script and share. This page lists what it does; each item links to its documentation.
Graphical clients are excellent for designing a schema or exploring one database. A command line earns its place when the same work comes back: the same check next week, the same extract in another environment, the same Script run by a colleague. The comparison with usql, DBeaver and DataGrip says, tool by tool, where each one is the better fit.
| The everyday work | BroadSQL |
|---|---|
| Connect and explore | Named connections; SHOW TABLES, DESCR, SHOW FK, FIND COLUMN; plain SQL sent to the database as written |
| Compare environments | / PROD runs the last query once in another Environment of the same application; COMPARE TABLE STRUCTURE |
| Export results | DUMP: one syntax for H2, Excel, ODS, CSV, JSON, Markdown and HTML |
| Load data | LOAD: a CSV file checked against the table, previewed, then inserted in one transaction |
| Automate | Scripts with typed parameters, the Scripts Library, login scripts, all in the free product |
| Extend | A plain .jar in extensions/ adds your own commands |
Connections and environments
- Every JDBC database: drivers for H2, PostgreSQL, Apache Derby, HSQLDB and SQLite are included; Oracle, SQL Server, MySQL, MariaDB, Db2 and the others work once their driver JAR is added. See Connect to your database.
- Database Groups and Environments: connections are grouped by application (
WORLDAPPin the examples of the documentation) and labelled by stage (DEV,QA,PROD).ENV PRODmoves to the production connection of the same application;/ PRODruns the last query there once, and you stay where you were. See Connections, Database Groups and Environments. - Production confirmation: on a connection of an Environment flagged Production, BroadSQL asks before every statement that can change the database. See Production confirmation.
- Encrypted credentials: connection URLs and passwords are stored in a local AES-encrypted database, the CDF, unlocked by a master password. Every installation ships with the same default one: change it before adding real connections. See Security.
Queries and lists
- Run it again:
/runs the last query again;REPEAT EVERY 30swatches it and can keep a timeline in a file. - Lists where they already are:
<@clipboard>,<@last:ID>,<@file>,<@csv:...>and<@excel:...>expand to a quoted, comma separated list in anIN (...). See Syntax and shortcuts. - Read the result your way:
EXPANDreplaces*with the column names,FORMATlays out the last query,SET LIST ONshows one row at a time.
Export and import
- One export command:
DUMPwrites a table, a query, the result on screen or a Script's result to Excel, OpenDocument, CSV, text, JSON, Markdown, HTML or a local H2 database, with the same syntax for every destination.PULLis its compatibility alias. See Exporting data. - Spreadsheets that grow: a
DUMPreplaces only the worksheet it names, andMODE APPENDadds rows below it. AQUERIESworksheet records where each tab came from. - Local working copies:
DUMP ... AS H2 MODE MERGE KEY(ID)keeps a local copy of a table up to date; every refresh is recorded inBROADSQL_PULL_AUDIT. See Local H2 datasets. - Safe loads:
LOADchecks a CSV file against the target table, shows a preview, and inserts only after a confirmation, with parameter-bound statements. See Importing data.
DUMP (SELECT CODE, TRIM(NAME) AS NAME, POPULATION FROM COUNTRY) TO WORKCOPY.COUNTRY_FIGURES AS H2 MODE MERGE KEY(CODE);
MERGE into WORKCOPY.COUNTRY_FIGURES: 254 source row(s), 0 inserted, 1 updated, 253 unchanged.
Completed: 2026-10-18 10:15:47 +02:00 (0:00:00).
Illustrative output on the WORLD sample, from the DUMP tutorial.
Scripts and automation
- Scripts: text files that mix SQL and BroadSQL commands, run by name with
@nameorLIB RUN. See Scripting overview. - Typed parameters:
-- @paramdeclares each parameter with its type, an optional default and a description; lists work too. A wrong or missing value runs nothing. See Arguments and parameters. - The Scripts Library: one folder, searched with
LIB FIND, listed withLIB LISTandLIB TREE, checked withLIB LINT, with safe deletion and a revision history in the BroadSQL Editor. Start from the Scripts Gallery. - Error control and output:
ON ERROR STOP,ECHO,OUTPUT QUIET, andDUMP LIB, which exports a Script's result only when it succeeds. - JavaScript Experimental: a short script can hold several connections open, loop and branch. See JavaScript scripting.
A console that helps you type
- Tab completion: commands, SQL keywords, schemas, tables and columns, connection IDs, Environments, Scripts, API endpoints and file paths.
- History and shortcuts: the last 1,000 commands kept across sessions and searchable with Ctrl+R; Esc to cancel a statement; Ctrl+C to stop a running query without losing the connection. See the keyboard shortcuts and the cheat sheet.
- Readable output: syntax highlighting, color themes for dark and light terminals, and result tables that fit the width of your window.
- An activity log: every command and its output, per connection and per day, when you turn it on. See Command activity log.
Exploring any database
- Structure: columns, primary keys, foreign keys, incoming references and indexes of a table, with
DESCR,SHOW PK,SHOW FK,SHOW REFERENCESandSHOW INDEXES. - Search by name:
FIND COLUMN,FIND FKandFIND INDEXfind columns, foreign keys and indexes by part of their name. See Exploring a database. - Compare:
COMPARE TABLE STRUCTUREcompares the columns of a table with the same table in another connection.
API Client Experimental
- Call the APIs in front of your data from the same prompt:
CONNECT API, thenRUNan endpoint by its URL, with the authentication it defines. - Bruno collections: import an existing collection; export results with
DUMP API RESULT. See Universal API Client.
Extensions
- Your own commands: write a command in Java and drop the JAR into
extensions/. It gets direct access to the console, the active connection and the command interpreter, and behaves like a built-in command. See Extending BroadSQL. - For your organization's own checks: a naming-convention linter, a reconciliation check against an internal API, a shortcut for a query pattern your team runs every week.
Looking for the exact syntax of a command? See the command reference. Ready to try it? Get started or download the latest release.