Skip to main content
Most database vendors provide their own SQL command line tools, but they vary significantly in features and usage. To simplify working with multiple databases, Wirekite provides Wiretalk - a unified SQL command line tool that works consistently across all supported databases. Wiretalk uses the same DSN/URL connection files as other Wirekite tools. If you can connect to a database using Wiretalk, the same connection file will work with other Wirekite components.

Supported Databases

Wiretalk supports all Wirekite source and target databases:

Command Line Usage

Or with a direct connection string:

Required Flags

Note: Either -c or -dsn must be provided.

Optional Flags

Interactive Mode

When run interactively (connected to a terminal), Wiretalk provides a prompt-based interface with command history.

Example Session

Escape Commands

Wiretalk provides several escape commands for controlling output and behavior:

CSV Format Configuration

The \c command configures CSV output format with four parameters:
Available separator tokens:
  • QUOTE - single quote (')
  • DOUBLEQUOTE - double quote (")
  • COMMA - comma (,)
  • SPACE - space character
  • TAB - tab character
  • PIPE - pipe (|)
  • NONE - no character
  • NEWLINE - newline (\n)
  • CRLF - carriage return + newline (\r\n)
  • Any other literal character
Example:

Non-Interactive Mode

Wiretalk can execute SQL from files or stdin in non-interactive mode:

JSON Output Mode

For programmatic integration, use -json to get structured output:
Output:
Each statement produces a JSON object with:
  • index - statement number (1-based)
  • sql - the executed SQL
  • status - OK or FAILED
  • error - error message (only if status is FAILED)
  • lineNum - line number in input

Database-Specific Features

Oracle PL/SQL Blocks

Oracle PL/SQL blocks (starting with BEGIN or DECLARE) are terminated by a / on its own line:

Google Cloud Spanner Batch DDL

Spanner requires DDL statements to be batched together. Wiretalk supports this with special commands:

Notes

  • Command history is saved to ~/.linerhistory
  • Multi-line SQL statements are supported - statements are executed when a semicolon is encountered
  • For PostgreSQL, sslmode=disable is automatically added if not specified
  • SQL Server PRINT output from stored procedures is captured and displayed