{"id":22056980,"url":"https://github.com/danteay/gomysql","last_synced_at":"2026-04-13T23:33:48.466Z","repository":{"id":100303314,"uuid":"139182068","full_name":"danteay/gomysql","owner":"danteay","description":"A MySQL connection pool based on Circuitbreaker","archived":false,"fork":false,"pushed_at":"2018-06-29T18:37:56.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T16:24:45.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danteay.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":"2018-06-29T18:19:58.000Z","updated_at":"2018-06-29T18:37:57.000Z","dependencies_parsed_at":"2023-05-13T13:30:36.701Z","dependency_job_id":null,"html_url":"https://github.com/danteay/gomysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danteay/gomysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danteay%2Fgomysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danteay%2Fgomysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danteay%2Fgomysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danteay%2Fgomysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danteay","download_url":"https://codeload.github.com/danteay/gomysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danteay%2Fgomysql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31775945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"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":[],"created_at":"2024-11-30T16:15:41.056Z","updated_at":"2026-04-13T23:33:48.448Z","avatar_url":"https://github.com/danteay.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysqlcp\n\n## Install\n\n```bash\ngo get -u -v github.com/danteay/gomysql\n```\n\nAnd import in your files whit the next lines:\n\n```go\nimport (\n  \"database/sql\"\n  \"github.com/danteay/gomysql\"\n)\n```\n\n## Configure\n\nSetup config for circut and recover strategies\n\n```go\nconf := gomysql.MysqlOptions{\n  Url:        \"user:password@/dbname\",\n  Poolsize:   10,\n  FailRate:   0.25,\n  Regenerate: time.Second * 5,\n  TimeOut:    time.Second * 1,\n}\n```\n\nInit connection pool\n\n```go\npool, err := gomysql.InitPool(conf)\n\nif err != nil {\n  fmt.Println(err)\n}\n```\n\nExecute querys inside of the circuit breaker\n\n```go\nvar suma int\n\nerrQuery := pool.Execute(func(db *sql.DB) error {\n  fmt.Println(\"Entra callback\")\n  return db.QueryRow(\"SELECT 1+1 AS suma\").Scan(\u0026suma)\n})\n\nif errQuery != nil {\n  fmt.Println(errQuery)\n}\n```\n\nHealt check of the pool connection\n\n```go\nfmt.Println(\"==\u003e\u003e State: \", pool.State())\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanteay%2Fgomysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanteay%2Fgomysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanteay%2Fgomysql/lists"}