{"id":43177908,"url":"https://github.com/deathkel/sqlbuilder","last_synced_at":"2026-02-01T03:16:42.135Z","repository":{"id":57483343,"uuid":"150958745","full_name":"deathkel/sqlbuilder","owner":"deathkel","description":"golang sql builder inspired by laravel builder","archived":false,"fork":false,"pushed_at":"2019-06-06T05:32:16.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T21:35:37.327Z","etag":null,"topics":["golang","mysql","orm","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/deathkel.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":"2018-09-30T10:48:35.000Z","updated_at":"2021-09-27T01:37:42.000Z","dependencies_parsed_at":"2022-08-27T20:02:59.264Z","dependency_job_id":null,"html_url":"https://github.com/deathkel/sqlbuilder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deathkel/sqlbuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathkel%2Fsqlbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathkel%2Fsqlbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathkel%2Fsqlbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathkel%2Fsqlbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deathkel","download_url":"https://codeload.github.com/deathkel/sqlbuilder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathkel%2Fsqlbuilder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28965721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"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":["golang","mysql","orm","sqlbuilder"],"created_at":"2026-02-01T03:16:41.497Z","updated_at":"2026-02-01T03:16:42.121Z","avatar_url":"https://github.com/deathkel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## golang SQL builder\n### this is a sql builder for golang in chain style \n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Quality Score](https://scrutinizer-ci.com/g/deathkel/sqlbuilder/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/deathkel/sqlbuilder)\n\n#### godoc\nhttps://godoc.org/github.com/deathkel/sqlbuilder/builder\n\n#### USAGE\n##### SELECT\n* case 1:``select * from user``\n```go\nb := new(builder.Builder)\nsql, bindings := b.Select(\"*\").From(\"user\").toSql()\n\n```\n\n* case 2: ``select *, `user`.`name`, count(1) as count from `user` where (id = ?) ``\n```go\n...\nsql, bindings := b.Select(\"*\", \"user.name\", \"count(1) as count\").From(\"user\").Where(\"id\", \"1\").toSql()\n...\n```\n##### INSERT\n* case 1: ``insert into `user` (`name`, `sex`, `age`) values (?, ?, ?)``\n```go\n...\ninfo := map[string]string{\"name\":\"john\", \"sex\":\"2\", \"age\":\"22\"}\nsql, bindings := b.Insert(\"user\", info).toSql()\n...\n```\n\n##### UPDATE\n* case 1: ``update `user` set `name` = ?, `sex` = ?, `age` = ? where (id = ?)``\n```go\n...\ninfo := map[string]string{\"name\":\"john\", \"sex\":\"2\", \"age\":\"22\"}\nsql, bindings := b.Update(\"user\", info).Where(\"id\", \"1\").toSql()\n...\n```\n* case 2(update raw): ``update `user` set `age` = `age` + 1 ``\n```go\nsql, bindings := b.Update(\"ta\", map[string]interface{}{\"increase a\": \u0026builder.Expression{Value: \"a = a + 1\"}}).ToSql()\n\n```\nwhen use Expression, map key (increase a) will be ignored\n##### DELETE\n* case 1: ``delete `user` where (id = ?)``\n```go\n...\nsql, bindings := b.Delete(\"user\").Where(\"id\", \"1\").toSql()\n...\n```\n\n\n### support database\n* mysql","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeathkel%2Fsqlbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeathkel%2Fsqlbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeathkel%2Fsqlbuilder/lists"}