db

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnique = errors.New("unique constraint failed")

Failed unique constraint, conflict.

Functions

This section is empty.

Types

type SQLClient

type SQLClient interface {
	// Begin starts a new transaction.
	Begin(ctx context.Context) (Transaction, error)
	// Exec executes a standard query without returning any rows.
	Exec(ctx context.Context, stmt string, args ...any) (sql.Result, error)
	// Query executes a standard query, returning resulting rows.
	Query(ctx context.Context, stmt string, args ...any) (*sql.Rows, error)
}

type Transaction added in v0.6.0

type Transaction interface {
	// Exec executes a standard query without returning any rows.
	Exec(ctx context.Context, stmt string, args ...any) (sql.Result, error)
	// Query executes a standard query, returning resulting rows.
	Query(ctx context.Context, stmt string, args ...any) (*sql.Rows, error)
	// Commit commits the transaction.
	Commit() error
	// Rollback rolls the transaction back.
	Rollback() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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