postgresql

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFound = gorm.ErrRecordNotFound
)

Functions

This section is empty.

Types

type OptionFunc

type OptionFunc = func(option *options)

func WithConn

func WithConn(db *sql.DB) OptionFunc

func WithPreferSimpleProtocol

func WithPreferSimpleProtocol(enable bool) OptionFunc

type Postgresql

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

func New

func New(opt ...OptionFunc) *Postgresql

func (*Postgresql) Create

func (w *Postgresql) Create(ctx context.Context, value any) *Result

func (*Postgresql) Delete

func (w *Postgresql) Delete(ctx context.Context, value any, conds ...any) *Result

func (*Postgresql) Exec

func (w *Postgresql) Exec(ctx context.Context, sql string, values ...any) *Result

func (*Postgresql) Find

func (w *Postgresql) Find(ctx context.Context, dest any, conds ...any) *Result

func (*Postgresql) First

func (w *Postgresql) First(ctx context.Context, dest any, conds ...any) *Result

func (*Postgresql) Migrate

func (w *Postgresql) Migrate(dst ...interface{}) error

func (*Postgresql) Save

func (w *Postgresql) Save(ctx context.Context, value any) *Result

func (*Postgresql) Transaction

func (w *Postgresql) Transaction(ctx context.Context, fn func(*Postgresql) error) error

func (*Postgresql) Update

func (w *Postgresql) Update(ctx context.Context, column string, value any) *Result

type Result

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

func (*Result) Error

func (r *Result) Error() error

func (*Result) RowsAffected

func (r *Result) RowsAffected() int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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