Skip to content

Command Line

Attaching to HTTPS Databases in v1.5.2

DuckDB v1.5.2 has a known issue where opening an HTTPS database directly from the command line fails with an error during httpfs extension autoloading:

Terminal window
duckdb https://blobs.duckdb.org/data/tpch-sf1.db
Terminal window
Extension Autoloading Error:
An error occurred while trying to automatically install the required extension 'httpfs':
Initialization function "httpfs_duckdb_cpp_init" from file ".../.duckdb/extensions/v1.5.2/osx_arm64/httpfs.duckdb_extension" threw an exception:
"Schema with name main does not exist!"

To work around this, prefix the URL with duckdb::

Terminal window
duckdb duckdb:https://blobs.duckdb.org/data/tpch-sf1.db

Piped Scripts Not Running in v1.5.0

On Linux and macOS, DuckDB v1.5.0 has a known issue that the command line client does not interpret piped scripts (#21243).

To demonstrate the problem, create a test.sql file:

Terminal window
echo "SELECT 42 AS x;" > test.sql

Piping the file to the DuckDB 1.5.0 CLI client does not run the script:

Terminal window
duckdb < test.sql
# does not run the script

To work around this, add | cat to the end of the call:

Terminal window
duckdb < test.sql | cat
┌───────┐
│ x │
│ int32 │
├───────┤
│ 42 │
└───────┘

If you are piping from a file, you can also use the -f argument:

Terminal window
duckdb -f test.sql
┌───────┐
│ x │
│ int32 │
├───────┤
│ 42 │
└───────┘