Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/go-hdbPublic

SAP HANA Database Client for Go

License

NotificationsYou must be signed in to change notification settings

SAP/go-hdb

Go ReferenceGo Report CardREUSE status

Go-hdb is a native Go (golang) HANA database driver for Go's sql package. It implements the SAP HANA SQL command network protocol.

For the official SAP HANA client Go support (not this database driver) please seeSAP Help Portal.

Installation

go get -u github.com/SAP/go-hdb/driver

Building

To build go-hdb you need to have a working Go environment of thelatest or second latest Go version.

Documentation

API documentation and documented examples can be found athttps://pkg.go.dev/github.com/SAP/go-hdb/driver.

HANA cloud connection

HANA cloud connection proxy is using SNI which does require a TLS connection.As default one can rely on the root certificate set provided by the host, which already comes with the nessecaryDigiCert certificates (CA, G5).For more information onGo tls certificate handling, please seehttps://pkg.go.dev/crypto/tls#Config.

Assuming the HANA cloud 'endpoint' is "something.hanacloud.ondemand.com:443". Then the dsn should look as follows:

"hdb://<USER>:<PASSWORD>@something.hanacloud.ondemand.com:443?TLSServerName=something.hanacloud.ondemand.com"

with:

  • TLSServerName same as 'host'

Specific root certificate

In case a specific root certificate (e.g. self-signed) would be needed, the TLSRootCAFile DSN parameter needs topoint to the location in the filesystem where a root certificate file in 'pem-format' is stored.

Tests

To run the driver integration tests a HANA Database server is required. The test user must have privileges to create database schemas.

Set environment variable GOHDBDSN:

#linux exampleexport GOHDBDSN="hdb://user:password@host:port"go test

Using the Go build tag 'unit' only the driver unit tests will be executed (no HANA Database server required):

go test --tags unit

Features

  • Native Go implementation (no C libraries, CGO).
  • Gohttp://golang.org/pkg/database/sql package compliant.
  • Support of database/sql/driver Execer and Queryer interface for parameter free statements and queries.
  • Support of 'bulk' query execution.
  • Support of UTF-8 to / from CESU-8 encodings for HANA Unicode types.
  • Built-in support of HANA decimals as Go rational numbershttp://golang.org/pkg/math/big.
  • Support of Large Object streaming.
  • Support of Stored Procedures with table output parameters.
  • Support of TLS TCP connections.
  • Support of little-endian (e.g. amd64) and big-endian architectures (e.g. s390x).
  • Support ofdriver connector.
  • Support ofPBKDF2 authentication as default and standard user / password as fallback.
  • Support of client certificate (X509) and JWT (JSON Web Token) authentication.
  • Prometheus collectors for driver and extended database statistics.
  • Support ofscanning database rows into go structs.

Dependencies

Licensing

SAP SE or an SAP affiliate company and go-hdb contributors. Please see ourLICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is availablevia the REUSE tool.


[8]ページ先頭

©2009-2025 Movatter.jp