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

database

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package database opens the databases of the dbspec tools by URI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conn

func Conn(ctx context.Context, db *sql.DB) (*sql.Conn, func() error, error)

Conn takes one connection of db and returns it with the function that closes the connection and db and returns both errors; when the connection cannot be taken, db is closed and its error joins the failure.

func MySQLDB

func MySQLDB(u *url.URL) (*sql.DB, error)

MySQLDB opens the MySQL database of the URI u, which is mysql://user@host:port/database, with the go-sql-driver over TCP.

func Open

func Open(dialect, uri string) (*sql.DB, error)

Open opens the URI with the dialect's database/sql driver. The driver of the dialect is registered by the program that opens the database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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