{"id":26045200,"url":"https://github.com/pgx-contrib/pgxmql","last_synced_at":"2026-05-01T06:32:43.068Z","repository":{"id":279186590,"uuid":"937472297","full_name":"pgx-contrib/pgxmql","owner":"pgx-contrib","description":"pgx QueryRewriter that injects hashicorp/mql dynamic filters as safe, parameterised WHERE clauses","archived":false,"fork":false,"pushed_at":"2026-04-27T05:35:02.000Z","size":280,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-27T06:32:26.909Z","etag":null,"topics":["dynamic-filtering","go","golang","hashicorp","mql","pgx","postgres","postgresql","query-rewriter","sqlc","where-clause"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/pgx-contrib/pgxmql","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/pgx-contrib.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-23T06:07:01.000Z","updated_at":"2026-04-27T05:35:00.000Z","dependencies_parsed_at":"2025-03-06T01:19:53.546Z","dependency_job_id":"9e3d3e0d-b13d-4b43-934e-c45f3d967149","html_url":"https://github.com/pgx-contrib/pgxmql","commit_stats":null,"previous_names":["pgx-contrib/pgxfilter","pgx-contrib/pgxmql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pgx-contrib/pgxmql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgx-contrib%2Fpgxmql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgx-contrib%2Fpgxmql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgx-contrib%2Fpgxmql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgx-contrib%2Fpgxmql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgx-contrib","download_url":"https://codeload.github.com/pgx-contrib/pgxmql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgx-contrib%2Fpgxmql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32487386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["dynamic-filtering","go","golang","hashicorp","mql","pgx","postgres","postgresql","query-rewriter","sqlc","where-clause"],"created_at":"2025-03-07T19:33:05.038Z","updated_at":"2026-05-01T06:32:43.063Z","avatar_url":"https://github.com/pgx-contrib.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgxmql\n\n[![CI](https://github.com/pgx-contrib/pgxmql/actions/workflows/ci.yml/badge.svg)](https://github.com/pgx-contrib/pgxmql/actions/workflows/ci.yml)\n[![Release](https://img.shields.io/github/v/release/pgx-contrib/pgxmql?include_prereleases)](https://github.com/pgx-contrib/pgxmql/releases)\n[![Go Reference](https://pkg.go.dev/badge/github.com/pgx-contrib/pgxmql.svg)](https://pkg.go.dev/github.com/pgx-contrib/pgxmql)\n[![License](https://img.shields.io/github/license/pgx-contrib/pgxmql)](LICENSE)\n[![Go](https://img.shields.io/badge/Go-1.25-00ADD8?logo=go\u0026logoColor=white)](https://go.dev)\n[![pgx](https://img.shields.io/badge/pgx-v5-blue)](https://github.com/jackc/pgx)\n[![hashicorp/mql](https://img.shields.io/badge/hashicorp%2Fmql-enabled-blueviolet)](https://github.com/hashicorp/mql)\n\nA [pgx](https://github.com/jackc/pgx) `QueryRewriter` adapter for\n[hashicorp/mql](https://github.com/hashicorp/mql) dynamic filtering. Write\nyour SQL with a void placeholder and let `WhereClause` inject a safe,\nparameterised filter at query time.\n\n## Installation\n\n```bash\ngo get github.com/pgx-contrib/pgxmql\n```\n\n## Usage\n\nDefine your model with `db` struct tags to map fields to table columns. Use\n`$1::void IS NULL` as the filter placeholder in your SQL:\n\n```go\ntype User struct {\n    ID   int    `db:\"id\"`\n    Name string `db:\"name\"`\n    Role string `db:\"role\"`\n}\n\nrows, err := pool.Query(ctx,\n    \"SELECT * FROM users WHERE $1::void IS NULL\",\n    \u0026pgxmql.WhereClause{\n        Condition: \"role = 'admin'\",\n        Model:     User{},\n    },\n)\n```\n\nThe placeholder is replaced by the parsed MQL condition before the query\nreaches PostgreSQL. When `Condition` is empty the placeholder becomes `TRUE`,\nreturning all rows.\n\n## Development\n\n### DevContainer\n\nOpen in VS Code with the Dev Containers extension. The environment provides Go,\nPostgreSQL 18, and Nix automatically.\n\n```\nPGX_DATABASE_URL=postgres://vscode@postgres:5432/pgxmql?sslmode=disable\n```\n\n### Nix\n\n```bash\nnix develop          # enter shell with Go\ngo tool ginkgo run -r\n```\n\n### Run tests\n\n```bash\n# Unit tests only (no database required)\ngo tool ginkgo run -r\n\n# With integration tests\nexport PGX_DATABASE_URL=\"postgres://localhost/pgxmql?sslmode=disable\"\ngo tool ginkgo run -r\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgx-contrib%2Fpgxmql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgx-contrib%2Fpgxmql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgx-contrib%2Fpgxmql/lists"}