CLI
Open an object
dbcode open shows an object in the editor: the data for a table or view, the definition for a procedure or function, and whatever the explorer opens for anything else.
dbcode open -c prod ordersdbcode open -c prod sales.ordersdbcode open -c prod --type procedure calc_totals-cnames a saved connection, by name or id. Any saved connection works, including ones the CLI cannot query itself.- A dotted name gives the schema.
--schemaand--databaseoverride the defaults. - Without
--type, tables, views, procedures and functions are searched in that order.--typeaccepts the object kinds your database has. - Names match the way your database matches them: case-insensitive on most databases, exact on case-sensitive ones such as MongoDB.
- Each open gets its own tab. Add
--previewto open in a preview tab instead, which the next open replaces.
The editor opens if it is not running. If the name is not found or matches more than one object, the editor shows a message saying so.
Filter and sort a table
Section titled “Filter and sort a table”dbcode open -c warehouse --database sales orders \ --where "created_at >= '2026-10-14 00:00:00'" \ --order "created_at DESC, customer"--whereis a SQL condition, written as it would followWHERE. The table opens filtered, with the condition in its filter bar, where you can change or clear it.--orderlists columns separated by commas, each optionally followed byASCorDESC.ASCis the default. It replaces the usual primary-key sort.- A column name with spaces works as is:
--order "Order Date DESC". Put a name in double quotes only when it contains a comma or a double quote, or ends in the word ASC or DESC. Inside the quotes, write a double quote as"". - Column names match the way your database matches them, as object names do.
- Both apply to tables and views, and work together or on their own.
- Opening the same table with the same
--whereand--orderbrings its tab forward. Different values open another tab. - On your own machine,
dbcode openhands VS Code a link. A link with--whereasks in VS Code first, showing the table, the connection and the condition, and opens once you choose Open. In a Dev Container, Remote-SSH or WSL window it opens straight away.
Dev Containers, Remote-SSH and WSL
Section titled “Dev Containers, Remote-SSH and WSL”In a VS Code window connected to a Dev Container, an SSH host or WSL, dbcode open and dbcode introspect run in that window’s terminals, and in scripts, notebooks and debug sessions started there. They use the connections that window shows in DBCode. A failure prints on stderr with a non-zero exit code, so a script can tell. An unknown --order column, a --where that holds another statement, or --order with a --where that has its own ORDER BY or LIMIT shows its error in the opened tab instead. dbcode query and dbcode connections work there too.
Run DBCode: Install CLI in that window to put dbcode on its path.
Objects created since the last refresh
Section titled “Objects created since the last refresh”The editor looks the name up in what it last read from the database. On a connection using progressive introspection, a name that is not there makes open reread the tables and views of that one schema and look once more. On other connections it does not, and you refresh first with dbcode introspect.