sql

package
v0.0.0-...-dd0ea4f Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sql implements generic.Executer for the stdlib sql db

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executer

type Executer struct {
	// contains filtered or unexported fields
}

Executer implements the generic.Executer interface for a stlib sql db

func NewExecuter

func NewExecuter(db *sql.DB, opts ...ExecuterOption) Executer

NewExecuter creates a new Executer

func (Executer) Execute

func (executer Executer) Execute(ctx context.Context, run func(generic.SQLRemote) error) error

Execute executes the provided function in a transaction

type ExecuterOption

type ExecuterOption func(*Executer)

ExecuterOption configures the Executer instance

func WithTxOptions

func WithTxOptions(opts *sql.TxOptions) ExecuterOption

WithTxOptions allows setting the TxOptions to use when opening a new transaction

Jump to

Keyboard shortcuts

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