{"id":18655480,"url":"https://github.com/go-rel/mysql","last_synced_at":"2025-10-24T06:32:37.304Z","repository":{"id":38317751,"uuid":"409869421","full_name":"go-rel/mysql","owner":"go-rel","description":"MySQL adapter for REL written in Golang.","archived":false,"fork":false,"pushed_at":"2025-04-08T03:37:07.000Z","size":92,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T08:20:42.148Z","etag":null,"topics":["database","golang","hacktoberfest","mysql","orm"],"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/go-rel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"Fs02"}},"created_at":"2021-09-24T07:15:29.000Z","updated_at":"2024-12-02T01:38:45.000Z","dependencies_parsed_at":"2024-01-08T09:04:42.239Z","dependency_job_id":"48a4e152-5838-4459-acc0-3cfee227ddc9","html_url":"https://github.com/go-rel/mysql","commit_stats":{"total_commits":70,"total_committers":6,"mean_commits":"11.666666666666666","dds":"0.41428571428571426","last_synced_commit":"08a87b439fbb836e157ade642884105f8990f0ea"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fmysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fmysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fmysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fmysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-rel","download_url":"https://codeload.github.com/go-rel/mysql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248449855,"owners_count":21105577,"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":["database","golang","hacktoberfest","mysql","orm"],"created_at":"2024-11-07T07:19:06.377Z","updated_at":"2025-10-24T06:32:32.273Z","avatar_url":"https://github.com/go-rel.png","language":"Go","funding_links":["https://github.com/sponsors/Fs02"],"categories":[],"sub_categories":[],"readme":"# mysql\n\n[![GoDoc](https://godoc.org/github.com/go-rel/mysql?status.svg)](https://pkg.go.dev/github.com/go-rel/mysql)\n[![Tesst](https://github.com/go-rel/mysql/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/go-rel/mysql/actions/workflows/test.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-rel/mysql)](https://goreportcard.com/report/github.com/go-rel/mysql)\n[![codecov](https://codecov.io/gh/go-rel/mysql/branch/main/graph/badge.svg?token=56qOCsVPJF)](https://codecov.io/gh/go-rel/mysql)\n[![Gitter chat](https://badges.gitter.im/go-rel/rel.png)](https://gitter.im/go-rel/rel)\n\nMySQL adapter for REL.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\n\t_ \"github.com/go-sql-driver/mysql\"\n\t\"github.com/go-rel/mysql\"\n\t\"github.com/go-rel/rel\"\n)\n\nfunc main() {\n\t// open mysql connection.\n\t// note: `clientFoundRows=true` is required for update and delete to works correctly.\n\tadapter, err := mysql.Open(\"root@(127.0.0.1:3306)/rel_test?clientFoundRows=true\u0026charset=utf8\u0026parseTime=True\u0026loc=Local\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer adapter.Close()\n\n\t// initialize REL's repo.\n\trepo := rel.New(adapter)\n\trepo.Ping(context.TODO())\n}\n```\n\n## Example Replication (Source/Replica)\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\n\t_ \"github.com/go-sql-driver/mysql\"\n\t\"github.com/go-rel/primaryreplica\"\n\t\"github.com/go-rel/mysql\"\n\t\"github.com/go-rel/rel\"\n)\n\nfunc main() {\n\t// open mysql connection.\n\t// note: `clientFoundRows=true` is required for update and delete to works correctly.\n\tadapter := primaryreplica.New(\n\t\tmysql.MustOpen(\"root@(source:23306)/rel_test?charset=utf8\u0026parseTime=True\u0026loc=Local\"),\n\t\tmysql.MustOpen(\"root@(replica:23307)/rel_test?charset=utf8\u0026parseTime=True\u0026loc=Local\"),\n\t)\n\tdefer adapter.Close()\n\n\t// initialize REL's repo.\n\trepo := rel.New(adapter)\n\trepo.Ping(context.TODO())\n}\n```\n\n## Supported Driver\n\n- github.com/go-sql-driver/mysql\n\n## Supported Database\n\n- MySQL 5 and 8\n- MariaDB 10\n\n## Testing\n\n### Start MariaDB server in Docker\n\n```console\ndocker run -it --rm -p 3307:3306 -e \"MARIADB_ROOT_PASSWORD=test\" -e \"MARIADB_DATABASE=rel_test\" mariadb:10\n```\n\n### Run tests\n\n```console\nMYSQL_DATABASE=\"root:test@tcp(localhost:3307)/rel_test\" go test ./...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-rel%2Fmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-rel%2Fmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-rel%2Fmysql/lists"}