{"id":14384279,"url":"https://github.com/channable/dbcritic","last_synced_at":"2025-08-30T06:13:45.466Z","repository":{"id":41102794,"uuid":"348000925","full_name":"channable/dbcritic","owner":"channable","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-12T16:14:01.000Z","size":38,"stargazers_count":179,"open_issues_count":3,"forks_count":2,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-08-28T18:56:50.703Z","etag":null,"topics":["gpbt"],"latest_commit_sha":null,"homepage":"","language":"Idris","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/channable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-15T14:26:08.000Z","updated_at":"2025-07-31T02:40:39.000Z","dependencies_parsed_at":"2025-02-03T10:20:10.316Z","dependency_job_id":"cbac3436-5020-44f8-ab20-e2d90c59043a","html_url":"https://github.com/channable/dbcritic","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/channable/dbcritic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channable%2Fdbcritic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channable%2Fdbcritic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channable%2Fdbcritic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channable%2Fdbcritic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/channable","download_url":"https://codeload.github.com/channable/dbcritic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channable%2Fdbcritic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272812095,"owners_count":24996975,"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-08-30T02:00:09.474Z","response_time":77,"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":["gpbt"],"created_at":"2024-08-28T18:01:16.567Z","updated_at":"2025-08-30T06:13:45.433Z","avatar_url":"https://github.com/channable.png","language":"Idris","readme":"# dbcritic\n\ndbcritic finds problems in a database schema.\n\n## Synopsis\n\nTo run dbcritic, set the environment variables expected by [libpq][libpqenv].\nThen invoke dbcritic with no arguments.\nFor instance:\n\n```console\n$ export PGHOST=localhost\n$ export PGPORT=5432\n$ export PGUSER=myuser\n$ export PGDATABASE=mydatabase\n$ dbcritic\n```\n\n[libpqenv]: https://www.postgresql.org/docs/current/libpq-envars.html\n\n## Building\n\ndbcritic can be build with Nix or without Nix.\nTo build it with Nix, simply invoke nix-build:\n\n```console\n$ nix-build release.nix\n```\n\nThis command will make a symlink `result` in the current directory.\ndbcritic can then be called via `./result/bin/dbcritic`.\n\nTo build it without Nix, first make sure you have installed Idris and libpq.\nThen invoke make:\n\n```console\n$ make\n```\n\nThis command will create a binary `dbcritic-bin` in the current directory.\n\n## Description\n\ndbcritic connects to a PostgreSQL database using the specified parameters.\nIt then performs a series of checks and reports discovered issues.\nIssues may result from the cluster configuration or from the database schema.\n\ndbcritic implements the following checks:\n\n| Check              | Description                                                                   |\n| -------------------| ----------------------------------------------------------------------------- |\n| index_fk_ref       | Check that foreign key has an index on the referencing side.                  |\n| primary_key        | Check that each table has a primary key constraint.                           |\n| primary_key_bigint | Check that integer primary keys are of type bigint.                           |\n| timestamptz        | Check that columns are of type ‘timestamptz’ rather than of type ‘timestamp’. |\n| time_zone          | Check that the ‘TimeZone’ parameter is set to a sensible value.               |\n\n## Configuration\n\ndbcritic can be configured with a file _.dbcriticrc_ in the working directory.\n\ndbcritic will ignore any empty lines and comment lines in the file.\nComment lines begin with a hash sign (#).\n\ndbcritic can be configured to silence certain issues with _silence_ directives.\nAny issue whose identifier begins with the given prefix will not be reported.\nHere is an example of a silence directive:\n\n```\nsilence index_fk_ref cache_log\n```\n\nThis will silence any issues reported by the _index\\_fk\\_ref_ check\nthat pertain to the _cache\\_log_ table.\n\n## Exit status\n\nIf any issues were reported, dbcritic exits with status code 1.\nIf an unrecoverable error occurred, dbcritic exits with status code 2.\nIn any other case, dbcritic exits with status code 0.\n\n## Bugs\n\nThe output is quite verbose and repetitive.\nExperienced users may favor more compact output.\nThis is currently not implemented.\n\nIn the check _index\\_fk\\_ref_, the order of the columns in the suggested index\nis not always correct.\n\nThere are many more opportunities for checks.\n","funding_links":[],"categories":["Idris","Programming Languages"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchannable%2Fdbcritic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchannable%2Fdbcritic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchannable%2Fdbcritic/lists"}