{"id":51784654,"url":"https://github.com/faustbrian/go-api-query","last_synced_at":"2026-07-20T16:31:15.102Z","repository":{"id":371797488,"uuid":"1302467533","full_name":"faustbrian/go-api-query","owner":"faustbrian","description":"Typed API filtering, sorting, field selection, relationships, and cursor pagination for Go.","archived":false,"fork":false,"pushed_at":"2026-07-17T01:35:55.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-17T03:07:43.117Z","etag":null,"topics":["api","cursor-pagination","filtering","go","golang","json-api","json-rpc","query","sorting","sqlc"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/faustbrian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2026-07-16T07:28:42.000Z","updated_at":"2026-07-17T01:35:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/faustbrian/go-api-query","commit_stats":null,"previous_names":["faustbrian/go-api-query"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/faustbrian/go-api-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faustbrian%2Fgo-api-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faustbrian%2Fgo-api-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faustbrian%2Fgo-api-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faustbrian%2Fgo-api-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faustbrian","download_url":"https://codeload.github.com/faustbrian/go-api-query/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faustbrian%2Fgo-api-query/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35693381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"ssl_error","status_checked_at":"2026-07-20T02:08:09.736Z","response_time":111,"last_error":"SSL_read: 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":["api","cursor-pagination","filtering","go","golang","json-api","json-rpc","query","sorting","sqlc"],"created_at":"2026-07-20T16:31:14.043Z","updated_at":"2026-07-20T16:31:15.093Z","avatar_url":"https://github.com/faustbrian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-api-query\n\n`go-api-query` compiles explicitly declared API query capabilities into an\nimmutable, storage-neutral plan. It covers field projection, relationships,\ntyped filters, deterministic sorting, cursor or offset pagination, conservative\ncosts, and strict transport adapters without becoming an ORM or SQL language.\n\nThe minimum supported toolchain is Go 1.26.5.\n\n## Five-minute JSON-RPC quickstart\n\n```go\nschema, err := apiquery.NewSchema(apiquery.SchemaConfig{\n    Resource: \"orders\",\n    Revision: \"orders-v1\",\n    Fields: []apiquery.FieldDefinition{\n        {Name: \"id\", Type: apiquery.TypeString, Required: true},\n        {Name: \"status\", Type: apiquery.TypeString, Default: true},\n    },\n    Filters: []apiquery.FilterDefinition{{\n        Name: \"status\", Type: apiquery.TypeString,\n        Operators: []apiquery.Operator{apiquery.OpEqual, apiquery.OpIn},\n    }},\n    Sorts: []apiquery.SortDefinition{{\n        Name: \"id\", Type: apiquery.TypeString, TieBreaker: true,\n    }},\n    Pagination: apiquery.PaginationDefinition{\n        Cursor: true, DefaultPageSize: 25,\n    },\n    Bounds: apiquery.Bounds{\n        MaxFields: 10, MaxFilterDepth: 3, MaxFilterNodes: 20,\n        MaxValues: 40, MaxSorts: 3, MaxPageSize: 100,\n        MaxCursorBytes: 2048, MaxCost: 100,\n    },\n})\nif err != nil {\n    return err // invalid server declaration\n}\n\nparams, err := apiqueryrpc.Parse(rawParams, schema.Bounds().MaxRequestBytes)\nif err != nil {\n    return err // sanitized transport error\n}\n\nplan, err := apiquery.Compile(ctx, schema, params.Request(), apiquery.CompileOptions{\n    Authorize: func(ctx context.Context, capability apiquery.Capability) bool {\n        return policy.Allows(ctx, capability.Kind, capability.Name)\n    },\n    MandatoryConstraints: []apiquery.Constraint{{\n        Name: \"tenant_id\", Value: apiquery.StringValue(tenantID), Protected: true,\n    }},\n    CursorDecoder: cursorCodec,\n})\nif err != nil {\n    return apiqueryvalidation.Report(err, validation.DefaultLimits())\n}\n\n// Only a reviewed plan reaches an application-owned persistence adapter.\nparts, err := pgCompiler.Compile(plan)\n```\n\nAn explicitly empty JSON-RPC array such as `\"fields\": []` remains different\nfrom an absent `fields` member. JSON objects reject unknown or duplicate members\nand parsing is byte-bounded before compilation.\n\n## Contract boundary\n\nServers own every field, filter, operator, relationship, sort, bound, cost,\ncursor version, authorization decision, and mandatory predicate. Clients never\nsupply identifiers, SQL, regular expressions, functions, joins, repositories,\nor execution behavior. The core package imports no database or transport.\n\nStart with the [complete API reference](docs/api.md),\n[security model](SECURITY.md), and [cursor guide](docs/cursor.md). Transport and\nadoption guides cover [HTTP](docs/http.md), [OpenRPC](docs/openrpc.md),\n[JSON:API composition](docs/jsonapi.md), [SQLC](docs/sqlc.md), and\n[Laravel/Cline RPC migration](docs/migration-laravel-cline.md).\n\n## Local quality gates\n\n```sh\nmake check       # formatting, analysis, tests, coverage, race, fuzz, docs, API\nmake mutation    # 100% mutation efficacy and mutant coverage\nmake postgres    # disposable PostgreSQL integration\nmake benchmarks  # allocation-reporting performance baselines\nmake nilaway     # visible advisory diagnostics, intentionally non-blocking\nmake ci          # complete local release-equivalent gate stack\n```\n\nAll tools are pinned in `go.mod`. PostgreSQL defaults to a digest-pinned\ndisposable container; set `APIQUERY_TEST_DATABASE_URL` to use an existing test\ndatabase. No package executes queries or contacts a service at runtime.\n\n## Stability\n\nThe repository is preparing v1. Public compatibility rules are in\n[docs/compatibility.md](docs/compatibility.md), current changes are in\n[CHANGELOG.md](CHANGELOG.md), and the exported v1 candidate is recorded in\n`api/v1.txt`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaustbrian%2Fgo-api-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaustbrian%2Fgo-api-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaustbrian%2Fgo-api-query/lists"}