postgresql

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = gorm.ErrRecordNotFound
)

Functions

This section is empty.

Types

type Builder added in v1.1.0

type Builder interface {
	Writer
	WriteQuoted(field interface{})
	AddVar(Writer, ...interface{})
	AddError(error) error
}

type Expression added in v1.1.0

type Expression interface {
	Build(builder Builder)
}

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) Clauses added in v1.1.0

func (w *Postgresql) Clauses(ctx context.Context, conds ...clause.Expression) *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) Error added in v1.5.0

func (w *Postgresql) Error() error

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) Model added in v1.0.1

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

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

func (*Postgresql) Updates added in v1.3.0

func (w *Postgresql) Updates(values interface{}) *Postgresql

func (*Postgresql) Where added in v1.2.0

func (w *Postgresql) Where(query interface{}, args ...interface{}) *Postgresql

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

type Returning added in v1.1.0

type Returning struct {
	clause.Returning
}

type Writer added in v1.1.0

type Writer interface {
	WriteByte(byte) error
	WriteString(string) (int, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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