{"id":23682936,"url":"https://github.com/johejo/sqlbuilder","last_synced_at":"2026-01-04T06:30:14.031Z","repository":{"id":41845850,"uuid":"271297852","full_name":"johejo/sqlbuilder","owner":"johejo","description":"A very simple SQL builder","archived":false,"fork":false,"pushed_at":"2022-04-26T21:03:52.000Z","size":20,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T19:59:26.246Z","etag":null,"topics":["go","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/johejo.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}},"created_at":"2020-06-10T14:23:47.000Z","updated_at":"2022-03-26T12:00:11.000Z","dependencies_parsed_at":"2022-08-11T19:11:01.359Z","dependency_job_id":null,"html_url":"https://github.com/johejo/sqlbuilder","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/johejo%2Fsqlbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johejo%2Fsqlbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johejo%2Fsqlbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johejo%2Fsqlbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johejo","download_url":"https://codeload.github.com/johejo/sqlbuilder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239734527,"owners_count":19688256,"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":["go","golang","sql","sqlbuilder"],"created_at":"2024-12-29T19:59:32.144Z","updated_at":"2026-01-04T06:30:13.989Z","avatar_url":"https://github.com/johejo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqlbuilder\n\n[![ci](https://github.com/johejo/sqlbuilder/workflows/ci/badge.svg?branch=master)](https://github.com/johejo/sqlbuilder/actions?query=workflow%3Aci)\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/johejo/sqlbuilder)\n[![codecov](https://codecov.io/gh/johejo/sqlbuilder/branch/master/graph/badge.svg)](https://codecov.io/gh/johejo/sqlbuilder)\n[![Go Report Card](https://goreportcard.com/badge/github.com/johejo/sqlbuilder)](https://goreportcard.com/report/github.com/johejo/sqlbuilder)\n\n## Description\n\nPackage sqlbuilder provides minimal functionality for building raw queries.\n\n## Example\n\n```go\npackage sqlbuilder_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/johejo/sqlbuilder\"\n)\n\nfunc ExampleBuilder() {\n\tvar b sqlbuilder.Builder\n\tb.Append(\"SELECT * FROM test_user WHERE id = ? \", 1) // with trailing space\n\tb.Append(\"AND name = ?\", \"John\")                     // without trailing space\n\tb.Append(\" ORDER BY name LIMIT ?, ?\", 0, 10)         // with space at the beginning\n\n\tq, args := b.Build()\n\tfmt.Println(q)\n\tfmt.Println(args)\n\n\t// Output:\n\t// SELECT * FROM test_user WHERE id = ? AND name = ? ORDER BY name LIMIT ?, ?\n\t// [1 John 0 10]\n}\n\nfunc ExampleBulkBuilder() {\n\tb, err := sqlbuilder.NewBulkBuilder(\"INSERT INTO tbl_name (a,b,c) VALUES (?)\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif err := b.Bind(\"A\", \"B\", \"C\"); err != nil {\n\t\tpanic(err)\n\t}\n\tif err := b.Bind(\"AA\", \"BB\", \"CC\"); err != nil {\n\t\tpanic(err)\n\t}\n\n\tq, args := b.Build()\n\tfmt.Println(q)\n\tfmt.Println(args)\n\n\t// Output:\n\t// INSERT INTO tbl_name (a,b,c) VALUES (?,?,?),(?,?,?)\n\t// [A B C AA BB CC]\n}\n```\n\n## License\n\nMIT\n\n## Author\n\nMitsuo Heijo (@johejo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohejo%2Fsqlbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohejo%2Fsqlbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohejo%2Fsqlbuilder/lists"}