{"id":18761022,"url":"https://github.com/go-gorm/mysql","last_synced_at":"2025-06-13T10:35:47.204Z","repository":{"id":37221273,"uuid":"268661050","full_name":"go-gorm/mysql","owner":"go-gorm","description":"GORM mysql driver","archived":false,"fork":false,"pushed_at":"2025-06-04T07:33:46.000Z","size":108,"stargazers_count":230,"open_issues_count":7,"forks_count":94,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-04T14:07:01.615Z","etag":null,"topics":["gorm","gorm-mysql-driver","mysql"],"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-gorm.png","metadata":{"funding":{"github":["jinzhu"],"patreon":"jinzhu","open_collective":"gorm"},"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,"zenodo":null}},"created_at":"2020-06-02T00:14:57.000Z","updated_at":"2025-06-04T07:33:41.000Z","dependencies_parsed_at":"2023-02-09T15:16:34.821Z","dependency_job_id":"82b9d65f-7858-4fc6-994b-b05a71e76775","html_url":"https://github.com/go-gorm/mysql","commit_stats":{"total_commits":97,"total_committers":26,"mean_commits":3.730769230769231,"dds":0.5979381443298969,"last_synced_commit":"60607c4f8d0ba8c8802d4ed4937012fb26d69bf6"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/go-gorm/mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-gorm%2Fmysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-gorm%2Fmysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-gorm%2Fmysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-gorm%2Fmysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-gorm","download_url":"https://codeload.github.com/go-gorm/mysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-gorm%2Fmysql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259627878,"owners_count":22886939,"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":["gorm","gorm-mysql-driver","mysql"],"created_at":"2024-11-07T18:14:45.020Z","updated_at":"2025-06-13T10:35:47.177Z","avatar_url":"https://github.com/go-gorm.png","language":"Go","funding_links":["https://github.com/sponsors/jinzhu","https://patreon.com/jinzhu","https://opencollective.com/gorm"],"categories":[],"sub_categories":[],"readme":"# GORM MySQL Driver\n\n## Quick Start\n\n```go\nimport (\n  \"gorm.io/driver/mysql\"\n  \"gorm.io/gorm\"\n)\n\n// https://github.com/go-sql-driver/mysql\ndsn := \"gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8\u0026parseTime=True\u0026loc=Local\"\ndb, err := gorm.Open(mysql.Open(dsn), \u0026gorm.Config{})\n```\n\n## Configuration\n\n```go\nimport (\n  \"gorm.io/driver/mysql\"\n  \"gorm.io/gorm\"\n)\n\nvar datetimePrecision = 2\n\ndb, err := gorm.Open(mysql.New(mysql.Config{\n  DSN: \"gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8\u0026parseTime=True\u0026loc=Local\", // data source name, refer https://github.com/go-sql-driver/mysql#dsn-data-source-name\n  DefaultStringSize: 256, // add default size for string fields, by default, will use db type `longtext` for fields without size, not a primary key, no index defined and don't have default values\n  DisableDatetimePrecision: true, // disable datetime precision support, which not supported before MySQL 5.6\n  DefaultDatetimePrecision: \u0026datetimePrecision, // default datetime precision\n  DontSupportRenameIndex: true, // drop \u0026 create index when rename index, rename index not supported before MySQL 5.7, MariaDB\n  DontSupportRenameColumn: true, // use change when rename column, rename rename not supported before MySQL 8, MariaDB\n  SkipInitializeWithVersion: false, // smart configure based on used version\n}), \u0026gorm.Config{})\n```\n\n## Customized Driver\n\n```go\nimport (\n  _ \"example.com/my_mysql_driver\"\n  \"gorm.io/gorm\"\n  \"gorm.io/driver/mysql\"\n)\n\ndb, err := gorm.Open(mysql.New(mysql.Config{\n  DriverName: \"my_mysql_driver_name\",\n  DSN: \"gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8\u0026parseTime=True\u0026loc=Local\", // data source name, refer https://github.com/go-sql-driver/mysql#dsn-data-source-name\n})\n```\n\nCheckout [https://gorm.io](https://gorm.io) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-gorm%2Fmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-gorm%2Fmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-gorm%2Fmysql/lists"}