https://github.com/mdlincoln/dbns
Load All Tables From A Database Into R Objects
https://github.com/mdlincoln/dbns
Last synced: 5 months ago
JSON representation
Load All Tables From A Database Into R Objects
- Host: GitHub
- URL: https://github.com/mdlincoln/dbns
- Owner: mdlincoln
- License: other
- Created: 2018-05-11T16:15:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T18:40:34.000Z (over 6 years ago)
- Last Synced: 2024-08-13T07:15:41.405Z (8 months ago)
- Language: R
- Size: 17.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mdlincoln/dbns - Load All Tables From A Database Into R Objects (R)
README
---
output:
md_document:
variant: markdown_github
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```# dbns
[](https://www.tidyverse.org/lifecycle/#experimental)
[](https://travis-ci.org/mdlincoln/dbns)
[](https://ci.appveyor.com/project/mdlincoln/dbns)
[](https://codecov.io/github/mdlincoln/dbns?branch=master)dbns creates a DataBase NameSpace, adding all the tables available from a given database connection into a namespace as `tbl` objects ready to be manipulated by [dplyr].
[dplyr]: https://cran.r-project.org/web/packages/dplyr/index.html
## Example
```{r example}
library(dbns)
library(DBI)
db <- dbConnect(RSQLite::SQLite(), system.file("extdata/dbns.sqlite", package = "dbns"))dbListTables(db)
attach_database(db, "dbns")
dbns_iris
dbns_mtcars
```Detach a database namespace when you are done.
Note that dbns does not disconnect the DBI connection.```{r disconnect}
detach_database("dbns")dbDisconnect(db)
```