{"id":30436870,"url":"https://github.com/nmandery/psqlchunks","last_synced_at":"2026-04-20T19:31:21.742Z","repository":{"id":2307686,"uuid":"3267036","full_name":"nmandery/psqlchunks","owner":"nmandery","description":"Testing tool to validate blocks of SQL by running them against a PostgreSQL database. In case of errors the tool provides a better error description and location as standard psql would.","archived":false,"fork":false,"pushed_at":"2013-06-10T12:12:11.000Z","size":250,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-23T02:45:38.666Z","etag":null,"topics":["database","postgresql-database","sql"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmandery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-25T18:01:52.000Z","updated_at":"2015-07-08T13:03:07.000Z","dependencies_parsed_at":"2022-08-06T12:01:33.955Z","dependency_job_id":null,"html_url":"https://github.com/nmandery/psqlchunks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nmandery/psqlchunks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmandery%2Fpsqlchunks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmandery%2Fpsqlchunks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmandery%2Fpsqlchunks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmandery%2Fpsqlchunks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmandery","download_url":"https://codeload.github.com/nmandery/psqlchunks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmandery%2Fpsqlchunks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","postgresql-database","sql"],"created_at":"2025-08-23T02:20:52.105Z","updated_at":"2026-04-20T19:31:21.719Z","avatar_url":"https://github.com/nmandery.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is an utility to run blocks/chunks of sql in a\npostgresql database to test if they are valid on the block level.\n\nThe program will output a brief description which blocks passed and which\ncontained errors. In the case of an error psqlchunks tries to give\na detailed description including the SQL code from and around the\nfailing line.\n\nThe usecase for this tool is including database modifcations in a \ncontinous integraton process to ensure the validity of SQL files\nbefore they are deployed.\n\n\nUsage\n-----\n\nMost of the usage parameters are described in the help text\nthe program prints when called with\n\n    psqlchunks help\n\n\nResult:\n\n    Usage :  \n    psqlchunks command [options] files\n    version: 0.6.0\n\n    use - as filename to read from stdin.\n    Definition of a chunk of SQL:\n      A chunk of SQL is block of SQL statements to be executed together,\n      and is delimited by the following markers:\n\n      -------------------------------------------------------------\n      -- start: creating my table\n      -------------------------------------------------------------\n      create table mytable (myint integer, mytext text);\n      -------------------------------------------------------------\n      -- end: creating my table\n      -------------------------------------------------------------\n\n      The end marker is optional and may be ommited.\n      The shortest marker syntac understood by this tool is:\n\n      ----\n      -- start: creating my table\n      create table mytable (myint integer, mytext text);\n\n\n    Commands:\n      print        print all SQL files and write the formatted output to stdout.\n                   This command as the following aliasses: echo, concat.\n      help         display this help text\n      list         list chunks\n      run          run SQL chunks in the database\n                   This will not commit the SQL. But be aware that this tool\n                   does not parse the SQL statments and will not filter out\n                   COMMIT statements from the SQL files. Should there be any\n                   in the files, the SQL WILL BE COMMITED and this tool will\n                   terminate.\n\n    General:\n      -F           hide filenames from output\n\n    Filters:\n      -L [lines]   use only chunks which span the given lines.\n                   lines is a commaseperated list of line numbers. Example:\n                   1,78,345\n      -I [regex]   match description comments with a regular expression.\n                   (POSIX extended regular expression, case insensitive)\n      -S [regex]   SQL has to match this POSIX extended regular expression,\n                   also case insensitive.\n\n    SQL Handling:\n      -C           commit SQL to the database. Default is performing a rollback\n                   after the SQL has been executed. A commit will only be\n                   executed if no errors occured. (default: rollback)\n      -a           abort execution after first failed chunk. (default: continue)\n      -l           number of lines to output before and after failing lines\n                   of SQL. (default: 2)\n      -E           set the client_encoding of the database connection. This\n                   setting is useful when the encoding of sql file differs\n                   from the default client_encoding of the database server.\n\n    Connection parameters:\n      -d [database name]\n      -U [user]\n      -W           ask for password (default: don't ask)\n      -h [host/socket name]\n\n    Return codes:\n      0            no errors\n      1            invalid usage of this program\n      2            the SQL contains errors\n      3            (internal) database error\n\n\n\nBuild requirements\n------------------\n\n- a C++ compiler. GCC and clang are tested.\n- PostgreSQL libpq development headers. These are available in the package libpq-dev on Debian-based systems.\n\nLimitations\n-----------\n\n- No transactions inside the SQL file allowed. This will cause the main transaction to be commited, which may\n  result in an inconsitent state in the database.\n- COPY statements may not be executed.\n- NOTICES emited by the database server will simply be printed to stdout.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmandery%2Fpsqlchunks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmandery%2Fpsqlchunks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmandery%2Fpsqlchunks/lists"}