Functions for Generating PostgreSQL Statements/Scripts


[Up] [Top]

Documentation for package ‘pgTools’ version 0.1.0

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.
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.
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.
DELETE Generate a postgreSQL DELETE statement, optionally execute the statement if con is not NULL.
doubleQuoteText Add double quotes to strings.
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.
quoteText Add single quotes to strings, useful for converting R strings into SQL formatted strings.
sampleStr Generates (pseudo)random strings of the specified char length. Used in INSERT and UPDATE to avoid overwriting existing columns of data.tables. Not as fast as stringi:stri_rand_strings.
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.
sql_script Create a SQL script, optionally execute the statement if con is not NULL.
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.