Skip to content

Commit 10959b5

Browse files
committed
Add installation guide to README
[skip ci]
1 parent e2af36f commit 10959b5

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,37 @@ The `duckdb` crate provides a number of Cargo features that can be enabled to ad
119119
- `buildtime_bindgen` - Use bindgen at build time to generate fresh bindings instead of using pre-generated ones.
120120
- `loadable-extension` - _Experimental_ support for building extensions that can be dynamically loaded into DuckDB.
121121

122+
## Installation
123+
124+
### Using stable releases from crates.io
125+
126+
The recommended way to use duckdb-rs is to add it from crates.io:
127+
128+
```shell
129+
cargo add duckdb -F bundled
130+
```
131+
132+
Or manually add it to your `Cargo.toml`:
133+
134+
```toml
135+
[dependencies]
136+
duckdb = { version = "1.4.1", features = ["bundled"] }
137+
```
138+
139+
### Using the development version from git
140+
141+
To use the latest development version from the main branch, you can specify a git dependency in your `Cargo.toml`:
142+
143+
```toml
144+
# Use a specific branch
145+
duckdb = { git = "https://github.com/duckdb/duckdb-rs", branch = "main", features = ["bundled"] }
146+
147+
# Use a specific commit
148+
duckdb = { git = "https://github.com/duckdb/duckdb-rs", rev = "abc123def", features = ["bundled"] }
149+
```
150+
151+
Note: Using the main branch of duckdb-rs means you'll get the latest Rust bindings and features, but you'll still be using whatever version of DuckDB core is bundled with that commit (when using the `bundled` feature).
152+
122153
## Notes on building duckdb and libduckdb-sys
123154

124155
`libduckdb-sys` is a separate crate from `duckdb-rs` that provides the Rust
@@ -142,15 +173,15 @@ You can adjust this behavior in a number of ways:
142173

143174
```toml
144175
[dependencies]
145-
duckdb = { version = "1.3.2", features = ["bundled"] }
176+
duckdb = { version = "1.4.1", features = ["bundled"] }
146177
```
147178

148179
2. 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`.
149180

150181
Linux example:
151182

152183
```shell
153-
wget https://github.com/duckdb/duckdb/releases/download/v1.3.2/libduckdb-linux-arm64.zip
184+
wget https://github.com/duckdb/duckdb/releases/download/v1.4.1/libduckdb-linux-arm64.zip
154185
unzip libduckdb-linux-arm64.zip -d libduckdb
155186

156187
export DUCKDB_LIB_DIR=$PWD/libduckdb
@@ -163,7 +194,7 @@ You can adjust this behavior in a number of ways:
163194
macOS example:
164195

165196
```shell
166-
wget https://github.com/duckdb/duckdb/releases/download/v1.3.2/libduckdb-osx-universal.zip
197+
wget https://github.com/duckdb/duckdb/releases/download/v1.4.1/libduckdb-osx-universal.zip
167198
unzip libduckdb-osx-universal.zip -d libduckdb
168199

169200
export DUCKDB_LIB_DIR=$PWD/libduckdb

0 commit comments

Comments
 (0)