Results of 1 - 7 of about 7 for crate (0.001 sec.)
- Troubleshoot 11887
- Overview This page collects common issues encountered when using the DuckDB Rust client, together with their workarounds. If you run into a problem that is not covered here, search the client's issue tracker on GitHub. Linking against a Sys
...tem Library The bundled feature compiles DuckDB from the source shipped with the crate, so nothing else is needed to build, and it is the simplest choice for most applications. Without bundled , the underlying...libduckdb-sys crate links against a DuckDB library already on the system, which it locates through pkg-config or, on the MSVC ABI, Vcpkg . If...Build Download a Library Set DUCKDB_DOWNLOAD_LIB=1 and the build script downloads the prebuilt DuckDB library matching the crate's version from GitHub Releases, caches it under target/ , and adds it to the linker search path. Leave DUCKDB_STATIC unset... - https://man.mtool.work/duckdb/2.0/clients/rust/troubleshoot.html
- Rust Client 11305
- Installation To use the DuckDB Rust client, visit the Rust installation page . The latest stable version of the DuckDB Rust client is 2.0.0. The DuckDB Rust client, duckdb-rs , is an ergonomic wrapper over the DuckDB C API that exposes an i
...her pages in this section cover connecting and each feature in detail. Installation The DuckDB Rust client is published on crates.io . The full API is documented on docs.rs . Add it to a project with cargo , enabling the bundled feature so that DuckDB...ired: cargo add duckdb --features bundled The equivalent Cargo.toml entry pins the version. Starting with DuckDB 1.5.0 the crate version has the form 1.⟨major_minor_patch⟩.x . A tilde requirement receives patch releases without changing the bundled Du...1.20000.0", features = ["bundled"] } The bundled feature is the simplest way to get started. Without it, the libduckdb-sys crate links against a system DuckDB library instead of compiling one, which is covered in Troubleshoot . To track the latest bin... - https://man.mtool.work/duckdb/2.0/clients/rust/overview.html
- Handle Results 9905
- Overview Beyond reading a result set row by row , the Rust client can hand a query result to Apache Arrow as a stream of record batches, register an Arrow batch as a queryable table, and return results as Polars data frames. Each of these c
...cribed below. Apache Arrow DuckDB is columnar, and its native way to return a result to Rust in bulk is Apache Arrow . The crate re-exports the arrow crate, so no separate Arrow dependency or version alignment is required: reach the Arrow types throug...tion, and pass the batch as a query parameter with arrow_recordbatch_to_query_params() . The following is adapted from the crate's arrow_vtab example : use duckdb::{Connection, arrow::record_batch::RecordBatch}; use duckdb::vtab::arrow::{arrow_recordb...ect(); To combine the chunks into a single DataFrame , use accumulate_dataframes_vertical_unchecked from polars_core . The crate re-exports polars , so its types are also reachable through duckdb::polars . Further Reading Run Queries — sending the que... - https://man.mtool.work/duckdb/2.0/clients/rust/result_handling.html
- Write User Defined Functions 8160
- Overview The Rust client can register user-defined functions written in Rust: scalar functions with the vscalar feature and table functions with the vtab feature. Both operate on DuckDB's columnar data chunks, so a single call processes a b
...k. signatures() declares the argument and return types. The following defines add_one(BIGINT) -> BIGINT , adapted from the crate's vscalar example . It reads the single BIGINT argument as a slice of i64 and writes each result into the output vector: u...e scan is done, so a large result is delivered over several calls. parameters declares the function's parameter types. The crate's vtab example defines a numbers(BIGINT) function that returns one row per integer in 0..count , over columns of increasin.... This uses the loadable-extension feature and the duckdb_entrypoint_c_api macro to declare the extension entry point. The crate's hello-ext example registers a hello(name) table function this way. Warning Enable loadable-extension only when building... - https://man.mtool.work/duckdb/2.0/clients/rust/functions.html
- Import Data 7815
- Overview The Rust client offers two ways to get data into DuckDB in bulk: the high-performance Appender for inserting rows from Rust, and reading directly from data files such as Parquet, CSV, and JSON. Both are described below. Appender Th
...ommit on drop, and create the appender from the transaction. The following bulk-inserts ten million rows, adapted from the crate's appender example : use duckdb::{params, Connection, DropBehavior, Result}; fn main() -> Result<()> { let mut db = Connec...The Rust client just sends the query. For Parquet , enable the parquet feature and query read_parquet() , adapted from the crate's parquet example : use duckdb::{Connection, Result}; use duckdb::arrow::record_batch::RecordBatch; let conn = Connection:... - https://man.mtool.work/duckdb/2.0/clients/rust/data_import.html
- Run Queries 7579
- Overview A Connection runs SQL through two families of methods: The execute_* methods ( execute() and execute_batch() ) send statements that do not return rows, such as INSERT or DDL, and report the number of affected rows. The query_* meth
...), )?; Any value bound as a parameter implements the ToSql trait, and any value read out of a row implements FromSql . The crate provides both for the standard Rust numeric, string, byte-slice, and boolean types. Option<T> maps to and from SQL NULL ,...{ println!("Found person {person:?}"); } Columns can also be read by name with row.get("name") . This example follows the crate's basic example . Reading a Single Row When a query returns exactly one row, Connection::query_row() runs it and applies a... - https://man.mtool.work/duckdb/2.0/clients/rust/querying.html
- Connect 6888
- Overview Every DuckDB feature reachable from Rust starts with a Connection . Opening in-memory and file-backed databases, configuring a database instance with Config , opening read-only, pooling connections across threads, the crate's threa
... - https://man.mtool.work/duckdb/2.0/clients/rust/connecting.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work