Documentation
¶
Index ¶
- Variables
- type OptionFunc
- type 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) 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) 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
- type Result
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) Migrate ¶
func (w *Postgresql) Migrate(dst ...interface{}) error
func (*Postgresql) Transaction ¶
func (w *Postgresql) Transaction(ctx context.Context, fn func(*Postgresql) error) error
Click to show internal directories.
Click to hide internal directories.