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

sql

package
v0.0.0-...-9586d29 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Postgres = "postgres"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxOpenConns int32
	// MaxIdleConns applies to standard SQL pools; it is not used by the PostgreSQL pool.
	MaxIdleConns    int32
	ConnMaxLifetime time.Duration
	ConnMaxIdleTime time.Duration
}

type DB

type DB struct {
	*sql.DB
	// contains filtered or unexported fields
}

DB owns a SQL handle and its underlying connection pool. Pass DB.DB to integrations that require *sql.DB, and close the owning DB to release all resources.

func Open

func Open(dialect string, source string, c ...*Config) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

Close closes the SQL handle before closing its underlying pool.

Jump to

Keyboard shortcuts

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