Pure-Go driver for SAP HANA. No cgo, no client library - one static binary. Speaks the HANA SQL Command Network Protocol directly. Built for database/sql, minimal dependencies. Requires Go latest or second latest version.
cfg := driver.NewConnectorConfig()
cfg.Host, cfg.Username, cfg.Password = "host:port", "user", "password"
connector, err := driver.NewConfigConnector(cfg)
// ... handle err
db := sql.OpenDB(connector)
defer db.Close()
// ...
Full runnable example: Example (source).
Looking for SAP's official HANA client for Go? That's here — this is the community driver.
go get github.com/SAP/go-hdb/driver
For HANA Cloud (SNI/TLS), see the cloud connection guide.
Core
database/sql compliant, driver.Connector supportData
driver.StructScanner)Observability
Connector.NativeDriver().Stats()ExStats() (requires driver.OpenDB)slogFor diagnosing latency and tuning throughput, see the performance guide.
To run the driver integration tests, a HANA database server is required. The test user must have privileges to create database schemas.
export GOHDBDSN="hdb://user:password@host:port"
go test ./...
Unit-only (no server):
go test --tags unit ./...
SAP SE or an SAP affiliate company and go-hdb contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
This project integrates AI into its development practices; contributors are expected to review and take ownership of all AI-assisted changes. Its design philosophy and development guidelines are documented in AGENTS.md.
24,636 followers · starred Dec 2017
101 followers · starred Sep 2022
Pure-Go driver for SAP HANA. No cgo, no client library - one static binary. Speaks the HANA SQL Command Network Protocol directly. Built for database/sql, minimal dependencies. Requires Go latest or second latest version.
cfg := driver.NewConnectorConfig()
cfg.Host, cfg.Username, cfg.Password = "host:port", "user", "password"
connector, err := driver.NewConfigConnector(cfg)
// ... handle err
db := sql.OpenDB(connector)
defer db.Close()
// ...
Full runnable example: Example (source).
Looking for SAP's official HANA client for Go? That's here — this is the community driver.
go get github.com/SAP/go-hdb/driver
For HANA Cloud (SNI/TLS), see the cloud connection guide.
Core
database/sql compliant, driver.Connector supportData
driver.StructScanner)Observability
Connector.NativeDriver().Stats()ExStats() (requires driver.OpenDB)slogFor diagnosing latency and tuning throughput, see the performance guide.
To run the driver integration tests, a HANA database server is required. The test user must have privileges to create database schemas.
export GOHDBDSN="hdb://user:password@host:port"
go test ./...
Unit-only (no server):
go test --tags unit ./...
SAP SE or an SAP affiliate company and go-hdb contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
This project integrates AI into its development practices; contributors are expected to review and take ownership of all AI-assisted changes. Its design philosophy and development guidelines are documented in AGENTS.md.
24,636 followers · starred Dec 2017
101 followers · starred Sep 2022