-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
59 lines (45 loc) · 1.58 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
---
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%"
)
```
# dabr: Database Management with R <img src="https://raw.githubusercontent.com/special-uor/dabr/main/inst/images/logo.png" alt="logo" align="right" height=200px/>
<!-- badges: start -->
`r badger::badge_cran_release("dabr", "black")`
`r badger::badge_devel("special-uor/dabr", "yellow")`
`r badger::badge_github_actions("special-uor/dabr")`
<!-- badges: end -->
The goal of dabr is to provide functions to manage databases: select, update, insert,
and delete records, list tables, backup tables as CSV files, and import
CSV files as tables.
## Installation
You can install the released version of dabr from [CRAN](https://cran.r-project.org/package=dabr) with:
``` r
install.packages("dabr")
```
And the development version from [GitHub](https://github.com/special-uor/dabr) with:
``` r
# install.packages("remotes")
remotes::install_github("special-uor/dabr", "dev")
```
## Example
Connecting to the Reading Palaeofire Database (RPD), locally installed under the name `RPD-latest`:
```{r}
conn <- dabr::open_conn_mysql("RPD-latest",
password = rstudioapi::askForPassword(prompt = "Password"))
```
Explore the database structure by listing the tables and their attributes:
```{r}
dabr::list_tables(conn)
```
__ALWAYS!__ close your connection to the database (when you are done):
```{r}
dabr::close_conn(conn)
```