{"id":15173860,"url":"https://github.com/kefniark/mango-sql","last_synced_at":"2026-02-12T03:04:35.516Z","repository":{"id":250695998,"uuid":"830921863","full_name":"kefniark/mango-sql","owner":"kefniark","description":"Golang Client Code-Generator for SQL Database (Postgres, SQLite, ...)","archived":false,"fork":false,"pushed_at":"2024-09-17T19:30:26.000Z","size":1302,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-02T08:44:05.914Z","etag":null,"topics":["code-generation","database","golang","mariadb","mysql","postgresql","sql","sqlite"],"latest_commit_sha":null,"homepage":"https://kefniark.github.io/mango-sql/","language":"PLpgSQL","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/kefniark.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"kefniark","thanks_dev":null,"custom":null}},"created_at":"2024-07-19T09:28:18.000Z","updated_at":"2025-06-29T09:37:40.000Z","dependencies_parsed_at":"2024-09-23T04:00:26.070Z","dependency_job_id":null,"html_url":"https://github.com/kefniark/mango-sql","commit_stats":{"total_commits":76,"total_committers":2,"mean_commits":38.0,"dds":"0.17105263157894735","last_synced_commit":"dce403573a8142196daf0212851b05f2ed1ad4cc"},"previous_names":["kefniark/mangosql","kefniark/mango-sql"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kefniark/mango-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2Fmango-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2Fmango-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2Fmango-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2Fmango-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kefniark","download_url":"https://codeload.github.com/kefniark/mango-sql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kefniark%2Fmango-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29355875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"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":["code-generation","database","golang","mariadb","mysql","postgresql","sql","sqlite"],"created_at":"2024-09-27T11:03:52.144Z","updated_at":"2026-02-12T03:04:35.503Z","avatar_url":"https://github.com/kefniark.png","language":"PLpgSQL","readme":"# MangoSQL 🥭\n\n![GitHub License](https://img.shields.io/github/license/kefniark/mango-sql)\n![GitHub Release](https://img.shields.io/github/v/release/kefniark/mango-sql)\n![GitHub Release Date](https://img.shields.io/github/release-date/kefniark/mango-sql)\n\n## Description\n\n**MangoSQL** is a fresh and juicy SQL code generator for **Golang**.\n\n1. Provide your database schema and queries (in .sql files)\n2. Run MangoSQL cli to generate a client with type-safe interfaces and queries\n3. Write application code based on this generated db client\n\n**MangoSQL** is the perfect choice if you don't want an heavy ORM, but don't want to write all the SQL queries by hand like a caveman either.\nOriginally inspired by [SQLC](https://github.com/sqlc-dev/sqlc), but pushes the idea farther by natively supporting batching, relations and dynamic queries.\n\n**Links**:\n🚀 [Getting Started](https://kefniark.github.io/mango-sql/getting-started/) | 💻 [API Reference](https://kefniark.github.io/mango-sql/api/mutations.html) | 📈 [Benchmark](https://kefniark.github.io/mango-sql/bench/bench.html)\n\n## Features\n\n* **Convenient**: All the structs are generated for you, No need to manually write any [DTO/PDO](https://en.wikipedia.org/wiki/Data_transfer_object)\n* **Time Saver**: All the basic [CRUD queries](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) are generated from your schema alone, less queries to write\n* **Safe**: All the SQL queries use prepared statement to avoid injection\n* **Consistent**: Easy to use transaction API to rollback when an error occurs\n* **Fast**: Get the performances of a handmade `sql.go` in an instant\n\n\n## Example \n\nSo let's see what it means in reality. For the following:\n```sql\nCREATE TABLE users (\n  id          UUID PRIMARY KEY,\n  email       VARCHAR(64) NOT NULL,\n  name        VARCHAR(64) NOT NULL,\n  created_at  TIMESTAMP NOT NULL DEFAULT NOW(),\n  updated_at  TIMESTAMP NOT NULL DEFAULT NOW(),\n  deleted_at  TIMESTAMP DEFAULT NULL\n);\n```\n\nExecute the following command to automatically generate a `database/client.go`\n```sh\nmangosql --output=database schema.sql\n```\n\nThis is all you need to do, now the client can be used in your code\n```go\ndb := database.New(dbConnection)\n\n// Handle crud operation\nuser, err := db.User.Insert(database.UserCreate{\n    Name: \"user1\",\n    Email: \"user1@email.com\"\n})\n\n// Typed dynamic clauses (filters, pagination, ...) with typed helpers\nusers, err := db.User.FindMany(\n    db.User.Query.Name.Like(\"%user%\"),\n    db.User.Query.Limit(20)\n)\n\n// Raw dynamic clauses\nusers, err := db.User.FindMany(func(query SelectBuilder) SelectBuilder {\n\treturn query.Where(\"name ILIKE $1 OR name ILIKE $2\", \"%user1%\", \"%user2%\")\n})\n\n// To know more about MangoSQL APIs ... RTFM ^^\n\n```\n","funding_links":["https://buymeacoffee.com/kefniark"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkefniark%2Fmango-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkefniark%2Fmango-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkefniark%2Fmango-sql/lists"}