Skip to main content Link Menu Expand (external link) Document Search Copy Copied

How do I run SQL queries from the command-line?

The fbsql Command Line Interface tool for Linux and MacOS systems supports:

  • API-key and user authenticated connections to FeatureBase databases
  • SQL statements input via text files or the fbsql interface
  • meta-commands to control output and task scripting and automation

Before you begin

How do I install or upgrade fbsql?

How do I open and quit the fbsql interface?

Task Actions
Open fbsql interface * Open a CLI
* Enter fbsql
Quit the fbsql interface \q or \quit at the =# prompt

How do I connect to a FeatureBase database?

How do I run SQL queries?

Run SQL queries in the fbsql interface or using text files:

How do I format SQL query output?

PSET (Print Set) meta-commands alter default output formatting for SQL queries for:

How do I change other output settings?

fbsql output can be configured from the command-line or fbsql interface to:

  • direct CLI and interface history to a new directory
  • change the working directory
  • create a file to output SQL query results and comments

  • fbsql output reference

How do I import data using fbsql?

Further information