Open-Source Wikis

/

CockroachDB

/

Packages

/

CLI SQL shell library

cockroachdb/cockroach

CLI SQL shell library

The packages under pkg/cli/clisql*/ and pkg/cli/clienturl/ form a reusable SQL shell library. They are shared by cockroach sql, cockroach-sql, and a handful of internal tools that want a CockroachDB-flavored psql.

Sub-packages

Package Purpose
pkg/cli/clisqlcfg/ Config struct (URL, file outputs, format flags)
pkg/cli/clisqlclient/ Connection setup, result iterators, copy support, password prompting
pkg/cli/clisqlexec/ Command execution and result formatting (\set, \dt, …)
pkg/cli/clisqlshell/ Interactive REPL with line editing, completion, syntax highlighting
pkg/cli/clienturl/ Postgres URL resolution and certificate discovery
pkg/cli/clientflags/ Shared client flags
pkg/cli/cliflagcfg/ Flag-config glue

What you get

  • TLS or insecure connections, with automatic cert discovery.
  • The full set of psql-compatible meta-commands.
  • Multi-line statement editing with bracketed paste, syntax highlighting, and history.
  • Tab completion for statements, identifiers, and crdb_internal introspection.
  • \demo mode integration.
  • Lazy results, COPY support, and EXPLAIN ANALYZE (DEBUG) bundle download.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

CLI SQL shell library – CockroachDB wiki | Factory