database

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package database provides common interfaces for containerized databases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Pool  *sql.DB
	Close func() // Releases container resources
}

DB wraps a SQL database connection pool with its cleanup function.

func (*DB) Ping

func (d *DB) Ping(ctx context.Context) error

Ping checks if the database is reachable.

func (*DB) Start

func (d *DB) Start(ctx context.Context, fn StartFunc) (*DB, error)

Start starts the database and returns a cleanup function.

type StartFunc

type StartFunc func(ctx context.Context) (*DB, error)

StartFunc is a function that starts a database container.

Jump to

Keyboard shortcuts

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