Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes committed Aug 23, 2023
1 parent 1222c43 commit ccb9416
Showing 1 changed file with 2 additions and 49 deletions.
51 changes: 2 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,10 @@ install.packages("duckdb")
The default build compiles a release version from an amalgamation.

```sh
cd tools/rpkg
R CMD INSTALL .
```

Optional extensions can be enabled by passing them (comma-separated, if there is more than one) to the environment variable `DUCKDB_R_EXTENSIONS`:

```sh
DUCKDB_R_EXTENSIONS=tpch R CMD INSTALL .
```

## Development

To build the R package, you first need to install the dependencies, these are located in `tools/rpkg/dependencies.R`
Navigate over to the `tools/rpkg` folder and run `Rscript dependencies.R`

For development, setting the `DUCKDB_R_DEBUG` environment variable enables incremental debugging builds for the R package.

```sh
cd tools/rpkg
DUCKDB_R_DEBUG=1 R CMD INSTALL .
```

This also works for devtools:

```r
Sys.setenv(DUCKDB_R_DEBUG = "1")
pkgload::load_all()
```

Add the following to your `.Renviron` to make this the default:

```
DUCKDB_R_DEBUG=1
```

If you do this, remember to use `--vanilla` for building release builds.
## Dependencies

### Developing with Extensions
If you wish to build or add extensions to the R package you first need to build duckdb with the
`extension_static_build` flag and move the desired extension to a location where it won't be
modified by other build scripts. The following commands allow you to add the httpfs extension to
a duckdb R build. See the [extension ReadMe](https://github.com/duckdb/duckdb/tree/main/extension#readme) for more
information about extensions
```sh
cd duckdb/
EXTENSION_STATIC_BUILD=1 make
mv ./build/release/extension/httpfs/httpfs.duckdb_extension {{untouched_path}}/httpfs-extension.duckdb_extension
```
Then in R
```r
library(“duckdb”)
con <- DBI::dbConnect(duckdb(config=list(“allow_unsigned_extensions=true”)))
dbExecute(con, “LOAD {{untouched_path}}/httpfs-extension.duckdb_extension")
```
To build the R package, you first need to install the dependencies. Just run run `R -f dependencies.R`

0 comments on commit ccb9416

Please sign in to comment.