SDKs & ToolsCLI

spiral sql

Run DataFusion SQL and SPQL functions

Install spiral-sql to run this command. spiral sql forwards arguments to spiral-sql; both commands run DataFusion SQL.

Run DataFusion SQL and SPQL functions locally. With no SQL input in a terminal, start an interactive session with history and multiline editing; end SQL with a semicolon, and use .quit or Ctrl-D to exit. Supply SQL as a positional argument, with --command, with --file, or through standard input. Use --project to read and write Spiral Tables; --branch selects the publication branch. Statements in a script run sequentially and stop on the first error. Successful writes publish independently; a later error does not roll them back.

Usage: spiral sql [OPTIONS] [QUERY]

Arguments

ArgumentRequiredDefaultDescription
QUERYnoSQL text to execute

Options

OptionRequiredDefaultDescription
-c, --command <COMMAND>noSQL text to execute
-f, --file <PATH>noRead SQL from a file; use - for standard input
-p, --project <PROJECT>noProject whose Tables are available by resource path
--branch <BRANCH>noBranch to read and publish to; defaults to main
--format <FORMAT>notableResult format. JSON emits one array per statement; table output prints batches
Found a problem? Edit this page or report an issue.