{"id":20180883,"url":"https://github.com/taleeus/sqld","last_synced_at":"2026-02-19T18:01:24.080Z","repository":{"id":215481551,"uuid":"739033892","full_name":"taleeus/sqld","owner":"taleeus","description":"A Go library to build and manage dynamic queries","archived":false,"fork":false,"pushed_at":"2025-04-14T18:59:43.000Z","size":82,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T21:42:49.288Z","etag":null,"topics":["database","go","query-builder","sql"],"latest_commit_sha":null,"homepage":"","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/taleeus.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}},"created_at":"2024-01-04T16:09:10.000Z","updated_at":"2025-01-09T17:04:18.000Z","dependencies_parsed_at":"2024-02-16T15:30:04.990Z","dependency_job_id":"b2ce49d3-a53f-46df-a16c-cec7b67c02ec","html_url":"https://github.com/taleeus/sqld","commit_stats":null,"previous_names":["taleeus/sqld"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/taleeus/sqld","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleeus%2Fsqld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleeus%2Fsqld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleeus%2Fsqld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleeus%2Fsqld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taleeus","download_url":"https://codeload.github.com/taleeus/sqld/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taleeus%2Fsqld/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29626601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["database","go","query-builder","sql"],"created_at":"2024-11-14T02:33:20.876Z","updated_at":"2026-02-19T18:01:24.048Z","avatar_url":"https://github.com/taleeus.png","language":"Go","readme":"# sqld\nA Go library to build and manage dynamic queries.\nIt tries to remain as simple as possible, leveraging [sqlx](https://github.com/jmoiron/sqlx) parameter annotation.\n\n## Legazy version\nSee the `legacy` module and the corresponding [README](legacy/README.md).\n\n## Scope of the project\nThe scope of `sqld` is to provide an easy way to organize your dynamic queries, not to validate said queries.\nI suggest to use other tools like [SQLParser](https://github.com/blastrain/vitess-sqlparser) and a lot of e2e tests!\n\n# Usage\n```go\nfunc testQuery(db sqlx.ExtContext, args QueryArgs) ([]TestModel, error) {\n\tdynquery := `\n\tSELECT *\n\tFROM table\n\t`\n\n\tparams := make(slqd.Params)\t// it's just a map\n\tdynquery += sqld.Where(\t// returns empty string if all predicates don't evaluate\n\t\tsqld.IfNotNil(args.Name, params, sqld.Contains(\"table.name\"))\n\t)\n\tdynquery += sqld.IfNotNil(args.Limit, params, sqld.Limit)\n\tdynquery += sqld.IfNotNil(args.Offset, params, sqld.Offset)\n\n\tquery, args, err := sqlx.Named(dynquery, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trows, err := db.QueryxContext(ctx, db.Rebind(query), args...)\t// use Rebind() with postgres\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tvar items []TestModel\n\tfor rows.Next() {\n\t\tvar item TestModel\n\t\tif err := rows.StructScan(\u0026item); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\titems = append(items, item)\n\t}\n\n\treturn items, nil\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaleeus%2Fsqld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaleeus%2Fsqld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaleeus%2Fsqld/lists"}