> ## Documentation Index
> Fetch the complete documentation index at: https://better-duck.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Feature Flags

> Every Cargo feature of better-duck-core — grouped, with what each enables, its implications, and recommended presets.

`better-duck-core` keeps its dependency tree lean by putting almost everything behind a Cargo
feature. This page lists **every** feature the core crate defines, grouped by purpose, with what each
turns on, which other features it implies, and when you'd reach for it.

## Defaults and opting out

The default feature set is `["chrono", "decimal"]`:

```toml theme={null}
[dependencies]
better-duck-core = "0.1.0-beta.8"   # => default = ["chrono", "decimal"]
```

Opt out of the defaults and pick features à la carte with `default-features = false`:

```toml theme={null}
[dependencies]
better-duck-core = { version = "0.1.0-beta.8", default-features = false, features = ["arrow", "udf"] }
```

<Warning>
  Pin the exact pre-release version — Cargo's default match excludes pre-releases. See
  [Installation](/guide/installation) and [Versioning](/guide/versioning-and-compatibility).
</Warning>

## Date, time & numeric types

These change which Rust type a temporal / numeric column reads as — see
[Type system](/guide/type-system#feature-flags-that-change-the-read-type).

| Feature | Default | What it enables | When to use |
| - | - | - | - |
| `chrono` | ✓ | `chrono` conversions for `DATE`, `TIME`, `TIMESTAMP`, `TIMESTAMPTZ`, `INTERVAL`. | Keep on for `chrono` types. Disable (via `default-features = false`) for the native `DuckDate` / `DuckTime` / `SystemTime` structs. |
| `decimal` | ✓ | `rust_decimal::Decimal` for `DECIMAL` columns. | Keep on for exact decimal arithmetic. Without it, `DECIMAL` surfaces as the native `DuckDecimal`. |
| `time` | — | Bind/append `time`-crate values (`Date`, `Time`, `PrimitiveDateTime`, `OffsetDateTime`, `Duration`). | You already use the `time` crate and want to bind its values directly. |
| `uuid` | — | Convert between the native `DuckUuid` and `uuid::Uuid`. | You want `uuid::Uuid` interop instead of the native type. |

<Note>
  `chrono` and the native date/time path are **mutually exclusive for the read type** — only one set
  of `DuckValue` temporal conversions compiles at a time. `time` is an independent **bind/append**
  path that coexists with either.
</Note>

## Bundled DuckDB extensions

These compile the extension straight into the embedded static library — there is **no** runtime
`INSTALL` / `LOAD`. See [Extensions](/guide/extensions) for bundled-vs-runtime guidance.

| Feature | Default | What it enables | When to use |
| - | - | - | - |
| `json` | — | Bundles DuckDB's JSON extension. | JSON functions available offline, no runtime install. |
| `parquet` | — | Bundles DuckDB's Parquet extension. | You read or write Parquet files. |
| `icu` | — | Bundles DuckDB's ICU extension (timezones / collations). **Requires a DuckDB archive re-vendored with ICU sources.** | You need full timezone and collation support. |

<Warning>
  Each bundled extension recompiles a DuckDB variant, so these features make the build noticeably
  slower. See [Installation](/guide/installation).
</Warning>

## Data interop

| Feature | Default | What it enables | Implies | When to use |
| - | - | - | - | - |
| `arrow` | — | Export results via the Arrow C Data Interface. **No new dependency** — the crate defines the ABI structs directly. | — | Hand results to an Arrow pipeline with no Arrow dependency cost. |
| `polars` | — | Polars `DataFrame` interop, bridged through the Arrow C Data Interface. Pulls in `polars` + `polars-arrow`. | `arrow` | You want results as a Polars `DataFrame`, or to query a `DataFrame` back. |
| `columnar` | — | Columnar chunk read/write: `fetch_chunk`, zero-copy `as_slice`, build-and-bulk-insert. | — | Read large results fast, or access columns zero-copy. |

<Note>
  Enabling `udf` turns the `columnar` APIs on too — they share the same vector / data-chunk
  machinery. Enable `columnar` explicitly only when you want those APIs **without** the proc-macro
  dependency `udf` pulls in. See [columnar access](/core/columnar-overview).
</Note>

## Concurrency

| Feature | Default | What it enables | When to use |
| - | - | - | - |
| `async` | — | A Tokio facade: `AsyncConnection`, `AsyncDatabase`, `AsyncPool`. Each call runs on `spawn_blocking`, so it never blocks the executor. | Async apps that must not block runtime threads on DB calls. |
| `pool` | — | An `r2d2` pool backed by a shared `Database` handle. | You want connection pooling. Combine with `async` for `AsyncPool`. |

See [async & pooling](/core/async). `async` + `pool` together unlock `AsyncPool`.

## Macros: UDFs & derives

Both come from `better-duck-macros`, reached through core — you never depend on the macros crate
directly. See [UDFs](/macros/udf-overview) and [data derives](/macros/derives-overview).

| Feature | Default | What it enables | Implies | When to use |
| - | - | - | - | - |
| `udf` | — | `#[duckdb_scalar]` / `#[duckdb_table_function]` / `#[duckdb_aggregate]` / `#[duckdb_cast]`. | `columnar` | Register plain Rust functions as DuckDB functions. |
| `derive` | — | `#[derive(FromRow / ToRow / DuckEnum / DuckStruct)]` plus the `transaction!` and `params!` macros. | — | Map structs/enums to rows and types; ergonomic transaction / parameter macros. |
| `derive-diesel` | — | Makes the data derives **additionally** emit `better_duck_diesel` `FromSql` / `ToSql` impls. | `derive` | Turned on *for* you by `better-duck-diesel/derive`; rarely by hand. Core itself gains no Diesel dependency — the emitted code resolves `::better_duck_diesel` in your crate. |

## Advanced

| Feature | Default | What it enables | Implies | When to use |
| - | - | - | - | - |
| `loadable-extension` | — | **Experimental.** Build for a loadable `.duckdb_extension`: links no DuckDB and routes every FFI call through the host's API table. Pairs with `#[duckdb_entrypoint]`. | `udf` | Writing a DuckDB extension in Rust loaded into a host DuckDB. |

<Warning>
  `loadable-extension` changes the [linking model](/guide/architecture#the-loadable-extension-inversion)
  — no DuckDB is linked in. Don't enable it for a normal embedded application.
</Warning>

## Feature implications at a glance

A few features turn others on automatically. Enabling the left turns on everything to its right:

| You enable | Also enabled |
| - | - |
| `polars` | `arrow` |
| `udf` | `columnar` |
| `derive-diesel` | `derive` |
| `loadable-extension` | `udf` → `columnar` |

## Recommended presets

<Tabs>
  <Tab title="Lean embedded">
    ```toml theme={null}
    better-duck-core = "0.1.0-beta.8"  # defaults: chrono + decimal
    ```

    The smallest useful footprint — row-oriented access with `chrono`/`rust_decimal` types.
  </Tab>

  <Tab title="Analytics / fast reads">
    ```toml theme={null}
    better-duck-core = { version = "0.1.0-beta.8", features = ["parquet", "columnar"] }
    ```

    Bundled Parquet plus zero-copy columnar reads for large results.
  </Tab>

  <Tab title="Async service">
    ```toml theme={null}
    better-duck-core = { version = "0.1.0-beta.8", features = ["async", "pool"] }
    ```

    `AsyncConnection` + `AsyncPool` for a Tokio application.
  </Tab>

  <Tab title="UDFs + mapping">
    ```toml theme={null}
    better-duck-core = { version = "0.1.0-beta.8", features = ["udf", "derive"] }
    ```

    Register Rust functions (`udf`, which also enables `columnar`) and map structs/enums (`derive`).
  </Tab>
</Tabs>

## Related

<CardGroup cols={2}>
  <Card title="Choosing an API" icon="signs-post" href="/guide/choosing-an-api">
    A decision tree for which features and crates fit your task.
  </Card>

  <Card title="Architecture" icon="sitemap" href="/guide/architecture">
    How features flow down to the vendored DuckDB in `-sys`.
  </Card>

  <Card title="Type system" icon="table-cells" href="/guide/type-system">
    How `chrono` / `decimal` / `uuid` change the read type.
  </Card>

  <Card title="Core crate" icon="rust" href="/core/opening-connections">
    The APIs these features unlock.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.