{"id":16831337,"url":"https://github.com/jonfriesen/pglint","last_synced_at":"2026-05-16T08:09:49.469Z","repository":{"id":53796548,"uuid":"169290286","full_name":"jonfriesen/pglint","owner":"jonfriesen","description":"A simple PostgreSQL lint library written in Go that wraps ecpg","archived":false,"fork":false,"pushed_at":"2021-03-13T00:07:13.000Z","size":12,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T14:05:51.545Z","etag":null,"topics":["postgres","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonfriesen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-05T18:26:58.000Z","updated_at":"2025-04-30T18:46:20.000Z","dependencies_parsed_at":"2022-09-10T21:51:32.893Z","dependency_job_id":null,"html_url":"https://github.com/jonfriesen/pglint","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jonfriesen/pglint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonfriesen%2Fpglint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonfriesen%2Fpglint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonfriesen%2Fpglint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonfriesen%2Fpglint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonfriesen","download_url":"https://codeload.github.com/jonfriesen/pglint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonfriesen%2Fpglint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274976892,"owners_count":25384285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["postgres","postgresql"],"created_at":"2024-10-13T11:43:15.120Z","updated_at":"2026-05-16T08:09:49.399Z","avatar_url":"https://github.com/jonfriesen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pglint\nThis library is used to validate PostgreSQL statements and running them against the ecpg library to determine if they are valid.\n\n![Build Status](https://github.com/jonfriesen/pglint/workflows/build/badge.svg)\n\n## requirements\n- Go v1.11+\n- [ecpg library](https://manpages.debian.org/experimental/libecpg-dev/ecpg.1.en.html)\n    ```\n    // Ubuntu\n    sudo apt install libecpg-dev\n    // RedHat \u0026 CentOS\n    sudo yum install postgresql-devel\n    // Arch Linux\n    sudo pacman -S postgresql-libs\n    ```\n\n## usage\n\nThe generaly rule of thumb is no repsonse is good news.\n\n### Library\nConsume the library by creating a ECPG object.\n```go\nconfig := ecpg.Config{\n    AddSemiColon:   *addSemicolons,\n    TrimWhiteSpace: *trimWhitespace,\n    QuestionMarks:  *allowQuestionMarks,\n}\n\nlinter, err := ecpg.NewECPG(\u0026config)\nif err != nil {\n    log.Fatalf(\"Error: %v\", err)\n}\n```\n\n### CLI usage\n`pglint-cli [options] \u003cquery\u003e`\n```\nUsage of pglint-cli:\n  -addSemicolons\n        Automatically add semicolons to queries if not already present (will fail without a semicolon) (default true)\n  -questionmarks\n        Determines whether or not the to fill question mark placeholders with sample data for linting (default true)\n  -trim\n        Trim whitespace at head and tail of query (default true)\n```\n\nEg. `pglint-cli -trim=false -questionmarks=false 'SELECT * FROM myTable;'`\n\n### Docker\n\n`docker run jonfriesen/pglint 'SELECT DATABASE_NAME FROM M_DATABASES;'`\n\n#### Build yourself\nBuild: `docker build -t pglint .`\nRun: `docker run pglint 'SELECT DATABASE_NAME FROM M_DATABASES;'`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonfriesen%2Fpglint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonfriesen%2Fpglint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonfriesen%2Fpglint/lists"}