{"id":19437024,"url":"https://github.com/netologist/frodao","last_synced_at":"2026-05-18T06:39:34.380Z","repository":{"id":57695468,"uuid":"487547326","full_name":"netologist/frodao","owner":"netologist","description":"Golang DAO library","archived":false,"fork":false,"pushed_at":"2023-06-02T03:54:09.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T05:01:02.883Z","etag":null,"topics":["dao","dao-design-pattern","golang","golang-library","postgres","sql"],"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/netologist.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}},"created_at":"2022-05-01T13:40:09.000Z","updated_at":"2023-11-07T12:59:43.000Z","dependencies_parsed_at":"2023-07-13T05:56:01.047Z","dependency_job_id":null,"html_url":"https://github.com/netologist/frodao","commit_stats":null,"previous_names":["hasanozgan/frodao"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/netologist/frodao","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Ffrodao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Ffrodao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Ffrodao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Ffrodao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netologist","download_url":"https://codeload.github.com/netologist/frodao/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Ffrodao/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33167927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"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":["dao","dao-design-pattern","golang","golang-library","postgres","sql"],"created_at":"2024-11-10T15:13:21.188Z","updated_at":"2026-05-18T06:39:34.357Z","avatar_url":"https://github.com/netologist.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frodao\n\nThe golang DAO library. Your best friend on the road like Frodo Baggins. \n- Soft delete support.\n- Postgresql support.\n- Mysql support.\n\n## Example Schema\n\n```sql\nCREATE TABLE users (\n  id SERIAL PRIMARY KEY NOT NULL,\n  username VARCHAR(50) NOT NULL,\n  password VARCHAR(50) NOT NULL, \n  address VARCHAR(100) NULL, \n  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n  updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n  deleted BOOLEAN NOT NULL DEFAULT FALSE\n);\n```\n\n\n## Table \u0026 DAO Interface\n```go\npackage frodao\n\nimport (\n\t\"context\"\n\n\t\"github.com/netologist/frodao/tableid\"\n)\n\ntype Table[T tableid.Constraint] struct {\n\tRecord `db:\"-\" goqu:\"skipinsert,skipupdate\"`\n\n\tID        ID[T]     `db:\"id\" goqu:\"skipinsert,skipupdate\"`\n\tCreatedAt time.Time `db:\"created_at\" goqu:\"skipinsert,skipupdate\"`\n\tUpdatedAt time.Time `db:\"updated_at\" goqu:\"skipinsert\"`\n\tDeleted   bool      `db:\"deleted\" goqu:\"skipinsert,skipupdate\"`\n}\n\ntype DAO[T Record, I tableid.Constraint] interface {\n\tCreate(ctx context.Context, record *T) (*T, error)\n\tUpdate(ctx context.Context, record *T) error\n\tDelete(ctx context.Context, id ID[I]) error\n\tFindByID(ctx context.Context, id ID[I]) (*T, error)\n\tGetTableName() string\n}\n```\n\n## Custom Table and DAO Definition\n\n```go\nimport (\n\t\"github.com/netologist/frodao\"\n\t\"github.com/netologist/frodao/nullable\"\n\t\"github.com/netologist/frodao/tableid\"\n)\n\ntype UserTable struct {\n\tfrodao.Table[tableid.Int]\n\n\tUsername string                `db:\"username\"`\n\tPassword string                `db:\"password\"`\n\tAddress  nullable.Type[string] `db:\"address\"`\n}\n```\n\n```go\nimport (\n\t\"context\"\n\n\t\"github.com/doug-martin/goqu/v9\"\n\t\"github.com/netologist/frodao/drivers/postgres\"\n\t\"github.com/netologist/frodao/tableid\"\n)\n\nfunc NewUserDAO() *UserDAO {\n\treturn \u0026UserDAO{\n\t\tDAO: postgres.DAO[UserTable, tableid.Int]{\n\t\t\tTableName: \"users\",\n\t\t},\n\t}\n}\n\ntype UserDAO struct {\n\tpostgres.DAO[UserTable]\n}\n\nfunc (d *UserDAO) FindByUsername(ctx context.Context, username string) ([]*UserTable, error) {\n\treturn d.FindByQuery(ctx, d.SelectQuery().Where(goqu.Ex{\"username\": username}).Limit(1))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetologist%2Ffrodao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetologist%2Ffrodao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetologist%2Ffrodao/lists"}