Documentation ¶
Overview ¶
Package gorm provides a way to integrate multiple different versions of gorm / potentially other databases go-atomic if they implement the GormlikeDB interface. This can be achieved by embedding the gorm.DB object in a struct which then implements the GormlikeDB interface. As remote either the [generic.GormRemote] can be used or a custom interface definition which is a subset of the methods offered by gorm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executer ¶
type Executer[T GormlikeDB[Remote], Remote any] struct { // contains filtered or unexported fields }
Executer implements the [generic.Executer] interface for a sqlx db
func NewExecuter ¶
func NewExecuter[T GormlikeDB[Remote], Remote any]( db T, opts ...ExecuterOption[T, Remote], ) Executer[T, Remote]
NewExecuter creates a new Executer
type ExecuterOption ¶
type ExecuterOption[T GormlikeDB[Remote], Remote any] func(*Executer[T, Remote])
ExecuterOption configures the Executer instance
func WithTxOptions ¶
func WithTxOptions[T GormlikeDB[Remote], Remote any]( opts *sql.TxOptions, ) ExecuterOption[T, Remote]
WithTxOptions allows setting the TxOptions to use when opening a new transaction
type GormlikeDB ¶
type GormlikeDB[Remote any] interface { Begin(...*sql.TxOptions) GormlikeDB[Remote] Rollback() GormlikeDB[Remote] Commit() GormlikeDB[Remote] Remote() Remote Error() error }
GormlikeDB is an interface that allows different versions of gorm or other similar db's to be used as executer for [generic.Transacter].