Documentation
¶
Index ¶
- Variables
- type Builder
- type Expression
- type OptionFunc
- type Postgresql
- func (w *Postgresql) Clauses(ctx context.Context, conds ...clause.Expression) *Postgresql
- func (w *Postgresql) Create(ctx context.Context, value any) *Result
- func (w *Postgresql) Delete(ctx context.Context, value any, conds ...any) *Result
- func (w *Postgresql) Error() error
- func (w *Postgresql) Exec(ctx context.Context, sql string, values ...any) *Result
- func (w *Postgresql) Find(ctx context.Context, dest any, conds ...any) *Result
- func (w *Postgresql) First(ctx context.Context, dest any, conds ...any) *Result
- func (w *Postgresql) Migrate(dst ...interface{}) error
- func (w *Postgresql) Model(ctx context.Context, value any) *Postgresql
- func (w *Postgresql) Save(ctx context.Context, value any) *Result
- func (w *Postgresql) Transaction(ctx context.Context, fn func(*Postgresql) error) error
- func (w *Postgresql) Update(ctx context.Context, column string, value any) *Result
- func (w *Postgresql) Updates(values interface{}) *Postgresql
- func (w *Postgresql) Where(query interface{}, args ...interface{}) *Postgresql
- type Result
- type Returning
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = gorm.ErrRecordNotFound
)
Functions ¶
This section is empty.
Types ¶
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) Error ¶ added in v1.5.0
func (w *Postgresql) Error() error
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) Transaction ¶
func (w *Postgresql) Transaction(ctx context.Context, fn func(*Postgresql) error) error
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) RowsAffected ¶
Click to show internal directories.
Click to hide internal directories.