duckdb mydb.duckdb -c "SELECT count(*) FROM users;"
Category: Databases & SQL
duckdb mydb.duckdb -c "SELECT count(*) FROM users;"
Run a query and exit
-c executes the statement and exits, which fits scripts; -s does the same, and -f runs a file of SQL. Related: positional SQL argument.