-
Notifications
You must be signed in to change notification settings - Fork 7
/
README.Rmd
107 lines (77 loc) · 2.42 KB
/
README.Rmd
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# backends
<!-- badges: start -->
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
<!-- badges: end -->
List of [DBI](https://dbi.r-dbi.org) backends.
Do you maintain a backend and think that yours should be on this list?
Please open an issue in this repository.
```{r all-from-file, include = FALSE}
all_df <- jsonlite::fromJSON("docs/all.json", flatten = TRUE)
```
```{r all-url, echo = FALSE}
format_pkg <- function(name, version, title, description, date, maintainer, license, url, bugs) {
if (is.na(date)) {
date <- ""
} else {
date <- paste0(" (", date, ")")
}
if (length(url) > 0 && !anyNA(url)) {
name <- paste0("[", name, "](", url[[1]], ")")
url <- url[-1]
}
if (length(url) > 0 && !anyNA(url)) {
url <- paste0(" [:link:](", url, ")", collapse = "")
} else {
url <- ""
}
if (!is.na(bugs)) {
bugs <- paste0(" [:bug:](", bugs, ")")
} else {
bugs <- ""
}
paste0(
"## ", name, " ", version, date, url, bugs, "\n\n",
title, "\n\n",
description, "\n\n",
"Maintainer: ", maintainer, ". License: ", license, "\n\n"
)
}
knitr::asis_output(purrr::pmap_chr(all_df, format_pkg))
```
# Implementation
The list of all known DBI backends is provided as a set of static JSON files.
## Usage
### Query all packages
```{r all, eval = FALSE}
all <- httr::GET("https://r-dbi.github.io/backends/all.json")
httr::stop_for_status(all)
all_df <- httr::content(all, flatten = TRUE, simplifyVector = TRUE)
```
### Query a single package
```{r single}
first_name <- all_df$name[[1]]
first_url <- paste0("https://r-dbi.github.io/backends/by-package/", first_name, ".json")
first <- httr::GET(first_url)
httr::stop_for_status(first)
httr::content(first)
```
## Updating the database
The database is updated via `script/prepare.R` which is run daily by GitHub Actions.
Existing packages are updated directly.
For new or removed packages, pull requests are opened.
---
Please note that the 'backends' project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.