SQLDrivers
The database/sql and database/sql/driver packages are designed for using databases from Go and implementing database drivers, respectively.
See the design goals doc:
Drivers
Drivers for Go's sql package include:
- Amazon AWS Athena: uber/athenadriver
- AWS Athena: segmentio/go-athena
- AWS DynamoDB: btnguyen2k/godynamo
- Apache Avatica/Phoenix: apache/calcite-avatica-go
- Apache H2: jmrobles/h2go
- Apache Hive: sql-machine-learning/gohive
- Apache Ignite/GridGain: amsokol/ignite-go-client
- Apache Impala: bippio/go-impala
- Azure Cosmos DB: btnguyen2k/gocosmos
- ClickHouse (uses HTTP API): mailru/go-clickhouse
- ClickHouse (uses native TCP interface): ClickHouse/clickhouse-go
- CockroachDB: Use any PostgreSQL driver
- Couchbase N1QL: couchbase/go_n1ql
- DB2 LUW (uses cgo): asifjalil/cli
- DB2 LUW and DB2/Z with DB2-Connect: https://bitbucket.org/phiggins/db2cli (Last updated 2015-08)
- DB2 LUW, z/OS, iSeries and Informix: ibmdb/go_ibm_db
- Databricks: databricks/databricks-sql-go
- DuckDB: marcboeker/go-duckdb
- Exasol: (pure Go): exasol/exasol-driver-go
- Firebird SQL: nakagami/firebirdsql
- Genji (pure go): genjidb/genji
- Google Cloud BigQuery: solcates/go-sql-bigquery
- Google Cloud Spanner: googleapis/go-sql-spanner
- Google Cloud Spanner: rakyll/go-sql-driver-spanner
- MS ADODB: mattn/go-adodb
- MS SQL Server (pure go): microsoft/go-mssqldb
- MS SQL Server (uses cgo): minus5/gofreetds
- MaxCompute: sql-machine-learning/gomaxcompute
- MySQL: go-sql-driver/mysql
[*]
- MySQL: siddontang/go-mysql
[**]
(also handles replication) - MySQL: ziutek/mymysql
[*]
- ODBC: https://bitbucket.org/miquella/mgodbc (Last updated 2016-02)
- ODBC: alexbrainman/odbc
- Oracle (pure go): sijms/go-ora
- Oracle (uses cgo): godror/godror
- Oracle (uses cgo): mattn/go-oci8
- Oracle (uses cgo): https://gopkg.in/rana/ora.v4
- Postgres (pure Go): jackc/pgx
[*]
- Postgres (pure Go): lib/pq
[*]
- Postgres (uses cgo): jbarham/gopgsqldriver
- Presto: prestodb/presto-go-client
- QL: https://pkg.go.dev/modernc.org/ql
- SAP ASE (pure go): SAP/go-ase
- SAP ASE (uses cgo): SAP/cgo-ase
- SAP HANA (pure go): SAP/go-hdb
- SAP HANA (uses cgo): https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.03/en-US/0ffbe86c9d9f44338441829c6bee15e6.html
- SQL over REST: adaptant-labs/go-sql-rest-driver
- SQLite (uses cgo): gwenn/gosqlite - Supports SQLite dynamic data typing
- SQLite (uses cgo): mattn/go-sqlite3
[*]
- SQLite (uses cgo): mxk/go-sqlite
- SQLite: (pure go): https://modernc.org/sqlite
- SQLite: (pure go): ncruces/go-sqlite3
- SQLite: (uses cgo): rsc/sqlite
- SingleStore: Use any MySQL driver
- Snowflake (pure Go): snowflakedb/gosnowflake
- Sybase ASE (pure go): thda/tds
- Sybase SQL Anywhere: a-palchikov/sqlago
- TiDB: Use any MySQL driver
- Trino: trinodb/trino-go-client
- Vertica: vertica/vertica-sql-go
- Vitess: https://pkg.go.dev/vitess.io/vitess/go/vt/vitessdriver
- YDB (pure go): ydb-platform/ydb-go-sdk
- YQL (Yahoo! Query Language): mattn/go-yql
Drivers marked with [*]
are both included in and pass the compatibility test suite at bradfitz/go-sql-test. Drivers marked with [**]
pass the compatibility test suite but are not currently included in it.