connect_to_db: Connect to DB

Description Usage Arguments Value

View source: R/connect-to-db.R

Description

Currently a shell for a SQLite connection

Usage

1
2
3
4
5
6
7
8
9
connect_to_db(
  type = "sqlite",
  dbname = "hockey",
  schema = "nhl",
  host = "localhost",
  port = 5432,
  user = "postgres",
  password = getPass::getPass()
)

Arguments

type

One of "sqlite" or "postgres" (defaults to "sqlite" as an internal test)

dbname

The database name. If type = 'sqlite', it will be created. If type = 'postgres', it must be an existing database. Defaults to "hockey"

schema

Only used if type = 'postgres'. Defaults to 'nhl'

host

Defaults to "localhost"

port

Defaults to 5432

user

Defaults to 'postgres'

password

Defaults to getPass::getPass()

Value

an active connection to a db called "tempdb"


anthonyshook/nhldata documentation built on Feb. 22, 2021, 3:51 a.m.