Postgre: Create a database connection object using PostgreSQL DBMS.

Description Usage Arguments Details Value See Also Examples

View source: R/DbPostgre.R

Description

Create a database connection object using PostgreSQL DBMS.

Usage

1
Postgre(db_name, db_user, db_pass, db_host, db_port = 5432)

Arguments

db_name

string. Name of the database to load.

db_user

string. User identification for the DBMS.

db_pass

string. Password identifying the user.

db_host

string. Name of the server hosting the database.

db_port

integer. Port the server is listening.

Details

Connect to a database and set con_obj in the object itself.

Value

Postgre, an S3 object of type Postgre containing the required parameter to act as an interface to PostgreSQL.

See Also

dbConnect Database

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
con <- Postgre(db_host = 'localhost', db_name = 'test', db_user = 'root', db_pass = '123456')
con
#$db_host
#[1] "127.0.0.1"

#$db_port
#[1] 5432

#$db_name
#[1] "test"

#$db_user
#[1] "keyhan"

#$db_pass
#[1] "123456"

#$con_obj
#<PostgreSQLConnection>

#attr(,"class")
#[1] "Postgre"

ks465/r-utils documentation built on May 23, 2019, 5:07 p.m.