forked from duckdb/duckdb-r
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
165 lines (126 loc) · 9.69 KB
/
Copy pathREADME.Rmd
File metadata and controls
165 lines (126 loc) · 9.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
output:
github_document:
html_preview: false
md_extensions: "-smart"
pandoc_args: ["--wrap=preserve"]
---
```{r setup, include = FALSE}
# README.md and .github/README.md are both written from this file, and differ
# by the banner alone. GitHub reads .github/README.md in preference to the
# root one, so that is where the wordmark goes; pkgdown reads the root one and
# already puts the package logo in its own header, where a second logo is one
# too many.
#
# The banner sits in .github/, one directory down, so its paths climb out.
knitr::knit_hooks$set(document = function(x, options) {
doc <- paste(x, collapse = "\n")
front <- strsplit(doc, "<!-- banner:start -->\n", fixed = TRUE)[[1]]
rest <- strsplit(front[[2]], "<!-- banner:end -->\n\n", fixed = TRUE)[[1]]
if (length(front) != 2L || length(rest) != 2L) {
stop("README.Rmd: expected one banner:start and one banner:end marker")
}
# front[[1]] is the YAML, rest[[1]] the banner, rest[[2]] the shared body.
# The blank line between them is load-bearing: without it the heading below
# is swallowed into the banner's HTML block instead of being a heading.
writeLines(paste0(rest[[1]], "\n", rest[[2]]), ".github/README.md")
paste0(sub("\n+$", "\n", front[[1]]), rest[[2]])
})
```
<!-- banner:start -->
<div align="center">
<a href="https://r.duckdb.org/"><picture>
<source media="(prefers-color-scheme: light)" srcset="../man/figures/DuckDB_Logo-horizontal.svg">
<source media="(prefers-color-scheme: dark)" srcset="../man/figures/DuckDB_Logo-horizontal-dark-mode.svg">
<img alt="DuckDB logo" src="../man/figures/DuckDB_Logo-horizontal.svg" height="100">
</picture></a>
</div>
<!-- banner:end -->
# duckdb
[DuckDB](https://duckdb.org/) is an in-process SQL OLAP database management system.
It is designed to support analytical query workloads and is optimized for fast query execution.
This repository contains the R bindings for DuckDB.
## Installation from CRAN
This is the recommended method for recent R versions on Windows or macOS which have binaries available on CRAN.
``` r
install.packages("duckdb")
```
For Linux or older R versions, installing the package from source may take up to an hour.
Consider the [Posit Public Package Manager](https://p3m.dev/) or [r-universe](https://duckdb.r-universe.dev) for binary installs (see the next sections).
## Installation from the Posit Public Package Manager
This repository serves binary builds of CRAN packages for a wide variety of platforms.
Follow setup instructions from <https://p3m.dev/client/#/repos/cran/setup>.
For example, to install the ManyLinux version of duckdb that is likely to work on your Linux, use:
``` r
install.packages("duckdb", repos = sprintf(
"https://p3m.dev/cran/latest/bin/linux/manylinux_2_28-%s/%s", R.version["arch"], substr(getRversion(), 1, 3)
))
```
To check the availability of binaries for your platform, navigate to the [duckdb search page](https://p3m.dev/client/#/repos/cran/packages/overview?search=duckdb).
## Installation from r-universe
This repository serves development versions.
Binaries are available for recent versions of R and for some platforms.
Review <https://docs.r-universe.dev/install/binaries.html> for configuring installation of binary packages on Linux.
``` r
install.packages("duckdb", repos = c("https://duckdb.r-universe.dev", "https://cloud.r-project.org"))
```
Installing the package from source may take up to an hour.
## Installation from GitHub
``` r
# install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))
pak::pak("duckdb/duckdb-r")
```
Installing the package from GitHub may take up to an hour.
## Flavors
The sources in this repository are published under several names —
`duckdb` on CRAN,
and every flavor on [r-universe](https://duckdb.r-universe.dev/builds).
The `.dev` flavors are created by an automated vendoring process;
the CRAN and LTS flavors always point at a stable upstream release.
| Flavor | Series | Kind | Progress |
|---|---|---|---|
| `duckdb` | [`v1.5-variegata`](https://github.com/duckdb/duckdb/tree/v1.5-variegata) | CRAN | [](https://cran.r-project.org/package=duckdb) |
| `duckdb.1.4` | [`v1.4-andium`](https://github.com/duckdb/duckdb/tree/v1.4-andium) | LTS | [](https://duckdb.r-universe.dev/duckdb.1.4) |
| `duckdb.dev` | [`main`](https://github.com/duckdb/duckdb/tree/main) | dev | [](https://github.com/krlmlr/duckdb-r/compare/main...main-green) [](https://github.com/krlmlr/duckdb-r/compare/main-green...main-dev) [](https://github.com/krlmlr/duckdb-r/compare/main-build-base...main-build) |
| `duckdb.1.5.dev` | [`v1.5-variegata`](https://github.com/duckdb/duckdb/tree/v1.5-variegata) | dev | [](https://github.com/krlmlr/duckdb-r/compare/main...v1.5-variegata-green) [](https://github.com/krlmlr/duckdb-r/compare/v1.5-variegata-green...v1.5-variegata-dev) [](https://github.com/krlmlr/duckdb-r/compare/v1.5-variegata-build-base...v1.5-variegata-build) |
| `duckdb.1.4.dev` | [`v1.4-andium`](https://github.com/duckdb/duckdb/tree/v1.4-andium) | dev | [](https://github.com/krlmlr/duckdb-r/compare/v1.4-andium...v1.4-andium-green) [](https://github.com/krlmlr/duckdb-r/compare/v1.4-andium-green...v1.4-andium-dev) [](https://github.com/krlmlr/duckdb-r/compare/v1.4-andium-build-base...v1.4-andium-build) |
The badges track each `.dev` series:
*ahead* counts commits ahead of the branch the series releases from,
*in flight* counts commits in CI but not yet trusted,
*buffered* counts commits vendored but not yet verified.
See the handbook's
[`branches/`](https://github.com/duckdb/duckdb-r/blob/main/handbook/branches/README.md)
for the full model.
## User Guide
See the [R API in the DuckDB documentation](https://duckdb.org/docs/api/r).
## Documentation
Everything this repository documents is reachable from the
[handbook](https://github.com/duckdb/duckdb-r/blob/main/handbook/README.md),
a strict topic hierarchy;
[`AGENTS.md`](https://github.com/duckdb/duckdb-r/blob/main/AGENTS.md)
is the door for maintainers and coding agents, and
[`plan/README.md`](https://github.com/duckdb/duckdb-r/blob/main/plan/README.md)
names the designs, plans, and historical documents.
[`BRANCHES.md`](https://github.com/duckdb/duckdb-r/blob/main/BRANCHES.md) and
[`scripts/VENDORING.md`](https://github.com/duckdb/duckdb-r/blob/main/scripts/VENDORING.md)
hold detail the handbook is still absorbing.
## Building
To build the R package, you first need to clone this repository and install the dependencies:
``` r
# install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))
pak::pak()
```
Then, install:
``` sh
~duckdb-r: R CMD INSTALL .
```
Set the `MAKEFLAGS` environment variable to `-j8` or similar for parallel builds.
Configure `ccache` for faster repeated builds.
A build that links a prebuilt engine and finishes in seconds,
and other details, are described in the handbook under
[`build/`](https://github.com/duckdb/duckdb-r/blob/main/handbook/build/README.md).
## Vendoring
This package includes a vendored copy of the DuckDB C++ library. The vendoring process is automated — a scheduled routine synchronizes each release series with the upstream DuckDB repository, commit by commit. How it works, and how to vendor by hand, is in the handbook under [`operations/vendoring/`](https://github.com/duckdb/duckdb-r/blob/main/handbook/operations/vendoring/README.md).
## Contributors
Thanks to all [contributors](https://github.com/duckdb/duckdb-r/graphs/contributors) to this repository, and to those who contributed when the code was still hosted in the main [duckdb/duckdb](https://github.com/duckdb/duckdb) repository:
Mark Raasveldt, Pedro Holanda, Tom Ebergen, Reijo Sund, Nicolas Bennett, Patrik Schratz, Tishj, Laurens Kuiper, Sam Ansmink, Andy Teucher, Hadley Wickham, Jonathan Keane, Lindsay Wray, Richard Wesley, Elliana May, Edwin de Jonge, Dewey Dunnington, Carlo Piovesan, Andre Beckedorf, Tania Bogatsch, Pedro Ferreira, Maximilian Girlich, James Lamb, James Atkins, usurai, Ubuntu, Noam Ross, Michael Antonov, Jeroen Ooms, Jamie Lentin, Jacob, and Chilarai.