mysql
by
go-sql-driver

Description: Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package

View on GitHub ↗

Summary Information

Updated 46 minutes ago
Added to GitGenius on February 18th, 2025
Created on December 9th, 2012
Open Issues & Pull Requests: 69 (+0)
Number of forks: 2,327
Total Stargazers: 15,270 (+0)
Total Subscribers: 398 (+0)

Issue Activity (beta)

Open issues: 36
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,522 days
Stale 30+ days: 35
Stale 90+ days: 25

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • question (22)
  • database/sql issue (21)
  • enhancement (18)
  • bug (17)
  • waiting for reply (10)
  • invalid (9)
  • help wanted (6)
  • organization (6)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: 21.0 hours
Mean response time: 478.0 days
90th percentile: 1858.0 days
Tracked items: 105

Most active contributors

Detailed Description

Go MySQL Driver is a MySQL driver implementation for Go's database/sql package, providing native connectivity to MySQL and MariaDB databases. Written entirely in Go without C bindings, it implements Go's database/sql/driver interface, allowing developers to use the standard database/sql API for MySQL operations. The driver supports MySQL 5.7 and higher, MariaDB 10.5 and higher, and also works with TiDB, though TiDB support is maintained by PingCAP rather than the go-sql-driver maintainers.

The driver offers lightweight performance through its pure Go implementation and supports multiple connection protocols including TCP/IPv4, TCP/IPv6, Unix domain sockets, and custom protocols via DialFunc. It handles automatic connection pooling through the database/sql package and includes automatic recovery from broken connections. The driver can process queries larger than 16MB and provides full sql.RawBytes support for efficient data handling. It includes intelligent LONG DATA handling in prepared statements and supports zlib compression for network traffic reduction.

Security features are built into the driver's design. It provides secure LOAD DATA LOCAL INFILE support with file allowlisting and io.Reader support, preventing unauthorized file access. The driver supports optional time.Time parsing, optional placeholder interpolation, and various authentication methods including native passwords and cleartext passwords when explicitly enabled. Configuration options allow fine-grained control over connection behavior, including charset and collation settings for proper Unicode support.

Connection management is a key focus area. The driver requires developers to set db.SetConnMaxLifetime() to ensure connections are safely closed before MySQL server, OS, or middleware closes them, with a recommended timeout shorter than five minutes. The db.SetMaxOpenConns() setting is highly recommended to limit connection usage, and db.SetMaxIdleConns() should typically match SetMaxOpenConns() to prevent excessive connection churn. Additional control is available through db.SetConnMaxIdleTime() for more rapid idle connection closure.

The Data Source Name (DSN) format follows a common pattern with optional components for password, protocol, address, and parameters. All values except the database name are optional, allowing flexible configuration from minimal to fully specified connection strings. The driver includes context.Context support and ColumnType support for advanced query operations.

According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 21 hours across 105 tracked items, though mean latency is significantly higher at 11472.9 hours, indicating occasional slower responses on some items. The most active contributor tracked is methane with 161 events, followed by shogo82148 with 8 events and modelorona with 6 events. Enhancement requests and database/sql issues are the most common tracked labels with 4 items each, while help wanted items total 3. The repository shares contributors with major projects including microsoft/vscode, golang/go, and rust-lang/rust, indicating its importance in the broader Go ecosystem.

mysql
by
go-sql-drivergo-sql-driver/mysql

Repository Details

Fetching additional details & charts...