PostGRE_Query: PostGRE_Query

View source: R/SQL_Functions.R

PostGRE_QueryR Documentation

PostGRE_Query

Description

PostGRE_Query get data from a database table

Usage

PostGRE_Query(
  Query = NULL,
  Connection = NULL,
  CloseConnection = FALSE,
  Host = NULL,
  DBName = NULL,
  User = NULL,
  Port = NULL,
  Password = NULL
)

Arguments

Query

SQL Statement in quotes

Connection

db connection

CloseConnection

= FALSE

Host

If Connection is NULL then this must be supplied. host

DBName

If Connection is NULL then this must be supplied. dbname

User

If Connection is NULL then this must be supplied. user

Port

If Connection is NULL then this must be supplied. port

Password

If Connection is NULL then this must be supplied. password

Author(s)

Adrian Antico

See Also

Other Database: AutoDataDictionaries(), PostGRE_AppendData(), PostGRE_CreateTable(), PostGRE_GetTableNames(), PostGRE_ListTables(), PostGRE_RemoveCreateAppend(), PostGRE_RemoveTable(), PosteGRE_CreateDatabase(), PosteGRE_DropDB(), PosteGRE_ListDatabases(), SQL_ClearTable(), SQL_DropTable(), SQL_Query_Push(), SQL_Query(), SQL_SaveTable(), SQL_Server_DBConnection()

Examples

## Not run: 

# Query data from table with Uppercase name
data <- AutoQuant::PostGRE_Query(
  Query = paste0("SELECT * FROM ", shQuote('Devices')),
  Host = 'localhost',
  CloseConnection = FALSE,
  DBName = 'Testing',
  User = 'postgres',
  Port = 5432,
  Password = 'Aa...')

# Query = 'Select * from static_data'
# Host = 'localhost'
# DBName = 'Testing'
# CloseConnection = FALSE,
# User = 'postgres'
# Port = 5432
# Password = 'Aa...'

# Create Schema
query <- "CREATE SCHEMA AutoQuant AUTHORIZATION postgres;"
AutoQuant::PostGRE_Query(
  Query = query,
  Host = 'localhost',
  CloseConnection = FALSE,
  DBName = 'Testing',
  User = 'postgres',
  Port = 5432,
  Password = 'Aa...')

## End(Not run)


AdrianAntico/RemixAutoML documentation built on Feb. 3, 2024, 3:32 a.m.