Skip to content

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.

Terminal window
dbcode open -c prod orders
dbcode open -c prod sales.orders
dbcode open -c prod --type procedure calc_totals
  • -c names a saved connection, by name or id. Any saved connection works, including ones the CLI cannot query itself.
  • A dotted name gives the schema. --schema and --database override the defaults.
  • Without --type, tables, views, procedures and functions are searched in that order. --type accepts 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 --preview to 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.

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.