{"id":26026999,"url":"https://github.com/arxdeus/puresql-go","last_synced_at":"2025-06-26T16:09:48.399Z","repository":{"id":177283524,"uuid":"657155675","full_name":"arxdeus/puresql-go","owner":"arxdeus","description":"Tiny (pure bytes.Buffer) implementation of SQL Query Builder","archived":false,"fork":false,"pushed_at":"2023-06-29T12:21:54.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T16:09:21.683Z","etag":null,"topics":["bytes","golang","perfomance","sql","unsafe","unstable"],"latest_commit_sha":null,"homepage":"","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/arxdeus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-22T12:44:43.000Z","updated_at":"2023-06-22T13:15:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"af2fc347-466c-427f-875c-10de743dafcb","html_url":"https://github.com/arxdeus/puresql-go","commit_stats":null,"previous_names":["hot-moms/puresql-go","kitsuniru/puresql-go","arxdeus/puresql-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arxdeus/puresql-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdeus%2Fpuresql-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdeus%2Fpuresql-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdeus%2Fpuresql-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdeus%2Fpuresql-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arxdeus","download_url":"https://codeload.github.com/arxdeus/puresql-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxdeus%2Fpuresql-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262099728,"owners_count":23258670,"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":["bytes","golang","perfomance","sql","unsafe","unstable"],"created_at":"2025-03-06T15:32:54.002Z","updated_at":"2025-06-26T16:09:48.376Z","avatar_url":"https://github.com/arxdeus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# puresql-go  #\n***Tiny (pure bytes.Buffer) and opinionated implementation of SQL Query Builder***\n\nDownload:\n```go get github.com/hot-moms/puresql-go@latest```\n\nPackage *puresql-go* is a lightweight implementation of an SQL query builder written purely in Golang's bytes.Buffer.\n\nThis package provides an easy-to-use interface for building SQL queries programmatically, allowing developers to quickly and efficiently generate complex queries with minimal coding.\n\nWith puresql-go, building SQL queries is as simple as writing out the desired query in Golang code, making it an ideal solution for teams working with databases powered by SQL.\n\nBy utilizing Golang's powerful byte-based buffer system, puresql-go provides superior performance and precision in generating valid SQL scripts. Get started quickly and with ease by leveraging this versatile tool for all your SQL query building needs.\n\n### TODO:\n- [X] ADD clauses\n- [X] Equal to X\n- [X] Contained by X\n- [X] Any of X\n- [X] Field is X (type)\n- [X] Compare field with X\n- [X] Between X and Y\n- [ ] OR clauses\n\n### Usage ###\n\n#### Query:\n```\nconst _sql = `SELECT hub FROM hubs`\n\n\tvar (\n\t\tname            = \"Github\"\n\t\tcompanies       = []string{\"Apple\", \"Microsoft\", \"Github\"}\n\t\ttypes           = []string{\"Commercial\", \"Non-commercial\"}\n\t\tyear_from int32 = 1990\n\t\tyear_to   int32 = 2023\n\t)\n\n\tsB := sql.Init(_sql)\n\tsB.ContainedByStrings(\"company\", companies)\n\tsB.BetweenInts(\"year\", \u0026year_from, \u0026year_to)\n\tsB.EqualToString(\"name\", \u0026name)\n\tsB.AnyOfStrings(\"type\", types)\n\tsB.OrderBy(nil, nil, \"last_update DESC\")\n\tsB.Limit(12)\n\n\tfmt.Println(sB.ToSQL())\n```\n\n### Result ###\n\n__Query__:  `SELECT hub FROM hubs WHERE (company @\u003e ($1)) AND (year BETWEEN $2 AND $3) AND (name = $4) AND (type = ANY($5)) ORDER BY last_update DESC LIMIT 12 `\n\n__Arguments__: `[Apple Microsoft Github], 1990, 2023, Github, [Commercial Non-commercial]`\n\n---\n\n_2023, Archie Iwakura (hot-moms)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farxdeus%2Fpuresql-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farxdeus%2Fpuresql-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farxdeus%2Fpuresql-go/lists"}