Expand description
File system access (DuckDB 1.5.0+).
This module exposes DuckDB’s virtual file system (VFS) to extensions, so a
custom table function, replacement scan, or copy function can read and write
files through the same abstraction DuckDB uses internally. That means
transparently honouring httpfs (s3://, http://), in-memory files, and
any other registered file system — rather than reaching for std::fs and
only ever seeing local disk.
§Obtaining a FileSystem
Get one from a ClientContext (which you can obtain from most function
callbacks):
use quack_rs::client_context::ClientContext;
use quack_rs::file_system::{FileOpenOptions, FileSystem};
let fs = FileSystem::from_client_context(ctx)?;
let opts = FileOpenOptions::read_only();
let handle = fs.open(c"data.csv", &opts).ok()?;
let mut contents = Vec::new();
handle.read_to_end(&mut contents).ok()?;Structs§
- File
Handle - RAII wrapper for an open
duckdb_file_handle. - File
Open Options - RAII wrapper for
duckdb_file_open_options. - File
System - RAII wrapper for a
duckdb_file_system.
Enums§
- File
Flag - A file-open mode flag, mirroring
duckdb_file_flag.