An Excel/WPS/OpenDocument Spreadsheets file reader for DuckDB
Maintainer(s):
redraiment
Compatibility Matrix
This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
|---|---|---|---|---|---|
| Linux AMD64 | |||||
| Linux ARM64 | |||||
| macOS AMD64 | |||||
| macOS ARM64 | |||||
| Windows AMD64 | |||||
| Windows ARM64 | |||||
| WebAssembly |
Installing and Loading
INSTALL rusty_sheet FROM community;
LOAD rusty_sheet;
Example
-- Read first sheet of spreadsheet with headers
FROM read_sheet('data.xlsx');
-- Read without headers
FROM read_sheet('data.xlsx', header=false);
-- Read specific worksheet
FROM read_sheet('workbook.xlsx', sheet='Sheet2');
-- Analyze more rows (deafult 10) to detect column types
FROM analyze_sheet('data.xlsx', analyze_rows=20);
-- Override specific column types (others auto-detected)
FROM read_sheet('data.xlsx', columns={'id': 'bigint'});
-- Read specific data range (Excel-style notation)
FROM read_sheet('data.xlsx', range='A2:E100');
-- Read all worksheets in multiple file types with different extensions
FROM read_sheets(['*.xlsx', '*.ods', '*.et']);
-- Analyze with wildcard pattern
FROM analyze_sheets(['*.xlsx'], sheets=['Sheet*']);
-- Match specific worksheets only in specific file types
FROM read_sheets(['*.xlsx'], sheets=['*.xlsx=Sheet*']);
-- Track data sources with custom column names
FROM read_sheets(['*.xlsx'], file_name_column='file', sheet_name_column='sheet');
-- Union data by column name instead of position
FROM read_sheets(['*.xlsx'], union_by_name=true);
-- With custom HTTP headers: must be a persistent SECRET
CREATE PERSISTENT SECRET http_auth (TYPE HTTP, BEARER_TOKEN 'token');
FROM read_sheet('https://example.com/data.xlsx');
About rusty_sheet
The DuckDB rusty-sheet extension that enables reading Excel, WPS and OpenDocument spreadsheet files directly within SQL queries. This extension provides seamless integration for analyzing spreadsheet data using DuckDB's powerful SQL engine. For detailed setup and usage instructions, visit the docs at rusty-sheet.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| analyze_sheet | table | NULL | NULL | |
| analyze_sheets | table | NULL | NULL | |
| read_sheet | table | NULL | NULL | |
| read_sheets | table | NULL | NULL |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases | typed_value |
|---|---|---|---|---|---|
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |