{"id":39002604,"url":"https://github.com/biyonik/go-fluent-sql","last_synced_at":"2026-01-17T17:13:11.573Z","repository":{"id":326945389,"uuid":"1107219691","full_name":"biyonik/go-fluent-sql","owner":"biyonik","description":"A fluent, type-safe SQL query builder for Go with Laravel-inspired syntax.","archived":false,"fork":false,"pushed_at":"2025-12-01T12:49:53.000Z","size":92,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-03T05:34:26.905Z","etag":null,"topics":["go","golang","golang-library","mysql","orm","postgresql","sql"],"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/biyonik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2025-11-30T19:58:11.000Z","updated_at":"2025-12-01T12:49:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/biyonik/go-fluent-sql","commit_stats":null,"previous_names":["biyonik/go-fluent-sql"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/biyonik/go-fluent-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biyonik%2Fgo-fluent-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biyonik%2Fgo-fluent-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biyonik%2Fgo-fluent-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biyonik%2Fgo-fluent-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biyonik","download_url":"https://codeload.github.com/biyonik/go-fluent-sql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biyonik%2Fgo-fluent-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28512070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"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":["go","golang","golang-library","mysql","orm","postgresql","sql"],"created_at":"2026-01-17T17:13:11.455Z","updated_at":"2026-01-17T17:13:11.548Z","avatar_url":"https://github.com/biyonik.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-fluent-sql\n\n[![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=flat\u0026logo=go)](https://go.dev/)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/biyonik/go-fluent-sql)](https://goreportcard.com/report/github.com/biyonik/go-fluent-sql)\n[![codecov](https://codecov.io/gh/biyonik/go-fluent-sql/branch/main/graph/badge.svg)](https://codecov.io/gh/biyonik/go-fluent-sql)\n[![GoDoc](https://godoc.org/github.com/biyonik/go-fluent-sql?status.svg)](https://pkg.go.dev/github.com/biyonik/go-fluent-sql)\n\nA fluent, type-safe SQL query builder for Go with Laravel-inspired syntax.\n\n## Features\n\n- 🔗 **Fluent API** - Chain methods for readable queries\n- 🛡️ **SQL Injection Protection** - Prepared statements \u0026 identifier validation\n- 🎯 **Type Safety** - Compile-time checks where possible\n- 🚀 **High Performance** - Minimal allocations, cached reflection\n- 🔌 **Multi-Database** - MySQL, PostgreSQL (coming soon)\n- 📦 **Zero Config** - Works out of the box\n- 🧪 **Well Tested** - Comprehensive test coverage\n\n## Installation\n\n```bash\ngo get github.com/biyonik/go-fluent-sql\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log\"\n    \n    fluentsql \"github.com/biyonik/go-fluent-sql\"\n)\n\nfunc main() {\n    // Connect to database\n    db, err := fluentsql.Connect(\"user:password@tcp(localhost:3306)/dbname\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer db.Close()\n\n    // Create query builder\n    qb := fluentsql.New(db)\n\n    // Select query\n    var users []User\n    err = qb.Table(\"users\").\n        Select(\"id\", \"name\", \"email\").\n        Where(\"status\", \"=\", \"active\").\n        WhereIn(\"role\", []interface{}{\"admin\", \"moderator\"}).\n        OrderBy(\"created_at\", \"DESC\").\n        Limit(10).\n        Get(\u0026users)\n\n    // Insert\n    result, err := qb.Table(\"users\").Insert(map[string]interface{}{\n        \"name\":  \"John Doe\",\n        \"email\": \"john@example.com\",\n    })\n\n    // Update\n    result, err = qb.Table(\"users\").\n        Where(\"id\", \"=\", 1).\n        Update(map[string]interface{}{\n            \"status\": \"inactive\",\n        })\n\n    // Delete\n    result, err = qb.Table(\"users\").\n        Where(\"status\", \"=\", \"banned\").\n        Delete()\n}\n\ntype User struct {\n    ID    int    `db:\"id\"`\n    Name  string `db:\"name\"`\n    Email string `db:\"email\"`\n}\n```\n\n## Documentation\n\n📚 **[Full Documentation](https://pkg.go.dev/github.com/biyonik/go-fluent-sql)**\n\n### Query Building\n\n```go\n// Basic WHERE\nqb.Where(\"column\", \"=\", value)\nqb.OrWhere(\"column\", \"!=\", value)\n\n// WHERE IN\nqb.WhereIn(\"status\", []interface{}{\"active\", \"pending\"})\nqb.WhereNotIn(\"role\", []interface{}{\"banned\"})\n\n// WHERE BETWEEN\nqb.WhereBetween(\"age\", 18, 65)\nqb.WhereNotBetween(\"score\", 0, 50)\n\n// WHERE NULL\nqb.WhereNull(\"deleted_at\")\nqb.WhereNotNull(\"email_verified_at\")\n\n// Date queries\nqb.WhereDate(\"created_at\", \"2024-01-15\")\nqb.WhereYear(\"created_at\", 2024)\nqb.WhereMonth(\"created_at\", 12)\n\n// Ordering\nqb.OrderBy(\"created_at\", \"DESC\")\n\n// Pagination\nqb.Limit(10).Offset(20)\n```\n\n### Transactions\n\n```go\ntx, err := fluentsql.BeginTransaction(db)\nif err != nil {\n    return err\n}\n\n// Use transaction\nerr = tx.Table(\"users\").Where(\"id\", \"=\", 1).Update(data)\nif err != nil {\n    tx.Rollback()\n    return err\n}\n\nerr = tx.Table(\"logs\").Insert(logData)\nif err != nil {\n    tx.Rollback()\n    return err\n}\n\nreturn tx.Commit()\n```\n\n### Migrations\n\n```go\nmigrator := migration.NewMigrator(db, migration.NewMySQLGrammar())\n\nerr := migrator.CreateTable(\"users\", func(t *migration.Blueprint) {\n    t.ID()\n    t.String(\"name\", 255)\n    t.String(\"email\", 255).Unique()\n    t.String(\"password\", 255)\n    t.Timestamps()\n    t.SoftDeletes()\n})\n```\n\n## Benchmarks\n\n```\nBenchmarkSelect-8         500000    2340 ns/op    1024 B/op    15 allocs/op\nBenchmarkWhere-8          800000    1456 ns/op     512 B/op     8 allocs/op\nBenchmarkInsert-8         600000    1892 ns/op     768 B/op    12 allocs/op\n```\n\n## Contributing\n\nContributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.\n\n```bash\n# Clone the repo\ngit clone https://github.com/biyonik/go-fluent-sql.git\n\n# Install dependencies\nmake deps\n\n# Run tests\nmake test\n\n# Run linter\nmake lint\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Related Projects\n\n- [go-fluent-validator](https://github.com/biyonik/go-fluent-validator) - Fluent validation library for Go\n\n## Acknowledgments\n\nInspired by Laravel's Eloquent and Query Builder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiyonik%2Fgo-fluent-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiyonik%2Fgo-fluent-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiyonik%2Fgo-fluent-sql/lists"}