/better-duck-skills:better-duckfrom better-duck-skills
Task router for the better-duck DuckDB driver for Rust. Routes to per-crate skills for connections, queries, UDFs, Diesel ORM, and Tauri plugin.
Ships in better-duck-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
better-duck is a Rust driver for DuckDB built directly on DuckDB's C API via
FFI. It favors a lean dependency tree and row-oriented access, with opt-in features for Arrow, Polars,
columnar chunks, async, pooling, user-defined functions, derives, a Diesel ORM backend, and a Tauri
plugin. DuckDB is compiled and embedded by default (no system install).
This skill is the map. Jump to the focused skill for real work:
| You are… | Skill |
|---|---|
| Writing SQL / reasoning about DuckDB types, dialect, extensions | duckdb |
| Using the driver's Rust API (connect, query, types, appender, pool, async, arrow, columnar) | better-duck-core |
| Writing UDFs or deriving row/struct/enum mappings | better-duck-macros |
| Using the Diesel ORM backend | better-duck-diesel |
| Exposing DuckDB to a Tauri v2 webview | better-duck-tauri |
| Crate | Purpose |
|---|---|
better-duck-core | The driver: connections, queries, types, transactions, appender, pool, async, arrow/polars, columnar, extensions, UDF runtime. |
better-duck-macros | Proc macros powering UDFs (#[duckdb_scalar], …) and derives (FromRow, …). Pulled in via core's udf/derive features — not depended on directly. |
better-duck-diesel | Diesel 2.3 backend (DuckDbConnection), DuckDB SQL DSL, type mapping, UDF calls through the DSL. |
better-duck-tauri | Tauri v2 plugin exposing DuckDB to the webview (core or diesel backend). |
better-duck-sys | Low-level FFI + vendored DuckDB. Rarely used directly. |
The crate published as
better-duckon crates.io isbetter-duck-core.
default = ["chrono", "decimal"]. Pre-release versions are excluded by Cargo's default version
match — pin the exact version (e.g. better-duck-core = "0.1.0-beta.8").
| Feature | What it enables |
|---|---|
chrono (default) | chrono date/time ↔ DATE/TIME/TIMESTAMP/TIMESTAMPTZ/INTERVAL |
decimal (default) | rust_decimal::Decimal ↔ DECIMAL |
json, parquet, icu | bundle the matching DuckDB extension into the static lib |
arrow | export results via the Arrow C Data Interface (no added deps) |
columnar | columnar data-chunk read/write: fetch_chunk, zero-copy as_slice, build-and-bulk-insert (also enabled by udf) |
udf | #[duckdb_scalar] / #[duckdb_table_function] / #[duckdb_aggregate] / #[duckdb_cast] |
derive | #[derive(FromRow/ToRow/DuckEnum/DuckStruct)] + transaction! / params! |
async | Tokio facade (AsyncConnection, AsyncDatabase, AsyncPool) |
pool | r2d2 connection pool over a shared Database |
time, uuid | time crate temporals / uuid::Uuid interop |
[dependencies]
better-duck-core = "0.1.0-beta.8"
use better_duck_core::connection::Connection;
fn main() -> better_duck_core::error::Result<()> {
let mut conn = Connection::open_in_memory()?;
conn.execute_batch("CREATE TABLE t (id INTEGER, name VARCHAR)")?;
conn.execute_with("INSERT INTO t VALUES ($1, $2)", &mut [&mut 1_i32, &mut "ada"])?;
let mut rows = conn.execute("SELECT id, name FROM t")?;
let row = rows.next().unwrap()?;
assert_eq!(row.get("name"), Some(&better_duck_core::types::value::DuckValue::text("ada")));
Ok(())
}
SELECT/WHERE → scalar UDF (#[duckdb_scalar], see better-duck-macros).FROM → table UDF (#[duckdb_table_function]).Appender (better-duck-core), not row-by-row INSERT.columnar feature's fetch_chunk + as_slice.better-duck-diesel.better-duck-tauri.#[derive(FromRow)] / #[derive(ToRow)] (better-duck-macros).better_duck_core::error::{Error, Result}; most calls return Result<_>.better_duck_core::types::value::DuckValue; rows are iterated from a DuckResult.Connection, Appender, UDF macros) over better-duck-sys FFI.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub nimdeveloper/better-duck --plugin better-duck-skills6 skills in this plugin
/better-duck-coreRust API guide for the better-duck-core crate (the embedded DuckDB driver published as better-duck): opening connections, executing SQL, iterating rows and values, parameter binding, bulk insert, columnar chunks, transactions, pooling, async, and Arrow/Polars interop. Use when writing Rust against better-duck-core — Connection, execute, execute_with, execute_with_named, DuckResult / DuckValue, Appender, fetch_chunk, TableDescription, Database — or when choosing a Cargo flag feature = "chrono|decimal|arrow|polars|columnar|udf|async|pool|time|uuid" (plus json / parquet / icu for bundled extensions, and derive). For DuckDB SQL and engine behavior use the duckdb skill; for the UDF and data-derive macros use better-duck-macros./better-duck-dieselThe Diesel 2.3 ORM backend for DuckDB, built on better-duck. Use when working with the `better-duck-diesel` crate: establishing a `DuckDbConnection`, defining a `table!` schema, running INSERT/SELECT/UPDATE/DELETE/RETURNING or transactions through Diesel, mapping Rust types to DuckDB column types, or reaching DuckDB-only SQL that Diesel core omits via `use better_duck_diesel::dsl::*;` (ILIKE/SIMILAR TO/GLOB/regex operators; string, numeric, regex, date/time, JSON, list and map functions; general/statistical/approximate/bit aggregates). Also covers calling your `#[duckdb_*]` UDFs through the DSL with no raw SQL (`feature = "udf"`), spatial `ST_*` functions (`feature = "spatial"`), ORM-emitting data derives (`feature = "derive"`), and r2d2 pooling. Triggers: `better-duck-diesel`, Diesel + DuckDB, `DuckDbConnection`, `better_duck_diesel::dsl`, `feature = "udf"|"derive"|"spatial"`./better-duck-macrosProc-macro surface of the better-duck-macros crate — DuckDB user-defined functions and data derives — consumed through better-duck-core's `feature = "udf"` and `feature = "derive"` (and better-duck-diesel's `derive`), never by depending on better-duck-macros directly. Use when writing or registering a UDF with `#[duckdb_scalar]`, `#[duckdb_table_function]`, `#[duckdb_aggregate]`, `#[duckdb_cast]`, or `#[duckdb_entrypoint]`; when mapping Rust types with `#[derive(FromRow|ToRow|DuckEnum|DuckStruct)]`; when reaching for the `transaction!` / `params!` helper macros; or when choosing/debugging their attribute options (`name`, `columns`, `named_params`, `projection_pushdown`, `state`, `volatile`, `rename_all`)./better-duck-tauriThe better-duck-tauri crate: a Tauri v2 plugin that exposes better-duck (embedded DuckDB) to the webview as a local analytics engine. Use when registering the plugin in `tauri::Builder`, choosing a backend Cargo feature (`feature = "backend-core"` default, `feature = "backend-diesel"`, or `feature = "arrow"`), calling the webview commands (`load`/`close`/`select`/`execute`, plus import/export/append/stream/checkpoint/revert) from JS/TS via `@better-duck/tauri`, wiring Tauri capabilities/permissions and the scope + policy security model, defining startup migrations, or configuring WAL checkpoint strategies. Triggers: "Tauri", "webview", the crate name, the command names, or the backend/arrow feature flags./duckdbDuckDB engine knowledge for driving it from Rust through better-duck: the SQL dialect, the DuckDB type system and how each type maps to driver values, extensions (json, parquet, icu, spatial), and runtime behaviors (transactions, appender semantics, named/positional parameters, replacement scans). Use when writing SQL for DuckDB, choosing or reasoning about a DuckDB column type, loading an extension, or diagnosing DuckDB-specific behavior seen through the better-duck driver.