{"id":21152744,"url":"https://github.com/aodin/manager","last_synced_at":"2025-07-10T18:39:01.659Z","repository":{"id":57606674,"uuid":"53807053","full_name":"aodin/manager","owner":"aodin","description":"Totally not an ORM for Go","archived":false,"fork":false,"pushed_at":"2016-06-07T01:47:37.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T08:29:43.874Z","etag":null,"topics":[],"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/aodin.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":"2016-03-13T20:51:03.000Z","updated_at":"2016-03-14T05:29:48.000Z","dependencies_parsed_at":"2022-09-21T01:11:39.172Z","dependency_job_id":null,"html_url":"https://github.com/aodin/manager","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/aodin%2Fmanager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aodin%2Fmanager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aodin%2Fmanager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aodin%2Fmanager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aodin","download_url":"https://codeload.github.com/aodin/manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243597783,"owners_count":20316842,"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":[],"created_at":"2024-11-20T10:46:20.860Z","updated_at":"2025-03-14T14:44:47.669Z","avatar_url":"https://github.com/aodin.png","language":"Go","readme":"Manager\n=======\n\n[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/aodin/manager)\n[![Build Status](https://travis-ci.org/aodin/manager.svg?branch=master)](https://travis-ci.org/aodin/manager)\n\nTotally not an ORM for Go.\n\nFor use with the SQL toolkits [Sol](https://github.com/aodin/sol) and [Fields](https://github.com/aodin/fields).\n\nManager adds convenience methods such as `Get`, auto-joins, and injected conditional clauses to SQL tables.\n\n```go\n// Serial and Timestamp will be set by the database\ntype Item struct {\n    fields.Serial\n    Name   string\n    IsFree bool\n    fields.Timestamp\n}\n\nfunc (item Item) Error(conn sol.Conn) *errors.Error {\n    return nil\n}\n\nfunc (item *Item) Save(conn sol.Conn) error {\n    return conn.Query(Items.Insert().Values(item).Returning(), item)\n}\n\n// Create a Table and immediately wrap it in a manager. Since the TableElem\n// is embedded all its methods are available\nvar Items = postgres.Table(\"items\",\n    fields.Serial{},\n    sol.Column(\"name\", types.Varchar().Limit(32).NotNull()),\n    sol.Column(\"is_free\", types.Boolean().NotNull()),\n    sol.PrimaryKey(\"id\"),\n    fields.Timestamp{},\n)\n\nvar ItemsManager = manager.New(Items)\n\nfunc main() {\n    Items.Use(conn) // A connection must be set\n\n    item := NewItem(\"a\")\n    Items.Save(\u0026item) // Pass a pointer for database-level field assignments\n    log.Println(item.Exists())\n\n    Items.Get(\u0026item, item.ID)\n}\n```\n\nExtend the manager by embedding it in your own struct.\n\nHappy Hacking!\n\naodin, 2016\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faodin%2Fmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faodin%2Fmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faodin%2Fmanager/lists"}