Help us shape the future of Go! Take the 2026 Go Developer Survey

db2

package
v0.5.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAmbiguousDSN = errors.New("ambiguous DB2 DSN: a brace-quoted value appears to contain a later field")

ErrAmbiguousDSN means a brace-quoted value appears to contain a later KEYWORD=value field. The DSN is rejected rather than guessed at, since it may carry credentials.

Functions

func Connect

func Connect(_ context.Context, _ string) (*sql.DB, error)

Connect is a stub used when DB2 support is not compiled in. The go_ibm_db driver requires cgo and the IBM clidriver at build time, so it is only included when building with -tags db2.

func DSNDatabase added in v0.5.15

func DSNDatabase(dsn string) string

DSNDatabase returns the DATABASE keyword value from a native DB2 DSN, or "" if absent or ambiguous.

func IsAuthError added in v0.5.15

func IsAuthError(_ error) bool

IsAuthError is a stub; the DB2 driver error types are unavailable without -tags db2.

func IsNativeDSN added in v0.5.15

func IsNativeDSN(dsn string) bool

IsNativeDSN reports whether dsn is DB2's native ODBC keyword=value form. An ambiguous DSN is treated as not native.

func ParseNativeDSN added in v0.5.15

func ParseNativeDSN(dsn string) (string, bool, error)

ParseNativeDSN reports whether dsn is DB2's native ODBC keyword=value form (not a URL), returning its DATABASE value if present. HOSTNAME, not DATABASE alone, is the native marker.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL