database

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DSNREnvRegex = regexp.MustCompile(`\$\{([A-Za-z0-9_]+)\}`)

Functions

This section is empty.

Types

type ConnectOptions added in v0.4.0

type ConnectOptions struct {
	DSN string

	Scheme   string
	Host     string
	Port     string
	Database string

	User     string
	Password string

	Params map[string]string
}

ConnectOptions represents the structured configuration used to build a DSN. Any field may include ${ENV_VAR} placeholders that will be expanded before use.

type DbEngine

type DbEngine uint8
const (
	Unknown DbEngine = iota
	MySQL
	PostgreSQL
	SQLite
	MSSQL
	Oracle
	HDB
)

func Connect

func Connect(ctx context.Context, opts ConnectOptions) (*sql.DB, DbEngine, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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