QueryBuilder CLI allows users to run SQL queries on CSV/Excel files locally. There are two modes:

  1. Static CLI with command-line arguments (main_cli)
  2. Interactive CLI (qb_cli) with a terminal-style interface

1. Static CLI (argparse)

The static CLI allows executing queries directly from the command line without entering an interactive shell.

Usage

python -m frontend.cli.cli_static [OPTIONS]

Options

Option Alias Description
--file -f Path to CSV/Excel file
--query -q SQL query to execute
--db_engine -db SQL engine to use (sqlite, duckdb, auto)
--cleanup - Cleanup database after execution
--store -s Save query results to result_set.csv

Examples

  1. Run a query on a CSV using SQLite
python -m frontend.cli.cli_static -f data.csv -q"SELECT * FROM table LIMIT 10" -db sqlite
  1. Run a query and save results
python -m frontend.cli.cli_static -f data.csv -q"SELECT * FROM table" -s

  1. Run query and cleanup afterwards
python -m frontend.cli.cli_static -f data.csv -q"SELECT * FROM table" --cleanup

Notes: