postgres

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStatus

func ConvertStatus(status int64, status_type string) interface{}

Types

type IBaseRepo

type IBaseRepo[C, U, G any] interface {
	Create(C, func(id int64), func(record int64))
	Update(int64, U, func(), func(int64))
	GetOne(int64, func(G), func(int64), ...SubQuery)
	DeleteOne(int64, func(), func(int64))
	ChangeStatus(int64, int64, func(), func(int64))
}

func NewPGXBaseRepo

func NewPGXBaseRepo[C, U, G any](config config.PGXBaseRepoConfig) IBaseRepo[C, U, G]

func NewPQBaseRepo

func NewPQBaseRepo[C, U, G any](config config.PQBaseRepoConfig) IBaseRepo[C, U, G]

func NewSQLXBaseRepo

func NewSQLXBaseRepo[C, U, G any](config config.SQLXBaseRepoConfig) IBaseRepo[C, U, G]

type PGXBaseRepo

type PGXBaseRepo[C, U, G any] struct {
	PrimaryKey string `json:"primary_key"`
	Schema     string `json:"schema"`
	Table      string `json:"table"`
	// contains filtered or unexported fields
}

func (*PGXBaseRepo[C, U, G]) ChangeStatus

func (b *PGXBaseRepo[C, U, G]) ChangeStatus(entity_id, status int64, success func(), failure func(record int64))

func (*PGXBaseRepo[C, U, G]) Create

func (b *PGXBaseRepo[C, U, G]) Create(dat C, success func(id int64), failure func(record int64))

func (*PGXBaseRepo[C, U, G]) DeleteOne

func (b *PGXBaseRepo[C, U, G]) DeleteOne(entity_id int64, success func(), failure func(record int64))

func (*PGXBaseRepo[C, U, G]) GetOne

func (b *PGXBaseRepo[C, U, G]) GetOne(entity_id int64, success func(data G), failure func(record int64), sub_queries ...SubQuery)

func (*PGXBaseRepo[C, U, G]) Update

func (b *PGXBaseRepo[C, U, G]) Update(entity_id int64, dat U, success func(), failure func(record int64))

type PQBaseRepo

type PQBaseRepo[C, U, G any] struct {
	PrimaryKey string `json:"primary_key"`
	Schema     string `json:"schema"`
	Table      string `json:"table"`
	// contains filtered or unexported fields
}

func (*PQBaseRepo[C, U, G]) ChangeStatus

func (b *PQBaseRepo[C, U, G]) ChangeStatus(entity_id, status int64, success func(), failure func(record int64))

func (*PQBaseRepo[C, U, G]) Create

func (b *PQBaseRepo[C, U, G]) Create(dat C, success func(id int64), failure func(record int64))

func (*PQBaseRepo[C, U, G]) DeleteOne

func (b *PQBaseRepo[C, U, G]) DeleteOne(entity_id int64, success func(), failure func(record int64))

func (*PQBaseRepo[C, U, G]) GetOne

func (b *PQBaseRepo[C, U, G]) GetOne(entity_id int64, success func(data G), failure func(record int64), sub_queries ...SubQuery)

func (*PQBaseRepo[C, U, G]) Update

func (b *PQBaseRepo[C, U, G]) Update(entity_id int64, dat U, success func(), failure func(record int64))

type SQLXBaseRepo

type SQLXBaseRepo[C, U, G any] struct {
	PrimaryKey string `json:"primary_key"`
	Schema     string `json:"schema"`
	Table      string `json:"table"`
	// contains filtered or unexported fields
}

func (*SQLXBaseRepo[C, U, G]) ChangeStatus

func (b *SQLXBaseRepo[C, U, G]) ChangeStatus(entity_id, status int64, success func(), failure func(record int64))

func (*SQLXBaseRepo[C, U, G]) Create

func (b *SQLXBaseRepo[C, U, G]) Create(dat C, success func(id int64), failure func(record int64))

func (*SQLXBaseRepo[C, U, G]) DeleteOne

func (b *SQLXBaseRepo[C, U, G]) DeleteOne(entity_id int64, success func(), failure func(record int64))

func (*SQLXBaseRepo[C, U, G]) GetOne

func (b *SQLXBaseRepo[C, U, G]) GetOne(entity_id int64, success func(data G), failure func(record int64), sub_queries ...SubQuery)

func (*SQLXBaseRepo[C, U, G]) Update

func (b *SQLXBaseRepo[C, U, G]) Update(entity_id int64, dat U, success func(), failure func(record int64))

type SubQuery

type SubQuery struct {
	IsSingle bool   `json:"is_one"`
	Alias    string `json:"alias"`
	Query    string `json:"query"`
}

Jump to

Keyboard shortcuts

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