You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-4Lines changed: 37 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,38 @@ fn main() -> Result<()> {
77
77
}
78
78
```
79
79
80
+
## Feature flags
81
+
82
+
The `duckdb` crate provides a number of Cargo features that can be enabled to add functionality:
83
+
84
+
### Virtual tables and functions
85
+
86
+
-`vtab` - Base support for creating custom table functions and virtual tables.
87
+
-`vtab-arrow` - Apache Arrow integration for virtual tables. Enables conversion between Arrow RecordBatch and DuckDB data chunks.
88
+
-`vtab-excel` - Read Excel (.xlsx) files directly in SQL queries with automatic schema detection.
89
+
-`vtab-loadable` - Support for creating loadable DuckDB extensions. Includes procedural macros for extension development.
90
+
-`vscalar` - Create custom scalar functions that operate on individual values or rows.
91
+
-`vscalar-arrow` - Arrow-optimized scalar functions for vectorized operations.
92
+
93
+
### Data integration
94
+
95
+
-`json` - Enables reading and writing JSON files. Requires `bundled`.
96
+
-`parquet` - Enables reading and writing Parquet files. Requires `bundled`.
97
+
-`appender-arrow` - Efficient bulk insertion of Arrow data into DuckDB tables.
98
+
-`polars` - Integration with Polars DataFrames.
99
+
100
+
### Convenience features
101
+
102
+
-`vtab-full` - Enables all virtual table features: `vtab-excel`, `vtab-arrow`, and `appender-arrow`.
103
+
-`extensions-full` - Enables all major extensions: `json`, `parquet`, and `vtab-full`.
104
+
-`modern-full` - Enables modern Rust ecosystem integrations: `chrono`, `serde_json`, `url`, `r2d2`, `uuid`, and `polars`.
105
+
106
+
### Build configuration
107
+
108
+
-`bundled` - Uses a bundled version of DuckDB's source code and compiles it during build. This is the simplest way to get started and avoids needing DuckDB system libraries.
109
+
-`buildtime_bindgen` - Use bindgen at build time to generate fresh bindings instead of using pre-generated ones.
110
+
-`loadable-extension` - _Experimental_ support for building extensions that can be dynamically loaded into DuckDB.
111
+
80
112
## Notes on building duckdb and libduckdb-sys
81
113
82
114
`libduckdb-sys` is a separate crate from `duckdb-rs` that provides the Rust
@@ -103,7 +135,8 @@ You can adjust this behavior in a number of ways:
103
135
# Assume that version DuckDB version 0.9.2 is used.
104
136
duckdb = { version = "0.9.2", features = ["bundled"] }
105
137
```
106
-
* When linking against a DuckDB library already on the system (so *not* using any of the `bundled` features), you can set the `DUCKDB_LIB_DIR` environment variable to point to a directory containing the library. You can also set the `DUCKDB_INCLUDE_DIR` variable to point to the directory containing `duckdb.h`.
138
+
139
+
* When linking against a DuckDB library already on the system (so _not_ using any of the `bundled` features), you can set the `DUCKDB_LIB_DIR` environment variable to point to a directory containing the library. You can also set the `DUCKDB_INCLUDE_DIR` variable to point to the directory containing `duckdb.h`.
107
140
* Installing the duckdb development packages will usually be all that is required, but
108
141
the build helpers for [pkg-config](https://github.com/alexcrichton/pkg-config-rs)
109
142
and [vcpkg](https://github.com/mcgoo/vcpkg-rs) have some additional configuration
@@ -118,11 +151,11 @@ declarations from DuckDB's C header file. `bindgen`
118
151
running this as part of the build process of libraries that used this. We tried
119
152
this briefly (`duckdb` 0.10.0, specifically), but it had some annoyances:
120
153
121
-
* The build time for `libduckdb-sys` (and therefore `duckdb`) increased
154
+
- The build time for `libduckdb-sys` (and therefore `duckdb`) increased
122
155
dramatically.
123
-
* Running `bindgen` requires a relatively-recent version of Clang, which many
156
+
- Running `bindgen` requires a relatively-recent version of Clang, which many
124
157
systems do not have installed by default.
125
-
* Running `bindgen` also requires the DuckDB header file to be present.
158
+
- Running `bindgen` also requires the DuckDB header file to be present.
126
159
127
160
So we try to avoid running `bindgen` at build-time by shipping
0 commit comments