crdb

package
v0.0.0-...-bdb8432 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package crdb implements generic.Executer for cockroachdb

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 cockroachdb with sqlx

func NewExecuter

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

NewExecuter creates a new Executer

func (Executer) Execute

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

Execute executes the provided function in a transaction with the cockroach retries on retryable errors

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