--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: hostfs excerpt: | DuckDB Community Extensions Navigate and explore the filesystem using SQL extension: name: hostfs description: Navigate and explore the filesystem using SQL version: 0.0.3 language: C++ build: cmake license: MIT maintainers: - Gropaul repo: github: gropaul/hostFS ref: 29017b23edd9bed0cbd9847c9ba76b84427df1f7 docs: hello_world: | -- Navigate to the workspace and list the files D PRAGMA cd('/Users/paul/workspace'); D PRAGMA ls; ┌───────────────────────────────┐ │ path │ │ varchar │ ├───────────────────────────────┤ │ ./duckdb │ │ ./playground │ │ ./hostfs │ -- Find the files you were working on last D SELECT path, file_last_modified(path) AS date FROM ls() WHERE 'csv' IN file_extension(path) ORDER BY date LIMIT 1 ; ┌───────────────────────────┬─────────────────────┐ │ path │ date │ │ varchar │ timestamp │ ├───────────────────────────┼─────────────────────┤ │ ./sketch_results_join.csv │ 2024-07-13 23:25:48 │ └───────────────────────────┴─────────────────────┘ -- List the top 3 file types by total size, with file count, ordered by size. D SELECT size, count, file_extension AS "type" FROM ( SELECT SUM(file_size(path)) AS size_raw, format_bytes(size_raw) AS size, COUNT(*) AS count, file_extension(path) AS file_extension FROM lsr('/Users/paul/workspace', 10) GROUP BY file_extension(path) ) AS subquery ORDER BY size_raw DESC LIMIT 3; ┌───────────┬───────┬─────────┐ │ size │ count │ type │ │ varchar │ int64 │ varchar │ ├───────────┼───────┼─────────┤ │ 246.95 GB │ 29 │ .duckdb │ │ 90.33 GB │ 3776 │ .tmp │ │ 26.17 GB │ 28175 │ .csv │ └───────────┴───────┴─────────┘ extended_description: > The HostFS extension allows you to navigate and explore the filesystem using SQL. It provides a set of functions to list files, get file metadata, and more. For more information, please see the [HostFS documentation](https://github.com/gropaul/hostFS). extension_star_count: 33 extension_star_count_pretty: 33 extension_download_count: 24603 extension_download_count_pretty: 24.6k image: '/images/community_extensions/social_preview/preview_community_extension_hostfs.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), 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 ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions
| function_name | function_type | description | comment | examples | |--------------------|---------------|-------------|---------|----------| | absolute_path | scalar | NULL | NULL | | | cd | pragma | NULL | NULL | | | cd | table | NULL | NULL | | | file_extension | scalar | NULL | NULL | | | file_last_modified | scalar | NULL | NULL | | | file_name | scalar | NULL | NULL | | | file_size | scalar | NULL | NULL | | | hostfs | scalar | NULL | NULL | | | hsize | scalar | NULL | NULL | | | is_dir | scalar | NULL | NULL | | | is_file | scalar | NULL | NULL | | | ls | pragma | NULL | NULL | | | ls | table | NULL | NULL | | | lsr | pragma | NULL | NULL | | | lsr | table | NULL | NULL | | | path_exists | scalar | NULL | NULL | | | path_separator | scalar | NULL | NULL | | | path_split | macro | NULL | NULL | | | path_type | scalar | NULL | NULL | | | pwd | pragma | NULL | NULL | | | pwd | scalar | NULL | NULL | | ### Overloaded Functions
This extension does not add any function overloads. ### Added Types
This extension does not add any types. ### Added Settings
This extension does not add any settings.