sql

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataMap

func DataMap[I any, O any](data []*I, err error, mapfn func(in *I, err error) O) []O

Types

type BaseRepository

type BaseRepository struct {
	Da           *DataAccess
	Events       *event.Emitter
	UseNamespace bool
}

func CreateRepository

func CreateRepository(da *DataAccess) BaseRepository

func (*BaseRepository) SetEventEmitter

func (r *BaseRepository) SetEventEmitter(e *event.Emitter)

type DataAccess

type DataAccess struct {
	Sqlx *sqlx.DB
	// tx        *ent.Tx
	// Client    *ent.Client
	Namespace string
}

func GetConnection

func GetConnection(useTransaction bool) *DataAccess

func (*DataAccess) Commit

func (d *DataAccess) Commit()

func (*DataAccess) GetNamespace

func (d *DataAccess) GetNamespace() string

func (*DataAccess) Rollback

func (d *DataAccess) Rollback()

type NamespaceRepo

type NamespaceRepo struct {
	NamespaceId string
}

func (*NamespaceRepo) SetNamespace

func (r *NamespaceRepo) SetNamespace(namespace string)

type Namespacer

type Namespacer interface {
	SetNamespace(namespace string)
}

Jump to

Keyboard shortcuts

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