base

package
v0.0.0-...-cb8210d Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package base defines common logic among different transational drivers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultSavePoint

type DefaultSavePoint struct{}

func (*DefaultSavePoint) Create

func (dsp *DefaultSavePoint) Create(id string) string

func (*DefaultSavePoint) Release

func (dsp *DefaultSavePoint) Release(id string) string

func (*DefaultSavePoint) Rollback

func (dsp *DefaultSavePoint) Rollback(id string) string

type SavePointIface

type SavePointIface interface {
	Create(id string) string
	Release(id string) string
	Rollback(id string) string
}

type TxDriver

type TxDriver struct {
	sync.Mutex
	SavePoint  SavePointIface
	RealDriver string // underlying sql driver used to establish real db connections
	// contains filtered or unexported fields
}

TxDriver root type for all other inheriting and transactional drivers

func (*TxDriver) DeleteConn

func (d *TxDriver) DeleteConn(dsn string)

func (*TxDriver) ManualRollback

func (d *TxDriver) ManualRollback()

ManualRollback allow user to control the rollback point

func (*TxDriver) Open

func (d *TxDriver) Open(dsn string) (driver.Conn, error)

Open ensures single transaction by isolating connections by their dsn

type TxDriverIface

type TxDriverIface interface {
	ManualRollback()
	DeleteConn(string)
}

Jump to

Keyboard shortcuts

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