{"id":18537526,"url":"https://github.com/qjebbs/go-sqlf","last_synced_at":"2026-07-02T15:07:05.672Z","repository":{"id":152479984,"uuid":"625823126","full_name":"qjebbs/go-sqlf","owner":"qjebbs","description":"go-sqlf focuses only on building SQL queries by free combination of fragments.","archived":false,"fork":false,"pushed_at":"2026-04-30T09:11:24.000Z","size":361,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"v4","last_synced_at":"2026-04-30T10:25:09.446Z","etag":null,"topics":["golang","sql","sqlbuilder"],"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/qjebbs.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":"2023-04-10T07:14:57.000Z","updated_at":"2026-04-30T09:11:09.000Z","dependencies_parsed_at":"2025-05-15T01:35:20.665Z","dependency_job_id":"ec2653b9-5919-40eb-a02b-8a983a5ea39d","html_url":"https://github.com/qjebbs/go-sqlf","commit_stats":null,"previous_names":["qjebbs/go-sqlf"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/qjebbs/go-sqlf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjebbs%2Fgo-sqlf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjebbs%2Fgo-sqlf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjebbs%2Fgo-sqlf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjebbs%2Fgo-sqlf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qjebbs","download_url":"https://codeload.github.com/qjebbs/go-sqlf/tar.gz/refs/heads/v4","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjebbs%2Fgo-sqlf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35052061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"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":["golang","sql","sqlbuilder"],"created_at":"2024-11-06T19:38:37.781Z","updated_at":"2026-07-02T15:07:05.661Z","avatar_url":"https://github.com/qjebbs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Go SQL Fragment (go-sqlf)\n\nPackage `sqlf` is dedicated to building SQL queries by composing fragments.\n\nUnlike other SQL builders or ORMs, `*Fragment` is the only concept you need to understand.\nIt uses the same bind variable syntax (`?` / `$1`) as `database/sql`, which can refer to both ordinary args and fragment builders in args.\n\nA `*Fragment` is created by `F()`.\n\n```go\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qjebbs/go-sqlf/v4\"\n\t\"github.com/qjebbs/go-sqlf/v4/dialect\"\n)\n\nfunc Example_basic() {\n\tb := sqlf.F(\n\t\t\"SELECT * FROM foo WHERE ?\",\n\t\tsqlf.Join([]sqlf.Builder{\n\t\t\tsqlf.F(\"baz = $1\", true),\n\t\t\tsqlf.F(\"bar BETWEEN ? AND ?\", 1, 100),\n\t\t}, \" AND \"),\n\t)\n\tctx := sqlf.NewContext(context.Background(), dialect.PostgreSQL{})\n\tquery, args, _ := b.Build(ctx)\n\tfmt.Println(query)\n\tfmt.Println(args)\n\t// Output:\n\t// SELECT * FROM foo WHERE baz = $1 AND bar BETWEEN $2 AND $3\n\t// [true 1 100]\n}\n```\n\n## The Go SQL Tools Family\n\nThis project is part of a family of Go SQL tools, each designed for a different level of abstraction and automation:\n\n1. **go-sqlf (this project)** — Minimalist SQL fragment builder. For simple, manual SQL composition with parameter binding and zero magic.\n2. **[go-sqlb](https://github.com/qjebbs/go-sqlb)** — Advanced SQL builder. For programmatically building complex queries (CTE, JOIN, expressions, etc.) with chainable, declarative, and composable APIs.\n3. **[go-sqlm](https://github.com/qjebbs/sqlm)** — Struct mapping. Declarative struct mapping, automatic CRUD, batch operations, and high-performance zero-reflection code generation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqjebbs%2Fgo-sqlf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqjebbs%2Fgo-sqlf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqjebbs%2Fgo-sqlf/lists"}