{"id":17436099,"url":"https://github.com/bbfh-dev/go-orm","last_synced_at":"2025-03-01T08:32:44.457Z","repository":{"id":257806583,"uuid":"865872111","full_name":"bbfh-dev/go-orm","owner":"bbfh-dev","description":"Simple and reliable ORM for SQL databases","archived":true,"fork":false,"pushed_at":"2024-10-04T18:10:38.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T03:18:03.635Z","etag":null,"topics":["golang","orm","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbfh-dev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-01T09:25:47.000Z","updated_at":"2024-10-04T18:10:53.000Z","dependencies_parsed_at":"2024-10-02T07:41:20.996Z","dependency_job_id":"7ed92bb1-6fd9-4cde-ac96-a1da5dbc9015","html_url":"https://github.com/bbfh-dev/go-orm","commit_stats":null,"previous_names":["bbfh-dev/go-orm"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fgo-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fgo-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fgo-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fgo-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbfh-dev","download_url":"https://codeload.github.com/bbfh-dev/go-orm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241341372,"owners_count":19947097,"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":["golang","orm","sql"],"created_at":"2024-10-17T10:02:19.490Z","updated_at":"2025-03-01T08:32:44.143Z","avatar_url":"https://github.com/bbfh-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go ORM\n\n\u003e [!IMPORTANT]\n\u003e This project is now archived. It was more of a fun experience developing this, for production it's better to use something like [GORM](https://gorm.io/index.html)\n\nDesigned to be a simple and reliable ORM for SQL databases.\n\nIt doesn't perform any database altering operations unless given permission to. It's explicit in its actions and prints useful debug information using `slog.Debug`.\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Features](#features)\n* [Example](#example)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n# Features\n\n- Automatically syncronize database table with Go struct (CREATE, ALTER, DROP);\n- Query fields / entire tables with ease;\n- Does not perform any operations unless ORM_MIGRATE=1 env is present;\n- Explicit errors prefixed with the operation that caused them;\n- Explicit logging using `slog` (With DEBUG messages per every SQL call)\n\n# Example\n\n```go\n// An example struct, every field must have \"db\" and \"create\" tags\ntype TestTable struct {\n\tExampleId   int64  `db:\"example_id\"  create:\"INTEGER PRIMARY KEY\"`\n\tName        string `db:\"name\"        create:\"TEXT NOT NULL DEFAULT ''\"`\n\tDescription string `db:\"description\" create:\"TEXT NOT NULL DEFAULT ''\"`\n}\n\n// The only required method, returns the name of the table in SQL database\nfunc (table TestTable) SQL() string {\n\treturn \"test_table\"\n}\n\nfunc main() {\n\t// In this example we use SQLite3\n\tsqlDB, err := sqlx.Open(\"libsql\", \"file:/tmp/my.db\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Create the Go-ORM database wrapper\n\tdb := orm.NewDB(sqlDB)\n\t// Tell it what tables we have\n\tdb.Tables = []tables.Table{TestTable{}}\n\n\t// Ensure that SQL database is in-sync with our go struct\n\terr = db.GenMigrations()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbfh-dev%2Fgo-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbfh-dev%2Fgo-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbfh-dev%2Fgo-orm/lists"}