dbcontext

package module
v0.0.0-...-ded953e Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package dbcontext provides DB transaction support for transactions tha span method calls of multiple repositories and services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB represents a DB connection that can be used to run SQL queries.

func New

func New(db *dbx.DB) *DB

New returns a new DB connection that wraps the given dbx.DB instance.

func (*DB) DB

func (db *DB) DB() *dbx.DB

DB returns the dbx.DB wrapped by this object.

func (*DB) With

func (db *DB) With(ctx context.Context) dbx.Builder

With returns a Builder that can be used to build and execute SQL queries. With will return the transaction if it is found in the given context. Otherwise it will return a DB connection associated with the context.

Jump to

Keyboard shortcuts

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