Functions for Generating PostgreSQL Statements/Scripts


[Up] [Top]

Documentation for package ‘pgTools’ version 1.0.2

Help Pages

alterDATABASE Generate a PostgreSQL ALTER DATABASE statement, optionally execute the statement if con is not NULL.
alterSCHEMA Generate a PostgreSQL ALTER SCHEMA statement, optionally execute the statement if con is not NULL.
alterTABLE Generate a PostgreSQL ALTER TABLE statement, optionally execute the statement if con is not NULL.
arrayStrToVec Write a PostgreSQL array as a string from a vector.
callFUNCTION Generate a PostgreSQL statement to execute a function, optionally execute the statement if con is not NULL.
callPROCEDURE Generate a PostgreSQL statement to execute a procedure, optionally execute the statement if con is not NULL.
connect Connect to a local database with local credentials using DBI/odbc.
COPY Generate a PostgreSQL COPY command, optionally execute the statement if con is not NULL.
createDATABASE Generate a PostgreSQL CREATE DATABASE statement, optionally execute the statement if con is not NULL.
createEXTENSION Generate a PostgreSQL CREATE EXTENSION statement, optionally execute the statement if con is not NULL.
createFUNCTION Generate a PostgreSQL CREATE FUNCTION statement, optionally execute the statement if con is not NULL.
createPROCEDURE Generate a PostgreSQL CREATE PROCEDURE statement, optionally execute the statement if con is not NULL.
createSCHEMA Generate a PostgreSQL CREATE SCHEMA statement, optionally execute the statement if con is not NULL.
createTABLE Generate a PostgreSQL CREATE TABLE statement, optionally execute the statement if con is not NULL.
createTRIGGER Generate a PostgreSQL CREATE TRIGGER statement, optionally execute the statement if con is not NULL.
create_sql_script Create a SQL script, optionally execute the statement if con is not NULL.
DELETE Generate a PostgreSQL DELETE statement, optionally execute the statement if con is not NULL.
dropDATABASE Generate a PostgreSQL DROP DATABASE statement, optionally execute the statement if con is not NULL.
dropEXTENSION Generate a PostgreSQL DROP EXTENSION statement, optionally execute the statement if con is not NULL.
dropFUNCTION Generate a PostgreSQL DROP FUNCTION statement, optionally execute the statement if con is not NULL.
dropPROCEDURE Generate a PostgreSQL DROP PROCEDURE statement, optionally execute the statement if con is not NULL.
dropSCHEMA Generate a PostgreSQL DROP SCHEMA statement, optionally execute the statement if con is not NULL.
dropTABLE Generate a PostgreSQL DROP TABLE statement, optionally execute the statement if con is not NULL.
dropTRIGGER Generate a PostgreSQL DROP TRIGGER statement, optionally execute the statement if con is not NULL.
INSERT Generate a PostgreSQL INSERT statement, optionally execute the statement if con is not NULL.
insert_batch_chunker Helper function for INSERT
insert_table_chunker Helper function for INSERT
pg_addColumn Helper command to add a column via ALTER TABLE.
pg_alterColumnType Helper command to alter a column's data type via ALTER TABLE.
pg_data_types PostgreSQL data types
pg_dropColumn Helper command to drop a column via ALTER TABLE.
pg_renameColumn Helper command to rename a column via ALTER TABLE.
pg_renameTable Helper command to rename a table via ALTER TABLE.
querySELECT Generate a PostgreSQL select statement, optionally execute the statement if con is not NULL.
quoteText2 Add single quotes to strings using stringi::stri_join, useful for converting R strings into SQL formatted strings.
sqlNameWalk Convert a column name into a PostgreSQL compatible name.
sqlTypeWalk Get the PostgreSQL data type for a given R data type.
sql_80_char_comment Add a 80 char SQL comment, intended to be used for visual breaks in documents.
sql_comment Add a single line SQL comment.
TRUNCATE Generate a PostgreSQL TRUNCATE statement, optionally execute the statement if con is not NULL.
UPDATE Generate a PostgreSQL UPDATE statement, optionally execute the statement if con is not NULL.
vecToArrayStr Write a PostgreSQL array as a string using ARRAY[] format from a vector.
vecToArrayStr2 Write a PostgreSQL array as a string using format from a vector.