{"id":17783527,"url":"https://github.com/skalt/sql_parser_tests","last_synced_at":"2026-04-30T01:35:51.308Z","repository":{"id":139646525,"uuid":"401103088","full_name":"SKalt/sql_parser_tests","owner":"SKalt","description":"a corpus of postgres SQL drawn from the postgres 13 regression tests.","archived":false,"fork":false,"pushed_at":"2022-04-16T16:37:33.000Z","size":2805,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T14:44:46.798Z","etag":null,"topics":["corpus","postgres","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","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/SKalt.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-08-29T17:34:56.000Z","updated_at":"2023-08-08T16:42:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8a69394-a4ed-41a2-a510-5097e54ee16b","html_url":"https://github.com/SKalt/sql_parser_tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKalt%2Fsql_parser_tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKalt%2Fsql_parser_tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKalt%2Fsql_parser_tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKalt%2Fsql_parser_tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SKalt","download_url":"https://codeload.github.com/SKalt/sql_parser_tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246719940,"owners_count":20822823,"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","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":["corpus","postgres","postgresql","sql"],"created_at":"2024-10-27T07:43:06.456Z","updated_at":"2026-04-30T01:35:46.285Z","avatar_url":"https://github.com/SKalt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL Parser Tests\n\nThese tools collect a corpus of SQL-like statements in a variety of languages, then use a series of oracles to predict whether each statement is valid in a given language.\n\nCurrently postgres-specific.\n\nNote that this is alpha-quality software: oracle output may fail to be correctly interpreted, and APIs may change rapidly (i.e CLIs + ./schema.sql).\nEven when this is stable, not that oracle predictions may be ambiguous.\n\n## Oracle testing\n\n\u003c!--\n```\n (=======)\n  :||||:\n  |||||||\n  :|:||||\n  |||||:\n   ||||||\n  |:|||||\n  |||||||\n   |||: |\n (= = = =)\n``` --\u003e\n\nIn this repo, \"oracle\" refers to a black box which issues truthful predictions about a program's behavior, _not_ Oracle the lawsuit-issuing corporation.\n\nOracle-testing is a black-box testing method which gives limited insight into whether any given statement is valid. Using oracles to predict syntax validity is easier than deriving parsing tests from the numerous specifications of SQL dialects and sql-like languages.\n\n## Usage: Consuming a test suite\n\nDownload one of the databases from the [the last step of a successful ci run](https://github.com/SKalt/pg_sql_parser_tests/actions)\n, then query the statements and oracle output using sqlite. You can [find the sqlite database schema](./schema.sql) in the root of this repo.\nSee also also [`./pkg/corpus/sql/get_predictions.sql`](./pkg/corpus/sql/get_predictions.sql), which demonstrates how you'd join together the table to retrieve predictions.\n\n![erd](./erd.svg)\n\n### Contributing\n\nIf you'd like to contribute new oracles, sources of SQL, documentation, or fixes, see [./CONTRIBUTING.md](./CONTRIBUTING.md).\n\n# License\n\nBSD 3-clause; see [./LICENSE](./LICENSE)\n\n# Directory structure\n\n```\n.\n├── pkg/\n|   ├── corpus/ # tools for interacting with the test-corpus database\n|   └── oracles/                       # defines the oracle interface\n|       └── ${database}/${oracle}/*.go # individual oracles\n├── scripts\n|   ├── parse/    # output pg_query AST for sanity-checking oracle results\n|   ├── splitter/ # create a sql-statement-corpus database\n|   └── predict/  # runs oracles over an existing corpus database\n├── docker-compose.yaml # for defining database-services for use by oracles\n├── Earthfile,Makefile # build tool\n├── go.mod,go.sum,Cargo.toml,Cargo.lock # package management\n└── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalt%2Fsql_parser_tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskalt%2Fsql_parser_tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalt%2Fsql_parser_tests/lists"}