{
  "_id": "6a1d68cc1d7bb097a0a4e7c5",
  "Package": "pgTools",
  "Type": "Package",
  "Title": "Functions for Generating PostgreSQL Statements/Scripts",
  "Version": "1.0.1",
  "Author": "Timothy Conwell",
  "Maintainer": "Timothy Conwell <timconwell@gmail.com>",
  "Description": "Create PostgreSQL statements/scripts from R, optionally\nexecuting the SQL statements. Common SQL operations are\nincluded, although not every configurable option is available\nat this time. SQL output is intended to be compliant with\nPostgreSQL syntax specifications. PostgreSQL documentation is\navailable here\n<https://www.postgresql.org/docs/current/index.html>.",
  "License": "GPL (>= 3)",
  "Encoding": "UTF-8",
  "RoxygenNote": "7.2.0",
  "URL": "https://github.com/tconwell/pgTools",
  "BugReports": "https://github.com/tconwell/pgTools/issues",
  "Config/pak/sysreqs": "make libicu-dev unixodbc-dev",
  "Repository": "https://tconwell.r-universe.dev",
  "Date/Publication": "2022-10-20 17:15:10 UTC",
  "RemoteUrl": "https://github.com/tconwell/pgtools",
  "RemoteRef": "HEAD",
  "RemoteSha": "ab45ad37138962d4960f04be930e96e6657bb773",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-06-01 11:07:15 UTC",
    "User": "root"
  },
  "MD5sum": "96b48857481a046ca1bfef8a17e3e44a",
  "_user": "tconwell",
  "_type": "src",
  "_file": "pgTools_1.0.1.tar.gz",
  "_fileid": "6414edb99539e94e48ca2ed7090705593085cddcff08adbbe30ce7bd05feb942",
  "_filesize": 179858,
  "_sha256": "6414edb99539e94e48ca2ed7090705593085cddcff08adbbe30ce7bd05feb942",
  "_created": "2026-06-01T11:07:15.000Z",
  "_published": "2026-06-01T11:11:07.995Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 78839236672,
      "time": 117,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7329900797"
    },
    {
      "job": 78839236687,
      "time": 118,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7329901081"
    },
    {
      "job": 78839236891,
      "time": 109,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7329925472"
    },
    {
      "job": 78839236682,
      "time": 97,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7329925475"
    },
    {
      "job": 78838782584,
      "time": 173,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7329863782"
    },
    {
      "job": 78839236780,
      "time": 103,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7329896954"
    },
    {
      "job": 78839236697,
      "time": 76,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7329888488"
    },
    {
      "job": 78839236670,
      "time": 93,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7329893523"
    },
    {
      "job": 78839236689,
      "time": 69,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7329886676"
    }
  ],
  "_buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/tconwell/pgtools",
  "_commit": {
    "id": "ab45ad37138962d4960f04be930e96e6657bb773",
    "author": "tconwell <timconwell@gmail.com>",
    "committer": "tconwell <timconwell@gmail.com>",
    "message": "Added GPL\n",
    "time": 1666286110
  },
  "_maintainer": {
    "name": "Timothy Conwell",
    "email": "timconwell@gmail.com",
    "login": "tconwell",
    "description": "",
    "uuid": 51293949
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5.0",
      "role": "Depends"
    },
    {
      "package": "data.table",
      "role": "Depends"
    },
    {
      "package": "toolbox",
      "role": "Depends"
    },
    {
      "package": "DBI",
      "role": "Imports"
    },
    {
      "package": "odbc",
      "role": "Imports"
    },
    {
      "package": "parallel",
      "role": "Imports"
    },
    {
      "package": "stringi",
      "role": "Imports"
    }
  ],
  "_owner": "tconwell",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [],
  "_tags": [],
  "_stars": 1,
  "_contributors": [
    {
      "user": "tconwell",
      "count": 3,
      "uuid": 51293949
    }
  ],
  "_userbio": {
    "uuid": 51293949,
    "type": "user",
    "name": "Tim Conwell"
  },
  "_downloads": {
    "count": 173,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/pgTools"
  },
  "_devurl": "https://github.com/tconwell/pgtools",
  "_searchresults": 3,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/pgTools.html",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/tconwell/pgtools",
  "_realowner": "tconwell",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2021-01-25"
    },
    {
      "version": "1.0.0",
      "date": "2022-06-24"
    },
    {
      "version": "1.0.1",
      "date": "2022-09-15"
    },
    {
      "version": "1.0.2",
      "date": "2023-03-24"
    }
  ],
  "_exports": [
    "alterDATABASE",
    "alterSCHEMA",
    "alterTABLE",
    "arrayStrToVec",
    "callFUNCTION",
    "callPROCEDURE",
    "connect",
    "COPY",
    "create_sql_script",
    "createDATABASE",
    "createEXTENSION",
    "createFUNCTION",
    "createPROCEDURE",
    "createSCHEMA",
    "createTABLE",
    "createTRIGGER",
    "DELETE",
    "dropDATABASE",
    "dropEXTENSION",
    "dropFUNCTION",
    "dropPROCEDURE",
    "dropSCHEMA",
    "dropTABLE",
    "dropTRIGGER",
    "INSERT",
    "insert_batch_chunker",
    "insert_table_chunker",
    "pg_addColumn",
    "pg_alterColumnType",
    "pg_data_types",
    "pg_dropColumn",
    "pg_renameColumn",
    "pg_renameTable",
    "querySELECT",
    "quoteText2",
    "sql_80_char_comment",
    "sql_comment",
    "sqlNameWalk",
    "sqlTypeWalk",
    "TRUNCATE",
    "UPDATE",
    "vecToArrayStr",
    "vecToArrayStr2"
  ],
  "_help": [
    {
      "page": "alterDATABASE",
      "title": "Generate a PostgreSQL ALTER DATABASE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "alterDATABASE"
      ]
    },
    {
      "page": "alterSCHEMA",
      "title": "Generate a PostgreSQL ALTER SCHEMA statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "alterSCHEMA"
      ]
    },
    {
      "page": "alterTABLE",
      "title": "Generate a PostgreSQL ALTER TABLE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "alterTABLE"
      ]
    },
    {
      "page": "arrayStrToVec",
      "title": "Write a PostgreSQL array as a string from a vector.",
      "topics": [
        "arrayStrToVec"
      ]
    },
    {
      "page": "callFUNCTION",
      "title": "Generate a PostgreSQL statement to execute a function, optionally execute the statement if con is not NULL.",
      "topics": [
        "callFUNCTION"
      ]
    },
    {
      "page": "callPROCEDURE",
      "title": "Generate a PostgreSQL statement to execute a procedure, optionally execute the statement if con is not NULL.",
      "topics": [
        "callPROCEDURE"
      ]
    },
    {
      "page": "connect",
      "title": "Connect to a local database with local credentials using DBI/odbc.",
      "topics": [
        "connect"
      ]
    },
    {
      "page": "COPY",
      "title": "Generate a PostgreSQL COPY command, optionally execute the statement if con is not NULL.",
      "topics": [
        "COPY"
      ]
    },
    {
      "page": "create_sql_script",
      "title": "Create a SQL script, optionally execute the statement if con is not NULL.",
      "topics": [
        "create_sql_script"
      ]
    },
    {
      "page": "createDATABASE",
      "title": "Generate a PostgreSQL CREATE DATABASE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "createDATABASE"
      ]
    },
    {
      "page": "createEXTENSION",
      "title": "Generate a PostgreSQL CREATE EXTENSION statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "createEXTENSION"
      ]
    },
    {
      "page": "createFUNCTION",
      "title": "Generate a PostgreSQL CREATE FUNCTION statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "createFUNCTION"
      ]
    },
    {
      "page": "createPROCEDURE",
      "title": "Generate a PostgreSQL CREATE PROCEDURE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "createPROCEDURE"
      ]
    },
    {
      "page": "createSCHEMA",
      "title": "Generate a PostgreSQL CREATE SCHEMA statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "createSCHEMA"
      ]
    },
    {
      "page": "createTABLE",
      "title": "Generate a PostgreSQL CREATE TABLE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "createTABLE"
      ]
    },
    {
      "page": "createTRIGGER",
      "title": "Generate a PostgreSQL CREATE TRIGGER statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "createTRIGGER"
      ]
    },
    {
      "page": "DELETE",
      "title": "Generate a PostgreSQL DELETE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "DELETE"
      ]
    },
    {
      "page": "dropDATABASE",
      "title": "Generate a PostgreSQL DROP DATABASE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "dropDATABASE"
      ]
    },
    {
      "page": "dropEXTENSION",
      "title": "Generate a PostgreSQL DROP EXTENSION statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "dropEXTENSION"
      ]
    },
    {
      "page": "dropFUNCTION",
      "title": "Generate a PostgreSQL DROP FUNCTION statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "dropFUNCTION"
      ]
    },
    {
      "page": "dropPROCEDURE",
      "title": "Generate a PostgreSQL DROP PROCEDURE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "dropPROCEDURE"
      ]
    },
    {
      "page": "dropSCHEMA",
      "title": "Generate a PostgreSQL DROP SCHEMA statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "dropSCHEMA"
      ]
    },
    {
      "page": "dropTABLE",
      "title": "Generate a PostgreSQL DROP TABLE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "dropTABLE"
      ]
    },
    {
      "page": "dropTRIGGER",
      "title": "Generate a PostgreSQL DROP TRIGGER statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "dropTRIGGER"
      ]
    },
    {
      "page": "INSERT",
      "title": "Generate a PostgreSQL INSERT statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "INSERT"
      ]
    },
    {
      "page": "insert_batch_chunker",
      "title": "Helper function for INSERT",
      "topics": [
        "insert_batch_chunker"
      ]
    },
    {
      "page": "insert_table_chunker",
      "title": "Helper function for INSERT",
      "topics": [
        "insert_table_chunker"
      ]
    },
    {
      "page": "pg_addColumn",
      "title": "Helper command to add a column via ALTER TABLE.",
      "topics": [
        "pg_addColumn"
      ]
    },
    {
      "page": "pg_alterColumnType",
      "title": "Helper command to alter a column's data type via ALTER TABLE.",
      "topics": [
        "pg_alterColumnType"
      ]
    },
    {
      "page": "pg_data_types",
      "title": "PostgreSQL data types",
      "topics": [
        "pg_data_types"
      ]
    },
    {
      "page": "pg_dropColumn",
      "title": "Helper command to drop a column via ALTER TABLE.",
      "topics": [
        "pg_dropColumn"
      ]
    },
    {
      "page": "pg_renameColumn",
      "title": "Helper command to rename a column via ALTER TABLE.",
      "topics": [
        "pg_renameColumn"
      ]
    },
    {
      "page": "pg_renameTable",
      "title": "Helper command to rename a table via ALTER TABLE.",
      "topics": [
        "pg_renameTable"
      ]
    },
    {
      "page": "querySELECT",
      "title": "Generate a PostgreSQL select statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "querySELECT"
      ]
    },
    {
      "page": "quoteText2",
      "title": "Add single quotes to strings using stringi::stri_join, useful for converting R strings into SQL formatted strings.",
      "topics": [
        "quoteText2"
      ]
    },
    {
      "page": "sql_80_char_comment",
      "title": "Add a 80 char SQL comment, intended to be used for visual breaks in documents.",
      "topics": [
        "sql_80_char_comment"
      ]
    },
    {
      "page": "sql_comment",
      "title": "Add a single line SQL comment.",
      "topics": [
        "sql_comment"
      ]
    },
    {
      "page": "sqlNameWalk",
      "title": "Convert a column name into a PostgreSQL compatible name.",
      "topics": [
        "sqlNameWalk"
      ]
    },
    {
      "page": "sqlTypeWalk",
      "title": "Get the PostgreSQL data type for a given R data type.",
      "topics": [
        "sqlTypeWalk"
      ]
    },
    {
      "page": "TRUNCATE",
      "title": "Generate a PostgreSQL TRUNCATE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "TRUNCATE"
      ]
    },
    {
      "page": "UPDATE",
      "title": "Generate a PostgreSQL UPDATE statement, optionally execute the statement if con is not NULL.",
      "topics": [
        "UPDATE"
      ]
    },
    {
      "page": "vecToArrayStr",
      "title": "Write a PostgreSQL array as a string using ARRAY[] format from a vector.",
      "topics": [
        "vecToArrayStr"
      ]
    },
    {
      "page": "vecToArrayStr2",
      "title": "Write a PostgreSQL array as a string using format from a vector.",
      "topics": [
        "vecToArrayStr2"
      ]
    }
  ],
  "_rundeps": [
    "bit",
    "bit64",
    "blob",
    "cli",
    "data.table",
    "DBI",
    "glue",
    "hms",
    "lifecycle",
    "odbc",
    "pkgconfig",
    "Rcpp",
    "rlang",
    "stringi",
    "toolbox",
    "vctrs"
  ],
  "_score": 2,
  "_indexed": true,
  "_nocasepkg": "pgtools",
  "_universes": [
    "tconwell"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.0.1",
      "date": "2026-06-01T11:09:18.000Z",
      "distro": "noble",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "a40689a8a73efef77768361ddc440528a6d60140a7f455c34cb9e6d57cdb39a2",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.0.1",
      "date": "2026-06-01T11:09:19.000Z",
      "distro": "noble",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "6a2c18487bb81897c570fdbd33c2d7a61a860947833165eb77432bd0f2f726f6",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.0.1",
      "date": "2026-06-01T11:10:42.000Z",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "39c1ec89c598729b446bb5ccb4d72e5c87d6c9605497bae4a7a438b7442b89fd",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.0.1",
      "date": "2026-06-01T11:10:43.000Z",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "5d50a900fab54566a687af6a2eaef6f1f80cb0552bae2d81d5fcc790ff2c132c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.0.1",
      "date": "2026-06-01T11:09:19.000Z",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "9bacfd25bdcb8efd331acfce41c7136dc4209202a42f810fdbee9d2d5b2bdf14",
      "status": "success",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.0.1",
      "date": "2026-06-01T11:08:35.000Z",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "c52f1642210e3c984850fa34d0211f65cddc73feaef38ebfe3c0c12eabbf2a27",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.0.1",
      "date": "2026-06-01T11:08:58.000Z",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "5e2d4e58037f8e152785e1751c45ecd4b83f3ca8ea9451126f55fc50b101d048",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.0.1",
      "date": "2026-06-01T11:08:28.000Z",
      "commit": "ab45ad37138962d4960f04be930e96e6657bb773",
      "fileid": "39599eb9d7d639e6441b9465224ad7e8bad5164e76313ed1b47ae3f03daff9e1",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/tconwell/actions/runs/26751019313"
    }
  ]
}